Files
TheRock/compiler/amd-llvm/mlir/test/Dialect/OpenACC/acc-routine-to-gpu-func.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

61 lines
1.9 KiB
MLIR

// RUN: mlir-opt %s -acc-routine-to-gpu-func -split-input-file | FileCheck %s
// CHECK: gpu.module @acc_gpu_module {
// CHECK: gpu.func @host_foo
// CHECK: memref.store
// CHECK: gpu.return
acc.routine @routine_seq func(@host_foo) seq
func.func @host_foo(%buf: memref<8xi32>) attributes {acc.specialized_routine = #acc.specialized_routine<@routine_seq, <seq>, "host_foo">} {
%c0 = arith.constant 0 : index
%c0_i32 = arith.constant 0 : i32
memref.store %c0_i32, %buf[%c0] : memref<8xi32>
return
}
// -----
// Bind routine is erased; materialized routine is moved to GPU module.
// CHECK: gpu.module @acc_gpu_module {
// CHECK: gpu.func @host_foo
// CHECK: gpu.return
// CHECK-NOT: acc.routine @routine_bind
acc.routine @routine_seq func(@host_foo) seq
acc.routine @routine_bind func(@host_bind) seq bind("myname")
func.func @host_foo() attributes {acc.specialized_routine = #acc.specialized_routine<@routine_seq, <seq>, "host_foo">} {
return
}
func.func @host_bind() {
return
}
// -----
// One routine with body, one declaration-only; both end up in GPU module.
// CHECK: acc.routine @acc_routine_0
// CHECK: acc.routine @acc_routine_1
// CHECK: gpu.module @{{.*}}
// CHECK-NEXT: gpu.func @devicefunc(){{.*}} {
// CHECK-NEXT: gpu.return
// CHECK-NEXT: }
// CHECK-NEXT: func.func private @declfunc()
module {
acc.routine @acc_routine_0 func(@devicefunc)
func.func @devicefunc() attributes {acc.specialized_routine = #acc.specialized_routine<@acc_routine_0, <seq>, "devicefunc">} {
return
}
acc.routine @acc_routine_1 func(@declfunc)
func.func private @declfunc() -> ()
}
// -----
// nohost routine: host copy is removed after moving to GPU module.
// CHECK: acc.routine @acc_routine_0
// CHECK-NOT: func.func @nohost_vec
module {
acc.routine @acc_routine_0 func(@nohost_vec) vector nohost
func.func @nohost_vec(%arg0: i32) attributes {acc.specialized_routine = #acc.specialized_routine<@acc_routine_0, <vector>, "nohost_vec">} {
return
}
}