|
| 1 | +// UNSUPPORTED: cuda-8.0, cuda-9.0, cuda-9.1, cuda-9.2, cuda-10.0, cuda-10.1, cuda-10.2 |
| 2 | +// UNSUPPORTED: v8.0, v9.0, v9.1, v9.2, v10.0, v10.1, v10.2 |
| 3 | +// RUN: dpct --format-range=none -out-root %T/prmt %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/prmt/prmt.dp.cpp |
| 5 | +// RUN: %if build_lit %{icpx -c -fsycl %T/prmt/prmt.dp.cpp -o %T/prmt/prmt.dp.o %} |
| 6 | + |
| 7 | +// clang-format off |
| 8 | +#include <cstdint> |
| 9 | +#include <cuda_runtime.h> |
| 10 | + |
| 11 | +__global__ void testKernel1(uint32_t *d_result, uint32_t a) { |
| 12 | + static constexpr uint32_t sel = 0x3210; |
| 13 | + static constexpr uint32_t b = 0; |
| 14 | + uint32_t d; |
| 15 | + |
| 16 | + // CHECK: d = dpct::byte_level_permute_custom(a, b, sel, 0); |
| 17 | + asm volatile("prmt.b32 %0, %1, %2, %3;\n" : "=r"(d) : "r"(a), "n"(b), "n"(sel)); |
| 18 | + |
| 19 | + // CHECK: d = dpct::byte_level_permute_custom(a, b, sel, 1); |
| 20 | + asm volatile("prmt.b32.f4e %0, %1, %2, %3;\n" : "=r"(d) : "r"(a), "n"(b), "n"(sel)); |
| 21 | + |
| 22 | + // CHECK: d = dpct::byte_level_permute_custom(a, b, sel, 2); |
| 23 | + asm volatile("prmt.b32.b4e %0, %1, %2, %3;\n" : "=r"(d) : "r"(a), "n"(b), "n"(sel)); |
| 24 | + |
| 25 | + // CHECK: d = dpct::byte_level_permute_custom(a, b, sel, 3); |
| 26 | + asm volatile("prmt.b32.rc8 %0, %1, %2, %3;\n" : "=r"(d) : "r"(a), "n"(b), "n"(sel)); |
| 27 | + |
| 28 | + // CHECK: d = dpct::byte_level_permute_custom(a, b, sel, 4); |
| 29 | + asm volatile("prmt.b32.ecl %0, %1, %2, %3;\n" : "=r"(d) : "r"(a), "n"(b), "n"(sel)); |
| 30 | + |
| 31 | + // CHECK: d = dpct::byte_level_permute_custom(a, b, sel, 5); |
| 32 | + asm volatile("prmt.b32.ecr %0, %1, %2, %3;\n" : "=r"(d) : "r"(a), "n"(b), "n"(sel)); |
| 33 | + |
| 34 | + // CHECK: d = dpct::byte_level_permute_custom(a, b, sel, 6); |
| 35 | + asm volatile("prmt.b32.rc16 %0, %1, %2, %3;\n" : "=r"(d) : "r"(a), "n"(b), "n"(sel)); |
| 36 | +} |
| 37 | + |
| 38 | +// clang-format on |
0 commit comments