Skip to content

Commit 8e83c9c

Browse files
committed
Address review comments.
1 parent 2a58a76 commit 8e83c9c

File tree

5 files changed

+18
-7
lines changed

5 files changed

+18
-7
lines changed

mlir/lib/ExecutionEngine/LevelZeroRuntimeWrappers.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212

1313
#include "llvm/ADT/Twine.h"
1414

15+
#include "level_zero/ze_api.h"
1516
#include <cassert>
1617
#include <deque>
1718
#include <exception>
1819
#include <functional>
1920
#include <iostream>
20-
#include <level_zero/ze_api.h>
2121
#include <limits>
2222
#include <unordered_set>
2323
#include <vector>

mlir/test/Integration/GPU/LEVELZERO/gpu-addf32-to-spirv.mlir

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: mlir-opt %s -pass-pipeline='builtin.module(spirv-attach-target{ver=v1.0 caps=Addresses,Int64,Kernel},convert-gpu-to-spirv{use-64bit-index=true},gpu.module(spirv.module(spirv-lower-abi-attrs,spirv-update-vce)),func.func(llvm-request-c-wrappers),convert-scf-to-cf,convert-cf-to-llvm,convert-arith-to-llvm,convert-math-to-llvm,convert-func-to-llvm,gpu-to-llvm{use-bare-pointers-for-kernels=true},gpu-module-to-binary,expand-strided-metadata,lower-affine,finalize-memref-to-llvm,reconcile-unrealized-casts)' \
1+
// RUN: mlir-opt %s -pass-pipeline='builtin.module(spirv-attach-target{ver=v1.0 caps=Addresses,Int64,Kernel},convert-gpu-to-spirv{use-64bit-index=true},gpu.module(spirv.module(spirv-lower-abi-attrs,spirv-update-vce)),func.func(llvm-request-c-wrappers),convert-scf-to-cf,convert-to-llvm,gpu-to-llvm{use-bare-pointers-for-kernels=true},gpu-module-to-binary,expand-strided-metadata,lower-affine,reconcile-unrealized-casts)' \
22
// RUN: | mlir-runner \
33
// RUN: --shared-libs=%mlir_levelzero_runtime \
44
// RUN: --shared-libs=%mlir_runner_utils \
@@ -26,7 +26,9 @@ module @add attributes {gpu.container_module} {
2626
memref.copy %arg0, %memref_0 : memref<2x2x2xf32> to memref<2x2x2xf32>
2727
%memref_2 = gpu.alloc host_shared () : memref<2x2x2xf32>
2828
%2 = gpu.wait async
29+
2930
%3 = gpu.launch_func async [%2] @test_kernel::@test_kernel blocks in (%c2, %c2, %c2) threads in (%c1, %c1, %c1) args(%memref_0 : memref<2x2x2xf32>, %mem : memref<2x2x2xf32>, %memref_2 : memref<2x2x2xf32>)
31+
3032
gpu.wait [%3]
3133
%alloc = memref.alloc() : memref<2x2x2xf32>
3234
memref.copy %memref_2, %alloc : memref<2x2x2xf32> to memref<2x2x2xf32>

mlir/test/Integration/GPU/LEVELZERO/gpu-addi64-to-spirv.mlir

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: mlir-opt %s -pass-pipeline='builtin.module(spirv-attach-target{ver=v1.0 caps=Addresses,Int64,Kernel},convert-gpu-to-spirv{use-64bit-index=true},gpu.module(spirv.module(spirv-lower-abi-attrs,spirv-update-vce)),func.func(llvm-request-c-wrappers),convert-scf-to-cf,convert-cf-to-llvm,convert-arith-to-llvm,convert-math-to-llvm,convert-func-to-llvm,gpu-to-llvm{use-bare-pointers-for-kernels=true},gpu-module-to-binary,expand-strided-metadata,lower-affine,finalize-memref-to-llvm,reconcile-unrealized-casts)' \
1+
// RUN: mlir-opt %s -pass-pipeline='builtin.module(spirv-attach-target{ver=v1.0 caps=Addresses,Int64,Kernel},convert-gpu-to-spirv{use-64bit-index=true},gpu.module(spirv.module(spirv-lower-abi-attrs,spirv-update-vce)),func.func(llvm-request-c-wrappers),convert-scf-to-cf,convert-to-llvm,gpu-to-llvm{use-bare-pointers-for-kernels=true},gpu-module-to-binary,expand-strided-metadata,lower-affine,reconcile-unrealized-casts)' \
22
// RUN: | mlir-runner \
33
// RUN: --shared-libs=%mlir_levelzero_runtime \
44
// RUN: --shared-libs=%mlir_runner_utils \
@@ -26,7 +26,9 @@ module @add attributes {gpu.container_module} {
2626
memref.copy %arg0, %memref_0 : memref<3x3xi64> to memref<3x3xi64>
2727
%memref_2 = gpu.alloc host_shared () : memref<3x3xi64>
2828
%2 = gpu.wait async
29+
2930
%3 = gpu.launch_func async [%2] @test_kernel::@test_kernel blocks in (%c3, %c3, %c1) threads in (%c1, %c1, %c1) args(%memref_0 : memref<3x3xi64>, %mem : memref<3x3xi64>, %memref_2 : memref<3x3xi64>)
31+
3032
gpu.wait [%3]
3133
%alloc = memref.alloc() : memref<3x3xi64>
3234
memref.copy %memref_2, %alloc : memref<3x3xi64> to memref<3x3xi64>

mlir/test/Integration/GPU/LEVELZERO/gpu-memcpy-addf32-to-spirv.mlir

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: mlir-opt %s -pass-pipeline='builtin.module(func.func(gpu-async-region),spirv-attach-target{ver=v1.0 caps=Addresses,Int64,Kernel},convert-gpu-to-spirv{use-64bit-index=true},gpu.module(spirv.module(spirv-lower-abi-attrs,spirv-update-vce)),func.func(llvm-request-c-wrappers),convert-scf-to-cf,convert-cf-to-llvm,convert-arith-to-llvm,convert-math-to-llvm,convert-func-to-llvm,gpu-to-llvm{use-bare-pointers-for-kernels=true},gpu-module-to-binary,expand-strided-metadata,lower-affine,finalize-memref-to-llvm,reconcile-unrealized-casts)' \
1+
// RUN: mlir-opt %s -pass-pipeline='builtin.module(func.func(gpu-async-region),spirv-attach-target{ver=v1.0 caps=Addresses,Int64,Kernel},convert-gpu-to-spirv{use-64bit-index=true},gpu.module(spirv.module(spirv-lower-abi-attrs,spirv-update-vce)),func.func(llvm-request-c-wrappers),convert-scf-to-cf,convert-to-llvm,gpu-to-llvm{use-bare-pointers-for-kernels=true},gpu-module-to-binary,expand-strided-metadata,lower-affine,reconcile-unrealized-casts)' \
22
// RUN: | mlir-runner \
33
// RUN: --shared-libs=%mlir_levelzero_runtime \
44
// RUN: --shared-libs=%mlir_runner_utils \
@@ -26,7 +26,9 @@ module @add attributes {gpu.container_module} {
2626
%memref_0 = gpu.alloc () : memref<2x2x2xf32>
2727
gpu.memcpy %memref_0, %arg1 : memref<2x2x2xf32>, memref<2x2x2xf32>
2828
%memref_1 = gpu.alloc () : memref<2x2x2xf32>
29+
2930
gpu.launch_func @test_kernel::@test_kernel blocks in (%c2, %c2, %c2) threads in (%c1, %c1, %c1) args(%memref : memref<2x2x2xf32>, %memref_0 : memref<2x2x2xf32>, %memref_1 : memref<2x2x2xf32>)
31+
3032
%alloc = memref.alloc() : memref<2x2x2xf32>
3133
gpu.memcpy %alloc, %memref_1 : memref<2x2x2xf32>, memref<2x2x2xf32>
3234
gpu.dealloc %memref_1 : memref<2x2x2xf32>

mlir/test/Integration/GPU/LEVELZERO/gpu-reluf32-to-spirv.mlir

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
// RUN: mlir-opt %s -pass-pipeline='builtin.module(spirv-attach-target{ver=v1.0 caps=Addresses,Int64,Kernel},convert-gpu-to-spirv{use-64bit-index=true},gpu.module(spirv.module(spirv-lower-abi-attrs,spirv-update-vce)),func.func(llvm-request-c-wrappers),convert-scf-to-cf,convert-cf-to-llvm,convert-arith-to-llvm,convert-math-to-llvm,convert-func-to-llvm,gpu-to-llvm{use-bare-pointers-for-kernels=true},gpu-module-to-binary,expand-strided-metadata,lower-affine,finalize-memref-to-llvm,reconcile-unrealized-casts)' \
1+
// RUN: mlir-opt %s -pass-pipeline='builtin.module(spirv-attach-target{ver=v1.0 caps=Addresses,Int64,Kernel},convert-gpu-to-spirv{use-64bit-index=true},gpu.module(spirv.module(spirv-lower-abi-attrs,spirv-update-vce)),func.func(llvm-request-c-wrappers),convert-scf-to-cf,convert-to-llvm,gpu-to-llvm{use-bare-pointers-for-kernels=true},gpu-module-to-binary,expand-strided-metadata,lower-affine,reconcile-unrealized-casts)' \
22
// RUN: | mlir-runner \
3-
// RUN: --shared-libs=%mlir_sycl_runtime \
3+
// RUN: --shared-libs=%mlir_levelzero_runtime \
44
// RUN: --shared-libs=%mlir_runner_utils \
55
// RUN: --entry-point-result=void \
66
// RUN: | FileCheck %s
@@ -41,11 +41,16 @@ module @relu attributes {gpu.container_module} {
4141
memref.copy %arg0, %memref : memref<4x5xf32> to memref<4x5xf32>
4242
%memref_0 = gpu.alloc host_shared () : memref<4x5xi1>
4343
%2 = gpu.wait async
44+
4445
%3 = gpu.launch_func async [%2] @test_kernel::@test_kernel blocks in (%c4, %c5, %c1) threads in (%c1, %c1, %c1) args(%memref : memref<4x5xf32>, %cst : f32, %memref_0 : memref<4x5xi1>)
46+
4547
gpu.wait [%3]
4648
%memref_1 = gpu.alloc host_shared () : memref<4x5xf32>
4749
%4 = gpu.wait async
48-
%5 = gpu.launch_func async [%4] @test_kernel_0::@test_kernel blocks in (%c4, %c5, %c1) threads in (%c1, %c1, %c1) args(%memref_0 : memref<4x5xi1>, %memref : memref<4x5xf32>, %cst : f32, %memref_1 : memref<4x5xf32>)
50+
51+
%5 = gpu.launch_func async [%4] @test_kernel_0::@test_kernel blocks in (%c4, %c5, %c1) threads in (%c1, %c1, %c1) args(%memref_0 : memref<4x5xi1>, %memref : memref<4x5xf32>, %cst : f32,
52+
53+
%memref_1 : memref<4x5xf32>)
4954
gpu.wait [%5]
5055
%alloc = memref.alloc() : memref<4x5xf32>
5156
memref.copy %memref_1, %alloc : memref<4x5xf32> to memref<4x5xf32>

0 commit comments

Comments
 (0)