diff --git a/projects/clr/hipamd/tests/src/CMakeLists.txt b/projects/clr/hipamd/tests/src/CMakeLists.txt index c507ac2ba1..749b362297 100644 --- a/projects/clr/hipamd/tests/src/CMakeLists.txt +++ b/projects/clr/hipamd/tests/src/CMakeLists.txt @@ -198,7 +198,7 @@ make_hip_executable (hipMemcpyAll hipMemcpyAll.cpp) make_hip_executable (hipMultiThreadDevice hipMultiThreadDevice.cpp) make_hip_executable (hipTestMemcpyPin hipTestMemcpyPin.cpp) make_hip_executable (hipDynamicShared hipDynamicShared.cpp) - +make_hip_executable (hipTestDevice hipTestDevice.cpp) make_test(hip_ballot " " ) make_test(hip_anyall " " ) make_test(hip_popc " " ) @@ -240,6 +240,7 @@ make_test(hipFuncSetDeviceFlags " ") make_test(hipFuncGetDevice " ") make_test(hipFuncDeviceSynchronize " ") make_test(hipTestMemcpyPin " ") +make_test(hipTestDevice " ") make_named_test (hipMultiThreadDevice "hipMultiThreadDevice-serial" --tests 0x1) make_named_test (hipMultiThreadDevice "hipMultiThreadDevice-pyramid" --tests 0x4) make_named_test (hipMultiThreadDevice "hipMultiThreadDevice-nearzero" --tests 0x10) diff --git a/projects/clr/hipamd/tests/src/hipTestDevice.cpp b/projects/clr/hipamd/tests/src/hipTestDevice.cpp index 9e6450171b..d36164aed5 100644 --- a/projects/clr/hipamd/tests/src/hipTestDevice.cpp +++ b/projects/clr/hipamd/tests/src/hipTestDevice.cpp @@ -1,12 +1,586 @@ #include"test_common.h" #include"hip_runtime.h" +#include"hip_runtime_api.h" -__device__ void test(){ - test__popc(1); +#define N 512 +#define SIZE N*sizeof(float) + +__global__ void test_sincosf(hipLaunchParm lp, float* a, float* b, float *c){ + int tid = hipThreadIdx_x; + sincosf(a[tid], b+tid, c+tid); } -__global__ void Test(hipLaunchParm lp, int a){ - test(); +__global__ void test_sincospif(hipLaunchParm lp, float* a, float* b, float *c){ + int tid = hipThreadIdx_x; + sincospif(a[tid], b+tid, c+tid); } -int main(){} +__global__ void test_fdividef(hipLaunchParm lp, float *a, float* b, float *c){ + int tid = hipThreadIdx_x; + c[tid] = fdividef(a[tid], b[tid]); +} + +__global__ void test_llrintf(hipLaunchParm lp, float *a, long long int *b){ + int tid = hipThreadIdx_x; + b[tid] = llrintf(a[tid]); +} + +__global__ void test_lrintf(hipLaunchParm lp, float *a, long int *b){ + int tid = hipThreadIdx_x; + b[tid] = lrintf(a[tid]); +} + +__global__ void test_rintf(hipLaunchParm lp, float *a, float *b){ + int tid = hipThreadIdx_x; + b[tid] = rintf(a[tid]); +} + +__global__ void test_llroundf(hipLaunchParm lp, float *a, long long int *b){ + int tid = hipThreadIdx_x; + b[tid] = llroundf(a[tid]); +} + +__global__ void test_lroundf(hipLaunchParm lp, float *a, long int *b){ + int tid = hipThreadIdx_x; + b[tid] = lroundf(a[tid]); +} + +__global__ void test_rhypotf(hipLaunchParm lp, float *a, float* b, float *c){ + int tid = hipThreadIdx_x; + c[tid] = rhypotf(a[tid], b[tid]); +} + +__global__ void test_norm3df(hipLaunchParm lp, float *a, float* b, float *c, float *d){ + int tid = hipThreadIdx_x; + d[tid] = norm3df(a[tid], b[tid], c[tid]); +} + +__global__ void test_norm4df(hipLaunchParm lp, float *a, float* b, float *c, float *d, float *e){ + int tid = hipThreadIdx_x; + e[tid] = norm4df(a[tid], b[tid], c[tid], d[tid]); +} + +__global__ void test_normf(hipLaunchParm lp, float *a, float *b){ + int tid = hipThreadIdx_x; + b[tid] = normf(N, a); +} + +__global__ void test_rnorm3df(hipLaunchParm lp, float *a, float* b, float *c, float *d){ + int tid = hipThreadIdx_x; + d[tid] = rnorm3df(a[tid], b[tid], c[tid]); +} + +__global__ void test_rnorm4df(hipLaunchParm lp, float *a, float* b, float *c, float *d, float *e){ + int tid = hipThreadIdx_x; + e[tid] = rnorm4df(a[tid], b[tid], c[tid], d[tid]); +} + +__global__ void test_rnormf(hipLaunchParm lp, float *a, float *b){ + int tid = hipThreadIdx_x; + b[tid] = rnormf(N, a); +} + + + +bool run_sincosf(){ +float *A, *Ad, *B, *C, *Bd, *Cd; +A = new float[N]; +B = new float[N]; +C = new float[N]; +for(int i=0;i