summaryrefslogtreecommitdiffstats
path: root/mlir/test/Dialect/GPU
diff options
context:
space:
mode:
authorTres Popp <tpopp@google.com>2020-01-14 11:09:59 +0100
committerStephan Herhut <herhut@google.com>2020-01-14 12:05:47 +0100
commit4624a1e8ac8a3f69cc887403b976f538f587744a (patch)
tree13cb3b1371abedefbdbd7e09933633acc4aca44c /mlir/test/Dialect/GPU
parent9492e9d8cfd356109276da5aa926b297db0e16db (diff)
downloadbcm5719-llvm-4624a1e8ac8a3f69cc887403b976f538f587744a.tar.gz
bcm5719-llvm-4624a1e8ac8a3f69cc887403b976f538f587744a.zip
[mlir] Create a gpu.module operation for the GPU Dialect.
Summary: This is based on the use of code constantly checking for an attribute on a model and instead represents the distinct operaion with a different op. Instead, this op can be used to provide better filtering. Reviewers: herhut, mravishankar, antiagainst, rriddle Reviewed By: herhut, antiagainst, rriddle Subscribers: liufengdb, aartbik, jholewinski, mgorny, mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, nicolasvasilache, csigg, arpith-jacob, mgester, lucyrfox, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D72336
Diffstat (limited to 'mlir/test/Dialect/GPU')
-rw-r--r--mlir/test/Dialect/GPU/invalid.mlir11
-rw-r--r--mlir/test/Dialect/GPU/ops.mlir2
-rw-r--r--mlir/test/Dialect/GPU/outlining.mlir2
3 files changed, 7 insertions, 8 deletions
diff --git a/mlir/test/Dialect/GPU/invalid.mlir b/mlir/test/Dialect/GPU/invalid.mlir
index 8323fdf8709..8f900bf6b5c 100644
--- a/mlir/test/Dialect/GPU/invalid.mlir
+++ b/mlir/test/Dialect/GPU/invalid.mlir
@@ -167,7 +167,7 @@ module attributes {gpu.container_module} {
}
func @launch_func_missing_module_attribute(%sz : index) {
- // expected-error@+1 {{module 'kernels' is missing the 'gpu.kernel_module' attribute}}
+ // expected-error@+1 {{kernel module 'kernels' is undefined}}
"gpu.launch_func"(%sz, %sz, %sz, %sz, %sz, %sz)
{ kernel = "kernel_1", kernel_module = @kernels }
: (index, index, index, index, index, index) -> ()
@@ -178,8 +178,7 @@ module attributes {gpu.container_module} {
// -----
module attributes {gpu.container_module} {
- module @kernels attributes {gpu.kernel_module} {
- }
+ gpu.module @kernels { }
func @launch_func_undefined_function(%sz : index) {
// expected-error@+1 {{kernel function 'kernel_1' is undefined}}
@@ -193,7 +192,7 @@ module attributes {gpu.container_module} {
// -----
module attributes {gpu.container_module} {
- module @kernels attributes {gpu.kernel_module} {
+ gpu.module @kernels {
gpu.func @kernel_1(%arg1 : !llvm<"float*">) kernel {
gpu.return
}
@@ -211,7 +210,7 @@ module attributes {gpu.container_module} {
// -----
module attributes {gpu.container_module} {
- module @kernels attributes {gpu.kernel_module} {
+ gpu.module @kernels {
gpu.func @kernel_1(%arg1 : !llvm<"float*">) attributes { gpu.kernel } {
gpu.return
}
@@ -229,7 +228,7 @@ module attributes {gpu.container_module} {
// -----
-module @kernels attributes {gpu.kernel_module} {
+gpu.module @kernels {
gpu.func @kernel_1(%arg1 : !llvm<"float*">) attributes { gpu.kernel } {
gpu.return
}
diff --git a/mlir/test/Dialect/GPU/ops.mlir b/mlir/test/Dialect/GPU/ops.mlir
index 1dd08cea492..033e7cbcb7e 100644
--- a/mlir/test/Dialect/GPU/ops.mlir
+++ b/mlir/test/Dialect/GPU/ops.mlir
@@ -60,7 +60,7 @@ module attributes {gpu.container_module} {
return
}
- module @kernels attributes {gpu.kernel_module} {
+ gpu.module @kernels {
gpu.func @kernel_1(%arg0 : f32, %arg1 : memref<?xf32, 1>) attributes {gpu.kernel} {
%tIdX = "gpu.thread_id"() {dimension = "x"} : () -> (index)
%tIdY = "gpu.thread_id"() {dimension = "y"} : () -> (index)
diff --git a/mlir/test/Dialect/GPU/outlining.mlir b/mlir/test/Dialect/GPU/outlining.mlir
index 5adb881a1dc..425b4b3090c 100644
--- a/mlir/test/Dialect/GPU/outlining.mlir
+++ b/mlir/test/Dialect/GPU/outlining.mlir
@@ -136,7 +136,7 @@ func @recursive_device_function() {
gpu.return
}
-// CHECK: module @function_call_kernel attributes {gpu.kernel_module} {
+// CHECK: gpu.module @function_call_kernel {
// CHECK: gpu.func @function_call_kernel()
// CHECK: call @device_function() : () -> ()
// CHECK: call @device_function() : () -> ()
OpenPOWER on IntegriCloud