From d6bc773d5bb5ddeb714d339f929703e72a37dcf7 Mon Sep 17 00:00:00 2001 From: Aditya Atluri Date: Fri, 25 Mar 2016 06:41:49 -0500 Subject: [PATCH] updated hipdevicesync test --- hipamd/tests/src/CMakeLists.txt | 3 +- hipamd/tests/src/hipFuncDeviceSynchronize.cpp | 29 ++++++++++++++----- 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/hipamd/tests/src/CMakeLists.txt b/hipamd/tests/src/CMakeLists.txt index e5adf4e4d3..acd2060647 100644 --- a/hipamd/tests/src/CMakeLists.txt +++ b/hipamd/tests/src/CMakeLists.txt @@ -154,6 +154,7 @@ make_hip_executable (hipMemoryAllocate hipMemoryAllocate.cpp) make_hip_executable (hipFuncSetDeviceFlags hipFuncSetDeviceFlags.cpp) make_hip_executable (hipFuncGetDevice hipFuncGetDevice.cpp) make_hip_executable (hipFuncSetDevice hipFuncSetDevice.cpp) +make_hip_executable (hipFuncDeviceSynchronize hipFuncDeviceSynchronize.cpp) make_test(hip_ballot " " ) make_test(hip_anyall " " ) @@ -194,6 +195,6 @@ make_test(hipMemoryAllocate " ") make_test(hipFuncSetDeviceFlags " ") make_test(hipFuncGetDevice " ") make_test(hipFuncSetDevice " ") - +make_test(hipFuncDeviceSynchronize " ") make_hipify_test(specialFunc.cu ) diff --git a/hipamd/tests/src/hipFuncDeviceSynchronize.cpp b/hipamd/tests/src/hipFuncDeviceSynchronize.cpp index 306136d1a9..bb274f47bc 100644 --- a/hipamd/tests/src/hipFuncDeviceSynchronize.cpp +++ b/hipamd/tests/src/hipFuncDeviceSynchronize.cpp @@ -17,18 +17,23 @@ OUT OF OR INN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +/* + * Test for checking the functionality of + * hipError_t hipDeviceSynchronize(); +*/ + #include"test_common.h" #define _SIZE sizeof(int)*1024*1024 -#define NUM_STREAMS 10 +#define NUM_STREAMS 2 __global__ void Iter(hipLaunchParm lp, int *Ad, int num){ -int tx = hipThreadIdx_x + hipBlockIdx_x * hipBlockDim_x; -if(tx == 0){ -for(int i = 0; i