|
| 1 | +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals |
| 2 | +// REQUIRES: amdgpu-registered-target |
| 3 | +// RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -x hip -fno-ident -fcuda-is-device -emit-llvm -o - %s | FileCheck %s |
| 4 | + |
| 5 | +// COM: Most tests are in the OpenCL semastics, this is just a verification for HIP |
| 6 | + |
| 7 | +#define __global__ __attribute__((global)) |
| 8 | + |
| 9 | +//. |
| 10 | +// CHECK: @__hip_cuid_ = addrspace(1) global i8 0 |
| 11 | +// CHECK: @llvm.compiler.used = appending addrspace(1) global [1 x ptr] [ptr addrspacecast (ptr addrspace(1) @__hip_cuid_ to ptr)], section "llvm.metadata" |
| 12 | +//. |
| 13 | +// CHECK: Function Attrs: convergent mustprogress noinline norecurse nounwind optnone |
| 14 | +// CHECK-LABEL: define {{[^@]+}}@_Z21kernel_waves_per_eu_0v |
| 15 | +// CHECK-SAME: () #[[ATTR0:[0-9]+]] { |
| 16 | +// CHECK-NEXT: entry: |
| 17 | +// CHECK-NEXT: ret void |
| 18 | +// |
| 19 | +__global__ __attribute__((amdgpu_waves_per_eu(0))) void kernel_waves_per_eu_0() {} |
| 20 | + |
| 21 | +// Equivalent to kernel_waves_per_eu_0. |
| 22 | +// CHECK: Function Attrs: convergent mustprogress noinline norecurse nounwind optnone |
| 23 | +// CHECK-LABEL: define {{[^@]+}}@_Z23kernel_waves_per_eu_0_0v |
| 24 | +// CHECK-SAME: () #[[ATTR0]] { |
| 25 | +// CHECK-NEXT: entry: |
| 26 | +// CHECK-NEXT: ret void |
| 27 | +// |
| 28 | +__global__ __attribute__((amdgpu_waves_per_eu(0, 0))) void kernel_waves_per_eu_0_0() {} |
| 29 | + |
| 30 | +// CHECK: Function Attrs: convergent mustprogress noinline norecurse nounwind optnone |
| 31 | +// CHECK-LABEL: define {{[^@]+}}@_Z23kernel_waves_per_eu_0_4v |
| 32 | +// CHECK-SAME: () #[[ATTR1:[0-9]+]] { |
| 33 | +// CHECK-NEXT: entry: |
| 34 | +// CHECK-NEXT: ret void |
| 35 | +// |
| 36 | +__global__ __attribute__((amdgpu_waves_per_eu(0, 4))) void kernel_waves_per_eu_0_4() {} |
| 37 | + |
| 38 | +// CHECK: Function Attrs: convergent mustprogress noinline norecurse nounwind optnone |
| 39 | +// CHECK-LABEL: define {{[^@]+}}@_Z23kernel_waves_per_eu_1_4v |
| 40 | +// CHECK-SAME: () #[[ATTR2:[0-9]+]] { |
| 41 | +// CHECK-NEXT: entry: |
| 42 | +// CHECK-NEXT: ret void |
| 43 | +// |
| 44 | +__global__ __attribute__((amdgpu_waves_per_eu(1, 4))) void kernel_waves_per_eu_1_4() {} |
| 45 | +//. |
| 46 | +// CHECK: attributes #[[ATTR0]] = { convergent mustprogress noinline norecurse nounwind optnone "amdgpu-flat-work-group-size"="1,1024" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "uniform-work-group-size"="true" } |
| 47 | +// CHECK: attributes #[[ATTR1]] = { convergent mustprogress noinline norecurse nounwind optnone "amdgpu-flat-work-group-size"="1,1024" "amdgpu-waves-per-eu"="0,4" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "uniform-work-group-size"="true" } |
| 48 | +// CHECK: attributes #[[ATTR2]] = { convergent mustprogress noinline norecurse nounwind optnone "amdgpu-flat-work-group-size"="1,1024" "amdgpu-waves-per-eu"="1,4" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "uniform-work-group-size"="true" } |
| 49 | +//. |
| 50 | +// CHECK: [[META0:![0-9]+]] = !{i32 1, !"amdhsa_code_object_version", i32 600} |
| 51 | +// CHECK: [[META1:![0-9]+]] = !{i32 1, !"amdgpu_printf_kind", !"hostcall"} |
| 52 | +// CHECK: [[META2:![0-9]+]] = !{i32 1, !"wchar_size", i32 4} |
| 53 | +//. |
0 commit comments