|
| 1 | +// RUN: %clang_cc1 -triple nvptx64-nvidia-cuda -fclangir -target-cpu sm_70 \ |
| 2 | +// RUN: -fcuda-is-device -target-feature +ptx60 \ |
| 3 | +// RUN: -emit-cir -o - -x cuda %s \ |
| 4 | +// RUN: | FileCheck -check-prefix=CIR %s |
| 5 | +// RUN: %clang_cc1 -triple nvptx64-nvidia-cuda -fclangir -target-cpu sm_80 \ |
| 6 | +// RUN: -fcuda-is-device -target-feature +ptx65 \ |
| 7 | +// RUN: -emit-cir -o - -x cuda %s \ |
| 8 | +// RUN: | FileCheck -check-prefix=CIR %s |
| 9 | +// RUN: %clang_cc1 -triple nvptx64-nvidia-cuda -fclangir -target-cpu sm_80 \ |
| 10 | +// RUN: -fcuda-is-device -target-feature +ptx70 \ |
| 11 | +// RUN: -emit-cir -o - -x cuda %s \ |
| 12 | +// RUN: | FileCheck -check-prefix=CIR %s |
| 13 | + |
| 14 | +// RUN: %clang_cc1 -triple nvptx64-nvidia-cuda -fclangir -target-cpu sm_70 \ |
| 15 | +// RUN: -fcuda-is-device -target-feature +ptx60 \ |
| 16 | +// RUN: -emit-llvm -o - -x cuda %s \ |
| 17 | +// RUN: | FileCheck -check-prefix=LLVM %s |
| 18 | +// RUN: %clang_cc1 -triple nvptx64-nvidia-cuda -fclangir -target-cpu sm_80 \ |
| 19 | +// RUN: -fcuda-is-device -target-feature +ptx65 \ |
| 20 | +// RUN: -emit-llvm -o - -x cuda %s \ |
| 21 | +// RUN: | FileCheck -check-prefix=LLVM %s |
| 22 | +// RUN: %clang_cc1 -triple nvptx64-nvidia-cuda -fclangir -target-cpu sm_80 \ |
| 23 | +// RUN: -fcuda-is-device -target-feature +ptx70 \ |
| 24 | +// RUN: -emit-llvm -o - -x cuda %s \ |
| 25 | +// RUN: | FileCheck -check-prefix=LLVM %s |
| 26 | + |
| 27 | +// RUN: %clang_cc1 -triple nvptx64-nvidia-cuda -target-cpu sm_70 \ |
| 28 | +// RUN: -fcuda-is-device -target-feature +ptx60 \ |
| 29 | +// RUN: -emit-llvm -o - -x cuda %s \ |
| 30 | +// RUN: | FileCheck -check-prefix=OGCHECK %s |
| 31 | +// RUN: %clang_cc1 -triple nvptx64-nvidia-cuda -target-cpu sm_80 \ |
| 32 | +// RUN: -fcuda-is-device -target-feature +ptx65 \ |
| 33 | +// RUN: -emit-llvm -o - -x cuda %s \ |
| 34 | +// RUN: | FileCheck -check-prefix=OGCHECK %s |
| 35 | +// RUN: %clang_cc1 -triple nvptx64-nvidia-cuda -target-cpu sm_80 \ |
| 36 | +// RUN: -fcuda-is-device -target-feature +ptx70 \ |
| 37 | +// RUN: -emit-llvm -o - -x cuda %s \ |
| 38 | +// RUN: | FileCheck -check-prefix=OGCHECK %s |
| 39 | + |
| 40 | +#define __device__ __attribute__((device)) |
| 41 | +#define __global__ __attribute__((global)) |
| 42 | +#define __shared__ __attribute__((shared)) |
| 43 | +#define __constant__ __attribute__((constant)) |
| 44 | + |
| 45 | +typedef unsigned long long uint64_t; |
| 46 | + |
| 47 | +__device__ void nvvm_sync(unsigned mask, int i, float f, int a, int b, |
| 48 | + bool pred, uint64_t i64) { |
| 49 | + |
| 50 | + // CIR: cir.llvm.intrinsic "nvvm.bar.warp.sync" {{.*}} : (!u32i) |
| 51 | + // LLVM: call void @llvm.nvvm.bar.warp.sync(i32 |
| 52 | + // OGCHECK: call void @llvm.nvvm.bar.warp.sync(i32 |
| 53 | + __nvvm_bar_warp_sync(mask); |
| 54 | + |
| 55 | +} |
0 commit comments