brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · edf8775 Raw
31 lines · plain
1// RUN: mlir-opt %s \2// RUN: | mlir-opt -pass-pipeline='builtin.module(cse,func.func(gpu-async-region),xevm-attach-target,gpu.module(convert-gpu-to-llvm-spv{use-64bit-index=true},convert-xevm-to-llvm,cse))' \3// RUN: | mlir-opt -convert-scf-to-cf -convert-cf-to-llvm -convert-vector-to-llvm -convert-arith-to-llvm \4// RUN: | mlir-opt -gpu-to-llvm -reconcile-unrealized-casts -cse -gpu-module-to-binary \5// RUN: | mlir-runner \6// RUN:   --shared-libs=%mlir_sycl_runtime \7// RUN:   --shared-libs=%mlir_runner_utils \8// RUN:   --shared-libs=%mlir_c_runner_utils \9// RUN:   --entry-point-result=void \10// RUN: | FileCheck %s11 12module @test attributes {gpu.container_module} {13  gpu.module @test_module {14    gpu.func @test_printf(%arg0: i32, %arg1: f32) kernel {15      gpu.printf "Hello: %d\n", %arg0 : i3216      gpu.printf "Hello: %f\n", %arg1 : f3217      gpu.return18    }19  }20 21  func.func @main() attributes {llvm.emit_c_interface} {22    %c1 = arith.constant 1 : index23    %c11 = arith.constant 11 : i3224    %c4 = arith.constant 4.0 : f3225    // CHECK: Hello: 1126    // CHECK: Hello: 4.00000027    gpu.launch_func @test_module::@test_printf blocks in (%c1, %c1, %c1) threads in (%c1, %c1, %c1) args(%c11 : i32, %c4 : f32)28    return29  }30}31