diff --git a/tests/src/runtimeApi/module/global_kernel.cpp b/tests/src/runtimeApi/module/global_kernel.cpp index e1e2b315db..8493cbda37 100644 --- a/tests/src/runtimeApi/module/global_kernel.cpp +++ b/tests/src/runtimeApi/module/global_kernel.cpp @@ -29,11 +29,11 @@ __device__ float myDeviceGlobalArray[16]; extern "C" __global__ void hello_world(const float* a, float* b) { - int tx = hipThreadIdx_x; + int tx = threadIdx.x; b[tx] = a[tx]; } extern "C" __global__ void test_globals(const float* a, float* b) { - int tx = hipThreadIdx_x; + int tx = threadIdx.x; b[tx] = a[tx] + myDeviceGlobal + myDeviceGlobalArray[tx % ARRAY_SIZE]; } diff --git a/tests/src/runtimeApi/module/hipModule.cpp b/tests/src/runtimeApi/module/hipModule.cpp index b13bea1f70..e29c56185f 100644 --- a/tests/src/runtimeApi/module/hipModule.cpp +++ b/tests/src/runtimeApi/module/hipModule.cpp @@ -134,7 +134,7 @@ bool testMultiTargArchCodeObj() { std::string CodeObjL1 = "#include \"hip/hip_runtime.h\"\n"; std::string CodeObjL2 = "extern \"C\" __global__ void hello_world(float* a, float* b) {\n"; - std::string CodeObjL3 = " int tx = hipThreadIdx_x;\n"; + std::string CodeObjL3 = " int tx = threadIdx.x;\n"; std::string CodeObjL4 = " b[tx] = a[tx];\n"; std::string CodeObjL5 = "}"; // Creating the full code object string diff --git a/tests/src/runtimeApi/module/kernel_composite_test.cpp b/tests/src/runtimeApi/module/kernel_composite_test.cpp index 59b7894d20..3923b635eb 100644 --- a/tests/src/runtimeApi/module/kernel_composite_test.cpp +++ b/tests/src/runtimeApi/module/kernel_composite_test.cpp @@ -34,7 +34,7 @@ __device__ int getSquareOfGlobalFloat() { } extern "C" __global__ void testWeightedCopy(int* a, int* b) { - int tx = hipThreadIdx_x; + int tx = threadIdx.x; b[tx] = deviceGlobalInt1*a[tx] + deviceGlobalInt2 + static_cast(deviceGlobalShort) + static_cast(deviceGlobalChar) + getSquareOfGlobalFloat(); diff --git a/tests/src/runtimeApi/module/tex2d_kernel.cpp b/tests/src/runtimeApi/module/tex2d_kernel.cpp index 5ba0ebf89f..f1d008e930 100644 --- a/tests/src/runtimeApi/module/tex2d_kernel.cpp +++ b/tests/src/runtimeApi/module/tex2d_kernel.cpp @@ -31,8 +31,8 @@ __device__ float deviceGlobalFloat; extern "C" __global__ void tex2dKernelFloat(float* outputData, int width, int height) { #if !defined(__HIP_NO_IMAGE_SUPPORT) || !__HIP_NO_IMAGE_SUPPORT - int x = hipBlockIdx_x * hipBlockDim_x + hipThreadIdx_x; - int y = hipBlockIdx_y * hipBlockDim_y + hipThreadIdx_y; + int x = blockIdx.x * blockDim.x + threadIdx.x; + int y = blockIdx.y * blockDim.y + threadIdx.y; if ((x < width) && (y < width)) { outputData[y * width + x] = tex2D(ftex, x, y); } @@ -42,8 +42,8 @@ extern "C" __global__ void tex2dKernelFloat(float* outputData, extern "C" __global__ void tex2dKernelInt(int* outputData, int width, int height) { #if !defined(__HIP_NO_IMAGE_SUPPORT) || !__HIP_NO_IMAGE_SUPPORT - int x = hipBlockIdx_x * hipBlockDim_x + hipThreadIdx_x; - int y = hipBlockIdx_y * hipBlockDim_y + hipThreadIdx_y; + int x = blockIdx.x * blockDim.x + threadIdx.x; + int y = blockIdx.y * blockDim.y + threadIdx.y; if ((x < width) && (y < width)) { outputData[y * width + x] = tex2D(itex, x, y); } @@ -53,8 +53,8 @@ extern "C" __global__ void tex2dKernelInt(int* outputData, extern "C" __global__ void tex2dKernelInt16(short* outputData, int width, int height) { #if !defined(__HIP_NO_IMAGE_SUPPORT) || !__HIP_NO_IMAGE_SUPPORT - int x = hipBlockIdx_x * hipBlockDim_x + hipThreadIdx_x; - int y = hipBlockIdx_y * hipBlockDim_y + hipThreadIdx_y; + int x = blockIdx.x * blockDim.x + threadIdx.x; + int y = blockIdx.y * blockDim.y + threadIdx.y; if ((x < width) && (y < width)) { outputData[y * width + x] = tex2D(stex, x, y); } diff --git a/tests/src/runtimeApi/module/vcpy_kernel.cpp b/tests/src/runtimeApi/module/vcpy_kernel.cpp index 4e1fa558f6..214a869b22 100644 --- a/tests/src/runtimeApi/module/vcpy_kernel.cpp +++ b/tests/src/runtimeApi/module/vcpy_kernel.cpp @@ -23,6 +23,6 @@ THE SOFTWARE. #include "hip/hip_runtime.h" extern "C" __global__ void hello_world(float* a, float* b) { - int tx = hipThreadIdx_x; + int tx = threadIdx.x; b[tx] = a[tx]; }