Skip to content

Commit c3cba62

Browse files
authored
Revert "[SYCL][CUDA] Fix byte-offset issue in libclc Image Support for CUDA (#2068)" (#2109)
This reverts commit 24af4d8. The fix here is to express the size of an object in bytes, not bits. 24af4d8 was a mistake - the fix was already merged. 24af4d8 returns the code to the broken state. This commit reverts it and puts back in the fix.
1 parent 9ddca50 commit c3cba62

File tree

1 file changed

+3
-3
lines changed
  • libclc/ptx-nvidiacl/libspirv/images

1 file changed

+3
-3
lines changed

libclc/ptx-nvidiacl/libspirv/images/image.cl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ typedef float fp32;
230230
int x) { \
231231
struct out_##pixelf_size res = \
232232
__nvvm_suld_1d_v4i##pixelf_size##_##cuda_address_mode##_s( \
233-
image, x * pixelf_size * 4); \
233+
image, x * sizeof(struct out_##pixelf_size)); \
234234
return out_pixelf##pixelf_size(res); \
235235
}
236236

@@ -239,7 +239,7 @@ typedef float fp32;
239239
long image, int x, int y) { \
240240
struct out_##pixelf_size res = \
241241
__nvvm_suld_2d_v4i##pixelf_size##_##cuda_address_mode##_s( \
242-
image, x * pixelf_size * 4, y); \
242+
image, x * sizeof(struct out_##pixelf_size), y); \
243243
return out_pixelf##pixelf_size(res); \
244244
}
245245

@@ -248,7 +248,7 @@ typedef float fp32;
248248
long image, int x, int y, int z) { \
249249
struct out_##pixelf_size res = \
250250
__nvvm_suld_3d_v4i##pixelf_size##_##cuda_address_mode##_s( \
251-
image, x * pixelf_size * 4, y, z); \
251+
image, x * sizeof(struct out_##pixelf_size), y, z); \
252252
return out_pixelf##pixelf_size(res); \
253253
}
254254

0 commit comments

Comments
 (0)