CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
85 lines
3.7 KiB
Common Lisp
85 lines
3.7 KiB
Common Lisp
// RUN: %clang_cc1 -O0 -cl-std=CL2.0 -triple amdgcn-amd-amdhsa -target-cpu gfx942 \
|
|
// RUN: %s -emit-llvm -o - | FileCheck %s
|
|
|
|
// RUN: %clang_cc1 -O0 -cl-std=CL2.0 -triple amdgcn-amd-amdhsa -target-cpu gfx942 \
|
|
// RUN: -S -o - %s | FileCheck -check-prefix=GFX942 %s
|
|
|
|
// REQUIRES: amdgpu-registered-target
|
|
|
|
typedef half __attribute__((ext_vector_type(2))) half2;
|
|
typedef short __attribute__((ext_vector_type(2))) short2;
|
|
|
|
// CHECK-LABEL: test_flat_add_f32
|
|
// CHECK: [[RMW:%.+]] = atomicrmw fadd ptr %{{.+}}, float %{{.+}} syncscope("agent") monotonic, align 4, !amdgpu.no.fine.grained.memory !{{[0-9]+}}, !amdgpu.ignore.denormal.mode !{{[0-9]+$}}
|
|
|
|
// GFX942-LABEL: test_flat_add_f32
|
|
// GFX942: flat_atomic_add_f32
|
|
half2 test_flat_add_f32(__generic float *addr, float x) {
|
|
return __builtin_amdgcn_flat_atomic_fadd_f32(addr, x);
|
|
}
|
|
|
|
// CHECK-LABEL: test_flat_add_2f16
|
|
// CHECK: [[RMW:%.+]] = atomicrmw fadd ptr %{{.+}}, <2 x half> %{{.+}} syncscope("agent") monotonic, align 4, !amdgpu.no.fine.grained.memory !{{[0-9]+$}}
|
|
|
|
// GFX942-LABEL: test_flat_add_2f16
|
|
// GFX942: flat_atomic_pk_add_f16
|
|
half2 test_flat_add_2f16(__generic half2 *addr, half2 x) {
|
|
return __builtin_amdgcn_flat_atomic_fadd_v2f16(addr, x);
|
|
}
|
|
|
|
// CHECK-LABEL: test_flat_add_2bf16
|
|
// CHECK: [[BC0:%.+]] = bitcast <2 x i16> {{.+}} to <2 x bfloat>
|
|
// CHECK: [[RMW:%.+]] = atomicrmw fadd ptr %{{.+}}, <2 x bfloat> [[BC0]] syncscope("agent") monotonic, align 4, !amdgpu.no.fine.grained.memory !{{[0-9]+$}}
|
|
// CHECK-NEXT: bitcast <2 x bfloat> [[RMW]] to <2 x i16>
|
|
|
|
// GFX942-LABEL: test_flat_add_2bf16
|
|
// GFX942: flat_atomic_pk_add_bf16
|
|
short2 test_flat_add_2bf16(__generic short2 *addr, short2 x) {
|
|
return __builtin_amdgcn_flat_atomic_fadd_v2bf16(addr, x);
|
|
}
|
|
|
|
// CHECK-LABEL: test_global_add_2bf16
|
|
// CHECK: [[BC0:%.+]] = bitcast <2 x i16> {{.+}} to <2 x bfloat>
|
|
// CHECK: [[RMW:%.+]] = atomicrmw fadd ptr addrspace(1) %{{.+}}, <2 x bfloat> [[BC0]] syncscope("agent") monotonic, align 4, !amdgpu.no.fine.grained.memory !{{[0-9]+$}}
|
|
// CHECK-NEXT: bitcast <2 x bfloat> [[RMW]] to <2 x i16>
|
|
|
|
// GFX942-LABEL: test_global_add_2bf16
|
|
// GFX942: global_atomic_pk_add_bf16
|
|
short2 test_global_add_2bf16(__global short2 *addr, short2 x) {
|
|
return __builtin_amdgcn_global_atomic_fadd_v2bf16(addr, x);
|
|
}
|
|
|
|
// CHECK-LABEL: test_local_add_2bf16
|
|
|
|
// CHECK: [[BC0:%.+]] = bitcast <2 x i16> {{.+}} to <2 x bfloat>
|
|
// CHECK: [[RMW:%.+]] = atomicrmw fadd ptr addrspace(3) %{{.+}}, <2 x bfloat> [[BC0]] syncscope("agent") monotonic, align 4{{$}}
|
|
// CHECK-NEXT: bitcast <2 x bfloat> [[RMW]] to <2 x i16>
|
|
|
|
// GFX942-LABEL: test_local_add_2bf16
|
|
// GFX942: ds_pk_add_rtn_bf16
|
|
short2 test_local_add_2bf16(__local short2 *addr, short2 x) {
|
|
return __builtin_amdgcn_ds_atomic_fadd_v2bf16(addr, x);
|
|
}
|
|
|
|
// CHECK-LABEL: test_local_add_2f16
|
|
// CHECK: = atomicrmw fadd ptr addrspace(3) %{{.+}}, <2 x half> %{{.+}} monotonic, align 4
|
|
// GFX942-LABEL: test_local_add_2f16
|
|
// GFX942: ds_pk_add_rtn_f16
|
|
half2 test_local_add_2f16(__local half2 *addr, half2 x) {
|
|
return __builtin_amdgcn_ds_atomic_fadd_v2f16(addr, x);
|
|
}
|
|
|
|
// CHECK-LABEL: test_local_add_2f16_noret
|
|
// CHECK: = atomicrmw fadd ptr addrspace(3) %{{.+}}, <2 x half> %{{.+}} monotonic, align 4
|
|
// GFX942-LABEL: test_local_add_2f16_noret
|
|
// GFX942: ds_pk_add_f16
|
|
void test_local_add_2f16_noret(__local half2 *addr, half2 x) {
|
|
__builtin_amdgcn_ds_atomic_fadd_v2f16(addr, x);
|
|
}
|
|
|
|
// CHECK-LABEL: @test_global_add_f32
|
|
// CHECK: = atomicrmw fadd ptr addrspace(1) %{{.+}}, float %{{.+}} syncscope("agent") monotonic, align 4, !amdgpu.no.fine.grained.memory !{{[0-9]+}}, !amdgpu.ignore.denormal.mode !{{[0-9]+$}}
|
|
void test_global_add_f32(float *rtn, global float *addr, float x) {
|
|
*rtn = __builtin_amdgcn_global_atomic_fadd_f32(addr, x);
|
|
}
|