31 lines · plain
1// RUN: mlir-opt %s \2// RUN: | mlir-opt -gpu-lower-to-nvvm-pipeline="cubin-format=%gpu_compilation_format allow-pattern-rollback=0" \3// RUN: | mlir-runner \4// RUN: --shared-libs=%mlir_cuda_runtime \5// RUN: --shared-libs=%mlir_runner_utils \6// RUN: --entry-point-result=void \7// RUN: | FileCheck %s8 9// CHECK: Hello from 0, 2, 3.00000010// CHECK: Hello from 1, 2, 3.00000011module attributes {gpu.container_module} {12 gpu.module @kernels {13 gpu.func @hello() kernel {14 %0 = gpu.thread_id x15 %csti8 = arith.constant 2 : i816 %cstf32 = arith.constant 3.0 : f3217 gpu.printf "Hello from %lld, %d, %f\n", %0, %csti8, %cstf32 : index, i8, f3218 gpu.return19 }20 }21 22 func.func @main() {23 %c2 = arith.constant 2 : index24 %c1 = arith.constant 1 : index25 gpu.launch_func @kernels::@hello26 blocks in (%c1, %c1, %c1)27 threads in (%c2, %c1, %c1)28 return29 }30}31