Changeset View
Changeset View
Standalone View
Standalone View
mlir/test/Dialect/GPU/ops.mlir
Show First 20 Lines • Show All 57 Lines • ▼ Show 20 Lines | gpu.func @kernel_1(%arg0 : f32, %arg1 : memref<?xf32, 1>) kernel { | ||||
"gpu.barrier"() : () -> () | "gpu.barrier"() : () -> () | ||||
"some_op"(%bIdX, %tIdX) : (index, index) -> () | "some_op"(%bIdX, %tIdX) : (index, index) -> () | ||||
%42 = load %arg1[%bIdX] : memref<?xf32, 1> | %42 = load %arg1[%bIdX] : memref<?xf32, 1> | ||||
gpu.return | gpu.return | ||||
} | } | ||||
gpu.func @kernel_2(%arg0: f32, %arg1: memref<?xf32, 1>) kernel { | gpu.func @kernel_2() kernel { | ||||
gpu.return | gpu.return | ||||
} | } | ||||
} | } | ||||
func @foo() { | func @foo() { | ||||
%0 = "op"() : () -> (f32) | %0 = "op"() : () -> (f32) | ||||
%1 = "op"() : () -> (memref<?xf32, 1>) | %1 = "op"() : () -> (memref<?xf32, 1>) | ||||
// CHECK: %{{.*}} = constant 8 | // CHECK: %{{.*}} = constant 8 | ||||
%cst = constant 8 : index | %cst = constant 8 : index | ||||
// CHECK: "gpu.launch_func"(%{{.*}}, %{{.*}}, %{{.*}}, %{{.*}}, %{{.*}}, %{{.*}}, %{{.*}}, %{{.*}}) {kernel = @kernels::@kernel_1} : (index, index, index, index, index, index, f32, memref<?xf32, 1>) -> () | // CHECK: gpu.launch_func @kernels::@kernel_1 blocks in (%{{.*}}, %{{.*}}, %{{.*}}) threads in (%{{.*}}, %{{.*}}, %{{.*}}) args(%{{.*}} : f32, %{{.*}} : memref<?xf32, 1>) | ||||
"gpu.launch_func"(%cst, %cst, %cst, %cst, %cst, %cst, %0, %1) | gpu.launch_func @kernels::@kernel_1 blocks in (%cst, %cst, %cst) threads in (%cst, %cst, %cst) args(%0 : f32, %1 : memref<?xf32, 1>) | ||||
{ kernel = @kernels::@kernel_1} | |||||
: (index, index, index, index, index, index, f32, memref<?xf32, 1>) -> () | // CHECK: gpu.launch_func @kernels::@kernel_2 blocks in (%{{.*}}, %{{.*}}, %{{.*}}) threads in (%{{.*}}, %{{.*}}, %{{.*}}) | ||||
gpu.launch_func @kernels::@kernel_2 blocks in (%cst, %cst, %cst) threads in (%cst, %cst, %cst) | |||||
// CHECK: "gpu.launch_func"(%{{.*}}, %{{.*}}, %{{.*}}, %{{.*}}, %{{.*}}, %{{.*}}, %{{.*}}, %{{.*}}) {kernel = @kernels::@kernel_2} : (index, index, index, index, index, index, f32, memref<?xf32, 1>) -> () | |||||
"gpu.launch_func"(%cst, %cst, %cst, %cst, %cst, %cst, %0, %1) | |||||
{ kernel = @kernels::@kernel_2} | |||||
: (index, index, index, index, index, index, f32, memref<?xf32, 1>) -> () | |||||
return | return | ||||
} | } | ||||
gpu.module @gpu_funcs { | gpu.module @gpu_funcs { | ||||
// CHECK-LABEL: gpu.func @kernel_1({{.*}}: f32) | // CHECK-LABEL: gpu.func @kernel_1({{.*}}: f32) | ||||
// CHECK: workgroup | // CHECK: workgroup | ||||
// CHECK: private | // CHECK: private | ||||
▲ Show 20 Lines • Show All 76 Lines • Show Last 20 Lines |