brintos

brintos / llvm-project-archived public Read only

0
0
Text · 967 B · 8327ec4 Raw
30 lines · plain
1// RUN: mlir-opt %s \2// RUN: | mlir-opt -pass-pipeline='builtin.module(gpu.module(strip-debuginfo,convert-gpu-to-rocdl{index-bitwidth=32 runtime=HIP}),rocdl-attach-target{chip=%chip})' \3// RUN: | mlir-opt -gpu-to-llvm -reconcile-unrealized-casts -gpu-module-to-binary \4// RUN: | mlir-runner \5// RUN:   --shared-libs=%mlir_rocm_runtime \6// RUN:   --shared-libs=%mlir_runner_utils \7// RUN:   --entry-point-result=void \8// RUN: | FileCheck %s9 10// CHECK: Hello from 011// CHECK: Hello from 112module attributes {gpu.container_module} {13    gpu.module @kernels {14        gpu.func @hello() kernel {15            %0 = gpu.thread_id x16            gpu.printf "Hello from %d\n", %0 : index17            gpu.return18        }19    }20 21    func.func @main() {22        %c2 = arith.constant 2 : index23        %c1 = arith.constant 1 : index24        gpu.launch_func @kernels::@hello25            blocks in (%c1, %c1, %c1)26            threads in (%c2, %c1, %c1)27        return28    }29}30