|
| 1 | +// UNSUPPORTED: cuda-8.0, cuda-9.0, cuda-9.1, cuda-9.2, cuda-10.0, cuda-10.1, cuda-10.2, cuda-11.0, cuda-11.1, cuda-11.2, cuda-11.3, cuda-11.4, cuda-11.5, cuda-11.6, cuda-11.7 |
| 2 | +// UNSUPPORTED: v8.0, v9.0, v9.1, v9.2, v10.0, v10.1, v10.2, v11.0, v11.1, v11.2, v11.3, v11.4, v11.5, v11.6, v11.7 |
| 3 | +// RUN: dpct --format-range=none -out-root %T/prefetch %s --cuda-include-path="%cuda-path/include" -- -std=c++14 -x cuda --cuda-host-only |
| 4 | +// RUN: FileCheck %s --match-full-lines --input-file %T/prefetch/prefetch.dp.cpp |
| 5 | +// RUN: %if BUILD_LIT %{icpx -c -DBUILD_TEST -fsycl %T/prefetch/prefetch.dp.cpp -o %T/prefetch/prefetch.dp.o %} |
| 6 | + |
| 7 | +// clang-format off |
| 8 | +#include <cuda_runtime.h> |
| 9 | + |
| 10 | +/* |
| 11 | +Supported syntax: |
| 12 | +----------------- |
| 13 | +prefetch.level [a]; // prefetch to generic addr space cache |
| 14 | +prefetch.global.level [a]; // prefetch to global cache |
| 15 | +
|
| 16 | +Unsupported syntax: |
| 17 | +------------------- |
| 18 | +prefetch.local.level |
| 19 | +prefetch.global.level::eviction_priority [a]; // prefetch to data cache |
| 20 | +prefetchu.L1 [a]; // prefetch to uniform cache |
| 21 | +prefetch{.tensormap_space}.tensormap [a]; // prefetch the tensormap |
| 22 | +
|
| 23 | +.level = { .L1, .L2 }; |
| 24 | +.level::eviction_priority = { .L2::evict_last, .L2::evict_normal }; |
| 25 | +.tensormap_space = { .const, .param }; |
| 26 | +*/ |
| 27 | + |
| 28 | +__global__ void prefetch(int *arr) { |
| 29 | + // CHECK: sycl::ext::oneapi::experimental::prefetch(arr, sycl::ext::oneapi::experimental::properties{sycl::ext::oneapi::experimental::prefetch_hint_L1}); |
| 30 | + asm volatile ("prefetch.L1 [%0];" : : "l"(arr)); |
| 31 | + // CHECK: sycl::ext::oneapi::experimental::prefetch(arr, sycl::ext::oneapi::experimental::properties{sycl::ext::oneapi::experimental::prefetch_hint_L2}); |
| 32 | + asm volatile ("prefetch.L2 [%0];" : : "l"(arr)); |
| 33 | +#ifndef BUILD_TEST |
| 34 | + // CHECK: /* |
| 35 | + // CHECK-NEXT: DPCT1053:{{.*}} Migration of device assembly code is not supported. |
| 36 | + // CHECK-NEXT: */ |
| 37 | + asm volatile ("prefetch.L2::evict_last [%0];" : : "l"(arr)); |
| 38 | + // CHECK: /* |
| 39 | + // CHECK-NEXT: DPCT1053:{{.*}} Migration of device assembly code is not supported. |
| 40 | + // CHECK-NEXT: */ |
| 41 | + asm volatile ("prefetch.L2::evict_normal [%0];" : : "l"(arr)); |
| 42 | +#endif // BUILD_TEST |
| 43 | + |
| 44 | + // CHECK: sycl::ext::oneapi::experimental::prefetch(arr, sycl::ext::oneapi::experimental::properties{sycl::ext::oneapi::experimental::prefetch_hint_L1}); |
| 45 | + asm volatile ("prefetch.global.L1 [%0];" : : "l"(arr)); |
| 46 | + // CHECK: sycl::ext::oneapi::experimental::prefetch(arr, sycl::ext::oneapi::experimental::properties{sycl::ext::oneapi::experimental::prefetch_hint_L2}); |
| 47 | + asm volatile ("prefetch.global.L2 [%0];" : : "l"(arr)); |
| 48 | +#ifndef BUILD_TEST |
| 49 | + // CHECK: /* |
| 50 | + // CHECK-NEXT: DPCT1053:{{.*}} Migration of device assembly code is not supported. |
| 51 | + // CHECK-NEXT: */ |
| 52 | + asm volatile ("prefetch.global.L2::evict_last [%0];" : : "l"(arr)); |
| 53 | + // CHECK: /* |
| 54 | + // CHECK-NEXT: DPCT1053:{{.*}} Migration of device assembly code is not supported. |
| 55 | + // CHECK-NEXT: */ |
| 56 | + asm volatile ("prefetch.global.L2::evict_normal [%0];" : : "l"(arr)); |
| 57 | + |
| 58 | + // CHECK: /* |
| 59 | + // CHECK-NEXT: DPCT1053:{{.*}} Migration of device assembly code is not supported. |
| 60 | + // CHECK-NEXT: */ |
| 61 | + asm volatile ("prefetch.local.L1 [%0];" : : "l"(arr)); |
| 62 | + // CHECK: /* |
| 63 | + // CHECK-NEXT: DPCT1053:{{.*}} Migration of device assembly code is not supported. |
| 64 | + // CHECK-NEXT: */ |
| 65 | + asm volatile ("prefetch.local.L2 [%0];" : : "l"(arr)); |
| 66 | + // CHECK: /* |
| 67 | + // CHECK-NEXT: DPCT1053:{{.*}} Migration of device assembly code is not supported. |
| 68 | + // CHECK-NEXT: */ |
| 69 | + asm volatile ("prefetch.local.L2::evict_last [%0];" : : "l"(arr)); |
| 70 | + // CHECK: /* |
| 71 | + // CHECK-NEXT: DPCT1053:{{.*}} Migration of device assembly code is not supported. |
| 72 | + // CHECK-NEXT: */ |
| 73 | + asm volatile ("prefetch.local.L2::evict_normal [%0];" : : "l"(arr)); |
| 74 | + |
| 75 | + // CHECK: /* |
| 76 | + // CHECK-NEXT: DPCT1053:{{.*}} Migration of device assembly code is not supported. |
| 77 | + // CHECK-NEXT: */ |
| 78 | + asm volatile ("prefetchu.L1 [%0];" : : "l"(arr)); |
| 79 | + |
| 80 | + // CHECK: /* |
| 81 | + // CHECK-NEXT: DPCT1053:{{.*}} Migration of device assembly code is not supported. |
| 82 | + // CHECK-NEXT: */ |
| 83 | + asm volatile ("prefetch.const.tensormap [%0];" : : "l"(arr)); |
| 84 | + // CHECK: /* |
| 85 | + // CHECK-NEXT: DPCT1053:{{.*}} Migration of device assembly code is not supported. |
| 86 | + // CHECK-NEXT: */ |
| 87 | + asm volatile ("prefetch.param.tensormap [%0];" : : "l"(arr)); |
| 88 | +#endif // BUILD_TEST |
| 89 | +} |
| 90 | + |
| 91 | +// clang-format on |
0 commit comments