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
99 lines
3.5 KiB
MLIR
99 lines
3.5 KiB
MLIR
// RUN: mlir-opt %s -convert-gpu-to-rocdl='chipset=gfx950' --mlir-print-local-scope | FileCheck %s --check-prefixes=CHECK,GFX9
|
|
// RUN: mlir-opt %s -convert-gpu-to-rocdl='chipset=gfx1201' --mlir-print-local-scope | FileCheck %s --check-prefixes=CHECK,GFX12
|
|
|
|
gpu.module @test_module {
|
|
// CHECK-LABEL: func @barrier_default()
|
|
func.func @barrier_default() {
|
|
// CHECK: llvm.fence syncscope("workgroup") release{{$}}
|
|
// GFX9-NEXT: rocdl.s.barrier
|
|
// GFX12-NEXT: rocdl.s.barrier.signal id = -1
|
|
// GFX12-NEXT: rocdl.s.barrier.wait id = -1
|
|
// CHECK-NEXT: llvm.fence syncscope("workgroup") acquire{{$}}
|
|
gpu.barrier
|
|
func.return
|
|
}
|
|
|
|
// CHECK-LABEL: func @barrier_no_fence()
|
|
func.func @barrier_no_fence() {
|
|
// GFX9-NEXT: rocdl.s.barrier
|
|
// GFX12-NEXT: rocdl.s.barrier.signal id = -1
|
|
// GFX12-NEXT: rocdl.s.barrier.wait id = -1
|
|
// CHECK-NOT: llvm.fence
|
|
gpu.barrier memfence []
|
|
func.return
|
|
}
|
|
|
|
// CHECK-LABEL: func @barrier_workgroup_only()
|
|
func.func @barrier_workgroup_only() {
|
|
// CHECK: llvm.fence syncscope("workgroup") release {llvm.mmra = #llvm.mmra_tag<"amdgpu-synchronize-as":"local">}
|
|
// GFX9-NEXT: rocdl.s.barrier
|
|
// GFX12-NEXT: rocdl.s.barrier.signal id = -1
|
|
// GFX12-NEXT: rocdl.s.barrier.wait id = -1
|
|
// CHECK: llvm.fence syncscope("workgroup") acquire {llvm.mmra = #llvm.mmra_tag<"amdgpu-synchronize-as":"local">}
|
|
gpu.barrier memfence [#gpu.address_space<workgroup>]
|
|
func.return
|
|
}
|
|
|
|
// CHECK-LABEL: func @barrier_global_only()
|
|
func.func @barrier_global_only() {
|
|
// CHECK-NEXT: llvm.fence syncscope("workgroup") release {llvm.mmra = #llvm.mmra_tag<"amdgpu-synchronize-as":"global">}
|
|
// GFX9-NEXT: rocdl.s.barrier
|
|
// GFX12-NEXT: rocdl.s.barrier.signal id = -1
|
|
// GFX12-NEXT: rocdl.s.barrier.wait id = -1
|
|
// CHECK-NEXT: llvm.fence syncscope("workgroup") acquire {llvm.mmra = #llvm.mmra_tag<"amdgpu-synchronize-as":"global">}
|
|
gpu.barrier memfence [#gpu.address_space<global>]
|
|
func.return
|
|
}
|
|
|
|
// CHECK-LABEL: func @barrier_both()
|
|
func.func @barrier_both() {
|
|
// CHECK-NEXT: llvm.fence syncscope("workgroup") release{{$}}
|
|
// GFX9-NEXT: rocdl.s.barrier
|
|
// GFX12-NEXT: rocdl.s.barrier.signal id = -1
|
|
// GFX12-NEXT: rocdl.s.barrier.wait id = -1
|
|
// CHECK-NEXT: llvm.fence syncscope("workgroup") acquire{{$}}
|
|
gpu.barrier memfence [#gpu.address_space<global>, #gpu.address_space<workgroup>]
|
|
func.return
|
|
}
|
|
|
|
// CHECK-LABEL: func @barrier_private_only()
|
|
func.func @barrier_private_only() {
|
|
// GFX9-NEXT: rocdl.s.barrier
|
|
// GFX12-NEXT: rocdl.s.barrier.signal id = -1
|
|
// GFX12-NEXT: rocdl.s.barrier.wait id = -1
|
|
// CHECK-NOT: llvm.fence
|
|
gpu.barrier memfence [#gpu.address_space<private>]
|
|
func.return
|
|
}
|
|
|
|
// GFX9-LABEL: func @barrier_constant_only
|
|
// GFX12-LABEL: func @barrier_constant_only
|
|
func.func @barrier_constant_only() {
|
|
// GFX9-NEXT: rocdl.s.barrier
|
|
// GFX12-NEXT: rocdl.s.barrier.signal id = -1
|
|
// GFX12-NEXT: rocdl.s.barrier.wait id = -1
|
|
// CHECK-NOT: llvm.fence
|
|
// Constant memory is read-only, no fencing needed
|
|
gpu.barrier memfence [#gpu.address_space<constant>]
|
|
func.return
|
|
}
|
|
|
|
// CHECK-LABEL: func @barrier_subgroup_scope
|
|
func.func @barrier_subgroup_scope() {
|
|
// CHECK-NEXT: llvm.fence syncscope("wavefront") release
|
|
// CHECK-NEXT: rocdl.wave.barrier
|
|
// CHECK-NEXT: llvm.fence syncscope("wavefront") acquire
|
|
gpu.barrier scope <subgroup>
|
|
func.return
|
|
}
|
|
|
|
// CHECK-LABEL: func @barrier_subgroup_scope_no_fence
|
|
func.func @barrier_subgroup_scope_no_fence() {
|
|
// CHECK-NEXT: rocdl.wave.barrier
|
|
// CHECK-NOT: llvm.fence
|
|
gpu.barrier scope <subgroup> memfence []
|
|
func.return
|
|
}
|
|
|
|
}
|