Skip to content

Commit d40655b

Browse files
[SYCLomatic] add lit case for prefetch (#2717)
1 parent 54351a5 commit d40655b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

clang/test/dpct/asm/prefetch.cu

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ prefetch{.tensormap_space}.tensormap [a]; // prefetch the tensormap
2424
.tensormap_space = { .const, .param };
2525
*/
2626

27+
__device__ void prefetch_h(const uint32_t *addr) {
28+
// CHECK: sycl::ext::oneapi::experimental::prefetch(addr, sycl::ext::oneapi::experimental::properties{sycl::ext::oneapi::experimental::prefetch_hint_L1});
29+
asm("prefetch.L1 [ %1 ];" : "=l"(addr) : "l"(addr));
30+
}
31+
2732
__global__ void prefetch(int *arr) {
2833
/* prefetch of no address space */
2934
// CHECK: sycl::ext::oneapi::experimental::prefetch(arr, sycl::ext::oneapi::experimental::properties{sycl::ext::oneapi::experimental::prefetch_hint_L1});

0 commit comments

Comments
 (0)