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
165 lines
6.5 KiB
C++
165 lines
6.5 KiB
C++
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 4
|
|
// REQUIRES: amdgpu-registered-target
|
|
// REQUIRES: spirv-registered-target
|
|
// RUN: %clang_cc1 %s -emit-llvm -O0 -o - \
|
|
// RUN: -triple=amdgcn-amd-amdhsa | FileCheck --check-prefix=GCN %s
|
|
// RUN: %clang_cc1 %s -emit-llvm -O0 -o - \
|
|
// RUN: -triple=spirv64-amd-amdhsa | FileCheck --check-prefix=AMDGCNSPIRV %s
|
|
|
|
// GCN-LABEL: define dso_local void @_Z25test_memory_fence_successv(
|
|
// GCN-SAME: ) #[[ATTR0:[0-9]+]] {
|
|
// GCN-NEXT: entry:
|
|
// GCN-NEXT: fence syncscope("workgroup") seq_cst
|
|
// GCN-NEXT: fence syncscope("agent") acquire
|
|
// GCN-NEXT: fence seq_cst
|
|
// GCN-NEXT: fence syncscope("agent") acq_rel
|
|
// GCN-NEXT: fence syncscope("workgroup") release
|
|
// GCN-NEXT: ret void
|
|
//
|
|
// AMDGCNSPIRV-LABEL: define spir_func void @_Z25test_memory_fence_successv(
|
|
// AMDGCNSPIRV-SAME: ) addrspace(4) #[[ATTR0:[0-9]+]] {
|
|
// AMDGCNSPIRV-NEXT: entry:
|
|
// AMDGCNSPIRV-NEXT: fence syncscope("workgroup") seq_cst
|
|
// AMDGCNSPIRV-NEXT: fence syncscope("device") acquire
|
|
// AMDGCNSPIRV-NEXT: fence seq_cst
|
|
// AMDGCNSPIRV-NEXT: fence syncscope("device") acq_rel
|
|
// AMDGCNSPIRV-NEXT: fence syncscope("workgroup") release
|
|
// AMDGCNSPIRV-NEXT: ret void
|
|
//
|
|
void test_memory_fence_success() {
|
|
|
|
__builtin_amdgcn_fence(__ATOMIC_SEQ_CST, "workgroup");
|
|
|
|
__builtin_amdgcn_fence(__ATOMIC_ACQUIRE, "agent");
|
|
|
|
__builtin_amdgcn_fence(__ATOMIC_SEQ_CST, "");
|
|
|
|
__builtin_amdgcn_fence(4, "agent");
|
|
|
|
__builtin_amdgcn_fence(3, "workgroup");
|
|
}
|
|
|
|
// GCN-LABEL: define dso_local void @_Z10test_localv(
|
|
// GCN-SAME: ) #[[ATTR0]] {
|
|
// GCN-NEXT: entry:
|
|
// GCN-NEXT: fence syncscope("workgroup") seq_cst, !mmra [[META2:![0-9]+]]
|
|
// GCN-NEXT: fence syncscope("agent") acquire, !mmra [[META2]]
|
|
// GCN-NEXT: fence seq_cst, !mmra [[META2]]
|
|
// GCN-NEXT: fence syncscope("agent") acq_rel, !mmra [[META2]]
|
|
// GCN-NEXT: fence syncscope("workgroup") release, !mmra [[META2]]
|
|
// GCN-NEXT: ret void
|
|
//
|
|
// AMDGCNSPIRV-LABEL: define spir_func void @_Z10test_localv(
|
|
// AMDGCNSPIRV-SAME: ) addrspace(4) #[[ATTR0]] {
|
|
// AMDGCNSPIRV-NEXT: entry:
|
|
// AMDGCNSPIRV-NEXT: fence syncscope("workgroup") seq_cst, !mmra [[META2:![0-9]+]]
|
|
// AMDGCNSPIRV-NEXT: fence syncscope("device") acquire, !mmra [[META2]]
|
|
// AMDGCNSPIRV-NEXT: fence seq_cst, !mmra [[META2]]
|
|
// AMDGCNSPIRV-NEXT: fence syncscope("device") acq_rel, !mmra [[META2]]
|
|
// AMDGCNSPIRV-NEXT: fence syncscope("workgroup") release, !mmra [[META2]]
|
|
// AMDGCNSPIRV-NEXT: ret void
|
|
//
|
|
void test_local() {
|
|
__builtin_amdgcn_fence( __ATOMIC_SEQ_CST, "workgroup", "local");
|
|
|
|
__builtin_amdgcn_fence(__ATOMIC_ACQUIRE, "agent", "local");
|
|
|
|
__builtin_amdgcn_fence(__ATOMIC_SEQ_CST, "", "local");
|
|
|
|
__builtin_amdgcn_fence(4, "agent", "local");
|
|
|
|
__builtin_amdgcn_fence(3, "workgroup", "local");
|
|
}
|
|
|
|
// GCN-LABEL: define dso_local void @_Z11test_globalv(
|
|
// GCN-SAME: ) #[[ATTR0]] {
|
|
// GCN-NEXT: entry:
|
|
// GCN-NEXT: fence syncscope("workgroup") seq_cst, !mmra [[META3:![0-9]+]]
|
|
// GCN-NEXT: fence syncscope("agent") acquire, !mmra [[META3]]
|
|
// GCN-NEXT: fence seq_cst, !mmra [[META3]]
|
|
// GCN-NEXT: fence syncscope("agent") acq_rel, !mmra [[META3]]
|
|
// GCN-NEXT: fence syncscope("workgroup") release, !mmra [[META3]]
|
|
// GCN-NEXT: ret void
|
|
//
|
|
// AMDGCNSPIRV-LABEL: define spir_func void @_Z11test_globalv(
|
|
// AMDGCNSPIRV-SAME: ) addrspace(4) #[[ATTR0]] {
|
|
// AMDGCNSPIRV-NEXT: entry:
|
|
// AMDGCNSPIRV-NEXT: fence syncscope("workgroup") seq_cst, !mmra [[META3:![0-9]+]]
|
|
// AMDGCNSPIRV-NEXT: fence syncscope("device") acquire, !mmra [[META3]]
|
|
// AMDGCNSPIRV-NEXT: fence seq_cst, !mmra [[META3]]
|
|
// AMDGCNSPIRV-NEXT: fence syncscope("device") acq_rel, !mmra [[META3]]
|
|
// AMDGCNSPIRV-NEXT: fence syncscope("workgroup") release, !mmra [[META3]]
|
|
// AMDGCNSPIRV-NEXT: ret void
|
|
//
|
|
void test_global() {
|
|
__builtin_amdgcn_fence( __ATOMIC_SEQ_CST, "workgroup", "global");
|
|
|
|
__builtin_amdgcn_fence(__ATOMIC_ACQUIRE, "agent", "global");
|
|
|
|
__builtin_amdgcn_fence(__ATOMIC_SEQ_CST, "", "global");
|
|
|
|
__builtin_amdgcn_fence(4, "agent", "global");
|
|
|
|
__builtin_amdgcn_fence(3, "workgroup", "global");
|
|
}
|
|
|
|
// GCN-LABEL: define dso_local void @_Z10test_imagev(
|
|
// GCN-SAME: ) #[[ATTR0]] {
|
|
// GCN-NEXT: entry:
|
|
// GCN-NEXT: fence syncscope("workgroup") seq_cst, !mmra [[META2]]
|
|
// GCN-NEXT: fence syncscope("agent") acquire, !mmra [[META2]]
|
|
// GCN-NEXT: fence seq_cst, !mmra [[META2]]
|
|
// GCN-NEXT: fence syncscope("agent") acq_rel, !mmra [[META2]]
|
|
// GCN-NEXT: fence syncscope("workgroup") release, !mmra [[META2]]
|
|
// GCN-NEXT: ret void
|
|
//
|
|
// AMDGCNSPIRV-LABEL: define spir_func void @_Z10test_imagev(
|
|
// AMDGCNSPIRV-SAME: ) addrspace(4) #[[ATTR0]] {
|
|
// AMDGCNSPIRV-NEXT: entry:
|
|
// AMDGCNSPIRV-NEXT: fence syncscope("workgroup") seq_cst, !mmra [[META2]]
|
|
// AMDGCNSPIRV-NEXT: fence syncscope("device") acquire, !mmra [[META2]]
|
|
// AMDGCNSPIRV-NEXT: fence seq_cst, !mmra [[META2]]
|
|
// AMDGCNSPIRV-NEXT: fence syncscope("device") acq_rel, !mmra [[META2]]
|
|
// AMDGCNSPIRV-NEXT: fence syncscope("workgroup") release, !mmra [[META2]]
|
|
// AMDGCNSPIRV-NEXT: ret void
|
|
//
|
|
void test_image() {
|
|
__builtin_amdgcn_fence( __ATOMIC_SEQ_CST, "workgroup", "local");
|
|
|
|
__builtin_amdgcn_fence(__ATOMIC_ACQUIRE, "agent", "local");
|
|
|
|
__builtin_amdgcn_fence(__ATOMIC_SEQ_CST, "", "local");
|
|
|
|
__builtin_amdgcn_fence(4, "agent", "local");
|
|
|
|
__builtin_amdgcn_fence(3, "workgroup", "local");
|
|
}
|
|
|
|
// GCN-LABEL: define dso_local void @_Z10test_mixedv(
|
|
// GCN-SAME: ) #[[ATTR0]] {
|
|
// GCN-NEXT: entry:
|
|
// GCN-NEXT: fence syncscope("workgroup") seq_cst, !mmra [[META4:![0-9]+]]
|
|
// GCN-NEXT: fence syncscope("workgroup") seq_cst, !mmra [[META4]]
|
|
// GCN-NEXT: ret void
|
|
//
|
|
// AMDGCNSPIRV-LABEL: define spir_func void @_Z10test_mixedv(
|
|
// AMDGCNSPIRV-SAME: ) addrspace(4) #[[ATTR0]] {
|
|
// AMDGCNSPIRV-NEXT: entry:
|
|
// AMDGCNSPIRV-NEXT: fence syncscope("workgroup") seq_cst, !mmra [[META4:![0-9]+]]
|
|
// AMDGCNSPIRV-NEXT: fence syncscope("workgroup") seq_cst, !mmra [[META4]]
|
|
// AMDGCNSPIRV-NEXT: ret void
|
|
//
|
|
void test_mixed() {
|
|
__builtin_amdgcn_fence( __ATOMIC_SEQ_CST, "workgroup", "local", "global");
|
|
__builtin_amdgcn_fence( __ATOMIC_SEQ_CST, "workgroup", "local", "local", "global", "local", "local");
|
|
}
|
|
//.
|
|
// GCN: [[META2]] = !{!"amdgpu-synchronize-as", !"local"}
|
|
// GCN: [[META3]] = !{!"amdgpu-synchronize-as", !"global"}
|
|
// GCN: [[META4]] = !{[[META3]], [[META2]]}
|
|
//.
|
|
// AMDGCNSPIRV: [[META2]] = !{!"amdgpu-synchronize-as", !"local"}
|
|
// AMDGCNSPIRV: [[META3]] = !{!"amdgpu-synchronize-as", !"global"}
|
|
// AMDGCNSPIRV: [[META4]] = !{[[META3]], [[META2]]}
|
|
//.
|