Files
TheRock/compiler/amd-llvm/mlir/test/Dialect/GPU/named-barrier.mlir
T
derek.holloway 7502bf64a4
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
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

70 lines
2.1 KiB
MLIR

// RUN: mlir-opt %s --split-input-file -verify-diagnostics | FileCheck %s
// CHECK-LABEL: func @barrier_default
// CHECK-NEXT: gpu.barrier{{$}}
// CHECK-NEXT: return
func.func @barrier_default() {
gpu.barrier
return
}
// -----
// CHECK-LABEL: func @barrier_with_scope
// CHECK-NEXT: gpu.barrier scope <subgroup>
// CHECK-NEXT: return
func.func @barrier_with_scope() {
gpu.barrier scope <subgroup>
return
}
// -----
// CHECK-LABEL: func @barrier_workgroup_scope_not_printed
// CHECK-NEXT: gpu.barrier{{$}}
// CHECK-NEXT: return
func.func @barrier_workgroup_scope_not_printed() {
gpu.barrier scope <workgroup>
return
}
// -----
// CHECK-LABEL: func @barrier_memfence_and_scope
// CHECK-NEXT: gpu.barrier memfence [#gpu.address_space<workgroup>] scope <subgroup>
// CHECK-NEXT: return
func.func @barrier_memfence_and_scope() {
gpu.barrier memfence [#gpu.address_space<workgroup>] scope <subgroup>
return
}
// -----
// CHECK-LABEL: func @initialize_named_barrier
// CHECK: %[[NB:.*]] = gpu.initialize_named_barrier %[[MEMBER_COUNT:.*]] : i32 -> !gpu.named_barrier
// CHECK: gpu.barrier named(%[[NB]] : !gpu.named_barrier)
func.func @initialize_named_barrier(%member_count : i32) {
%nb = gpu.initialize_named_barrier %member_count : i32 -> !gpu.named_barrier
gpu.barrier named(%nb : !gpu.named_barrier)
return
}
// -----
// CHECK-LABEL: func @named_barrier_with_memfence
// CHECK: gpu.barrier named(%{{.*}} : !gpu.named_barrier) memfence [#gpu.address_space<workgroup>]
func.func @named_barrier_with_memfence(%member_count : i32) {
%nb = gpu.initialize_named_barrier %member_count : i32 -> !gpu.named_barrier
gpu.barrier named(%nb : !gpu.named_barrier) memfence [#gpu.address_space<workgroup>]
return
}
// -----
func.func @named_barrier_non_workgroup_scope(%member_count : i32) {
%nb = gpu.initialize_named_barrier %member_count : i32 -> !gpu.named_barrier
// expected-error @+1 {{named barriers require workgroup scope}}
gpu.barrier named(%nb : !gpu.named_barrier) scope <subgroup>
return
}