1// RUN: mlir-opt %s \ 2// RUN: -pass-pipeline='gpu.module(strip-debuginfo,convert-gpu-to-rocdl{index-bitwidth=32 runtime=HIP},gpu-to-hsaco{chip=%chip})' \ 3// RUN: -gpu-to-llvm \ 4// RUN: | mlir-cpu-runner \ 5// RUN: --shared-libs=%linalg_test_lib_dir/libmlir_rocm_runtime%shlibext \ 6// RUN: --shared-libs=%linalg_test_lib_dir/libmlir_runner_utils%shlibext \ 7// RUN: --entry-point-result=void \ 8// RUN: | FileCheck %s 9 10// CHECK: Hello from 0 11// CHECK: Hello from 1 12module attributes {gpu.container_module} { 13 gpu.module @kernels { 14 gpu.func @hello() kernel { 15 %0 = gpu.thread_id x 16 gpu.printf "Hello from %d\n" %0 : index 17 gpu.return 18 } 19 } 20 21 func.func @main() { 22 %c2 = arith.constant 2 : index 23 %c1 = arith.constant 1 : index 24 gpu.launch_func @kernels::@hello 25 blocks in (%c1, %c1, %c1) 26 threads in (%c2, %c1, %c1) 27 return 28 } 29} 30