|
| 1 | +#include "../Inputs/cuda.h" |
| 2 | + |
| 3 | +// REQUIRES: amdgpu-registered-target |
| 4 | +// RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -x hip -std=c++11 -fclangir \ |
| 5 | +// RUN: -target-cpu tonga -fcuda-is-device -emit-cir %s -o %t.cir |
| 6 | +// RUN: FileCheck --check-prefix=CIR --input-file=%t.cir %s |
| 7 | + |
| 8 | +// REQUIRES: amdgpu-registered-target |
| 9 | +// RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -x hip -std=c++11 -fclangir \ |
| 10 | +// RUN: -target-cpu gfx900 -fcuda-is-device -emit-cir %s -o %t.cir |
| 11 | +// RUN: FileCheck --check-prefix=CIR --input-file=%t.cir %s |
| 12 | + |
| 13 | +// REQUIRES: amdgpu-registered-target |
| 14 | +// RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -x hip -std=c++11 -fclangir \ |
| 15 | +// RUN: -target-cpu gfx1010 -fcuda-is-device -emit-cir %s -o %t.cir |
| 16 | +// RUN: FileCheck --check-prefix=CIR --input-file=%t.cir %s |
| 17 | + |
| 18 | +// REQUIRES: amdgpu-registered-target |
| 19 | +// RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -x hip -std=c++11 -fclangir \ |
| 20 | +// RUN: -target-cpu gfx1012 -fcuda-is-device -emit-cir %s -o %t.cir |
| 21 | +// RUN: FileCheck --check-prefix=CIR --input-file=%t.cir %s |
| 22 | + |
| 23 | +// RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -x hip -std=c++11 -fclangir \ |
| 24 | +// RUN: -target-cpu tonga -fcuda-is-device -emit-llvm %s -o %t.ll |
| 25 | +// RUN: FileCheck --check-prefix=LLVM --input-file=%t.ll %s |
| 26 | + |
| 27 | +// RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -x hip -std=c++11 -fclangir \ |
| 28 | +// RUN: -target-cpu gfx900 -fcuda-is-device -emit-llvm %s -o %t.ll |
| 29 | +// RUN: FileCheck --check-prefix=LLVM --input-file=%t.ll %s |
| 30 | + |
| 31 | +// RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -x hip -std=c++11 -fclangir \ |
| 32 | +// RUN: -target-cpu gfx1010 -fcuda-is-device -emit-llvm %s -o %t.ll |
| 33 | +// RUN: FileCheck --check-prefix=LLVM --input-file=%t.ll %s |
| 34 | + |
| 35 | +// RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -x hip -std=c++11 -fclangir \ |
| 36 | +// RUN: -target-cpu gfx1012 -fcuda-is-device -emit-llvm %s -o %t.ll |
| 37 | +// RUN: FileCheck --check-prefix=LLVM --input-file=%t.ll %s |
| 38 | + |
| 39 | +// RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -x hip -std=c++11 \ |
| 40 | +// RUN: -target-cpu tonga -fcuda-is-device -emit-llvm %s -o %t.ll |
| 41 | +// RUN: FileCheck --check-prefix=OGCG --input-file=%t.ll %s |
| 42 | + |
| 43 | +// RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -x hip -std=c++11 \ |
| 44 | +// RUN: -target-cpu gfx900 -fcuda-is-device -emit-llvm %s -o %t.ll |
| 45 | +// RUN: FileCheck --check-prefix=OGCG --input-file=%t.ll %s |
| 46 | + |
| 47 | +// RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -x hip -std=c++11 \ |
| 48 | +// RUN: -target-cpu gfx1010 -fcuda-is-device -emit-llvm %s -o %t.ll |
| 49 | +// RUN: FileCheck --check-prefix=OGCG --input-file=%t.ll %s |
| 50 | + |
| 51 | +// RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -x hip -std=c++11 \ |
| 52 | +// RUN: -target-cpu gfx1012 -fcuda-is-device -emit-llvm %s -o %t.ll |
| 53 | +// RUN: FileCheck --check-prefix=OGCG --input-file=%t.ll %s |
| 54 | + |
| 55 | +//===----------------------------------------------------------------------===// |
| 56 | +// Test AMDGPU builtins |
| 57 | +//===----------------------------------------------------------------------===// |
| 58 | + |
| 59 | +// CIR-LABEL: @_Z18test_div_fixup_f16PDF16_DF16_DF16_DF16_ |
| 60 | +// CIR: cir.llvm.intrinsic "amdgcn.div.fixup" {{.*}} : (!cir.f16, !cir.f16, !cir.f16) -> !cir.f16 |
| 61 | +// LLVM: define{{.*}} void @_Z18test_div_fixup_f16PDF16_DF16_DF16_DF16_ |
| 62 | +// LLVM: call{{.*}} half @llvm.amdgcn.div.fixup.f16(half %{{.+}}, half %{{.+}}, half %{{.+}}) |
| 63 | +// OGCG: define{{.*}} void @_Z18test_div_fixup_f16PDF16_DF16_DF16_DF16_ |
| 64 | +// OGCG: call{{.*}} half @llvm.amdgcn.div.fixup.f16(half %{{.+}}, half %{{.+}}, half %{{.+}}) |
| 65 | +__device__ void test_div_fixup_f16(_Float16* out, _Float16 a, _Float16 b, _Float16 c) { |
| 66 | + *out = __builtin_amdgcn_div_fixuph(a, b, c); |
| 67 | +} |
0 commit comments