Skip to content

Commit 24af4d8

Browse files
authored
[SYCL][CUDA] Fix byte-offset issue in libclc Image Support for CUDA (#2068)
Offset was erroneously expressed in bits. This commit expresses the offset in bytes.
1 parent 11ef88c commit 24af4d8

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 * sizeof(struct out_##pixelf_size)); \
233+
image, x * pixelf_size * 4); \
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 * sizeof(struct out_##pixelf_size), y); \
242+
image, x * pixelf_size * 4, 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 * sizeof(struct out_##pixelf_size), y, z); \
251+
image, x * pixelf_size * 4, y, z); \
252252
return out_pixelf##pixelf_size(res); \
253253
}
254254

0 commit comments

Comments
 (0)