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
71 lines
2.5 KiB
MLIR
71 lines
2.5 KiB
MLIR
// Check if mlir marks the corresponding function with required coroutine attribute.
|
|
//
|
|
// RUN: mlir-opt %s -pass-pipeline="builtin.module(async-to-async-runtime,func.func(async-runtime-ref-counting,async-runtime-ref-counting-opt),convert-async-to-llvm,func.func(convert-linalg-to-loops,convert-scf-to-cf),finalize-memref-to-llvm,func.func(convert-arith-to-llvm),convert-func-to-llvm,reconcile-unrealized-casts)" \
|
|
// RUN: | FileCheck %s
|
|
|
|
// CHECK: llvm.func @async_execute_fn{{.*}}attributes{{.*}}presplitcoroutine
|
|
// CHECK: llvm.func @async_execute_fn_0{{.*}}attributes{{.*}}presplitcoroutine
|
|
// CHECK: llvm.func @async_execute_fn_1{{.*}}attributes{{.*}}presplitcoroutine
|
|
|
|
func.func @main() {
|
|
%i0 = arith.constant 0 : index
|
|
%i1 = arith.constant 1 : index
|
|
%i2 = arith.constant 2 : index
|
|
%i3 = arith.constant 3 : index
|
|
|
|
%c0 = arith.constant 0.0 : f32
|
|
%c1 = arith.constant 1.0 : f32
|
|
%c2 = arith.constant 2.0 : f32
|
|
%c3 = arith.constant 3.0 : f32
|
|
%c4 = arith.constant 4.0 : f32
|
|
|
|
%A = memref.alloc() : memref<4xf32>
|
|
linalg.fill ins(%c0 : f32) outs(%A : memref<4xf32>)
|
|
|
|
%U = memref.cast %A : memref<4xf32> to memref<*xf32>
|
|
call @printMemrefF32(%U): (memref<*xf32>) -> ()
|
|
|
|
memref.store %c1, %A[%i0]: memref<4xf32>
|
|
call @mlirAsyncRuntimePrintCurrentThreadId(): () -> ()
|
|
call @printMemrefF32(%U): (memref<*xf32>) -> ()
|
|
|
|
%outer = async.execute {
|
|
memref.store %c2, %A[%i1]: memref<4xf32>
|
|
func.call @mlirAsyncRuntimePrintCurrentThreadId(): () -> ()
|
|
func.call @printMemrefF32(%U): (memref<*xf32>) -> ()
|
|
|
|
// No op async region to create a token for testing async dependency.
|
|
%noop = async.execute {
|
|
func.call @mlirAsyncRuntimePrintCurrentThreadId(): () -> ()
|
|
async.yield
|
|
}
|
|
|
|
%inner = async.execute [%noop] {
|
|
memref.store %c3, %A[%i2]: memref<4xf32>
|
|
func.call @mlirAsyncRuntimePrintCurrentThreadId(): () -> ()
|
|
func.call @printMemrefF32(%U): (memref<*xf32>) -> ()
|
|
|
|
async.yield
|
|
}
|
|
async.await %inner : !async.token
|
|
|
|
memref.store %c4, %A[%i3]: memref<4xf32>
|
|
func.call @mlirAsyncRuntimePrintCurrentThreadId(): () -> ()
|
|
func.call @printMemrefF32(%U): (memref<*xf32>) -> ()
|
|
|
|
async.yield
|
|
}
|
|
async.await %outer : !async.token
|
|
|
|
call @mlirAsyncRuntimePrintCurrentThreadId(): () -> ()
|
|
call @printMemrefF32(%U): (memref<*xf32>) -> ()
|
|
|
|
memref.dealloc %A : memref<4xf32>
|
|
|
|
return
|
|
}
|
|
|
|
func.func private @mlirAsyncRuntimePrintCurrentThreadId() -> ()
|
|
|
|
func.func private @printMemrefF32(memref<*xf32>) attributes { llvm.emit_c_interface }
|