SWDEV-341956 - update coordinates in dtest runtimeApi (#2761)

Change-Id: I058afba16452d1831067faf31020c979e5a99fa7
Dieser Commit ist enthalten in:
ROCm CI Service Account
2022-06-23 00:36:02 +05:30
committet von GitHub
Ursprung cc15c5e940
Commit 45870b83b2
5 geänderte Dateien mit 11 neuen und 11 gelöschten Zeilen
@@ -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];
}
+1 -1
Datei anzeigen
@@ -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
@@ -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<int>(deviceGlobalShort) + static_cast<int>(deviceGlobalChar)
+ getSquareOfGlobalFloat();
@@ -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);
}
@@ -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];
}