Lines Matching refs:gpu
5 "gpu.launch"(%sz, %sz, %sz, %sz, %sz) ({
6 gpu.return
15 "gpu.launch"(%sz, %sz, %sz, %sz, %sz, %sz) ({
18 gpu.terminator
26 // @expected-note@+1 {{in 'gpu.launch' body region}}
27 gpu.launch blocks(%bx, %by, %bz) in (%sbx = %sz, %sby = %sz, %sbz = %sz)
29 // @expected-error@+2 {{expected 'gpu.terminator' or a terminator with successors}}
31 "gpu.yield"(%one) : (i32) -> ()
40 "gpu.launch_func"(%sz, %sz, %sz, %sz, %sz)
49 // expected-error@+1 {{expected the closest surrounding module to have the 'gpu.container_module' attribute}}
50 gpu.launch_func @foo::@bar blocks in (%sz, %sz, %sz) threads in (%sz, %sz, %sz)
56 module attributes {gpu.container_module} {
58 // expected-error@+1 {{'gpu.launch_func' op requires attribute 'kernel'}}
59 "gpu.launch_func"(%sz, %sz, %sz, %sz, %sz, %sz)
68 module attributes {gpu.container_module} {
70 // expected-error@+1 {{custom op 'gpu.launch_func' invalid kind of attribute specified}}
71 gpu.launch_func "foo" blocks in (%sz, %sz, %sz) threads in (%sz, %sz, %sz)
78 module attributes {gpu.container_module} {
81 gpu.launch_func @kernels::@kernel_1 blocks in (%sz, %sz, %sz) threads in (%sz, %sz, %sz)
88 module attributes {gpu.container_module} {
90 // expected-error@+1 {{'gpu.func' op expects parent op 'gpu.module'}}
91 gpu.func @kernel_1(%arg1 : !llvm.ptr) {
92 gpu.return
99 module attributes {gpu.container_module} {
105 gpu.launch_func @kernels::@kernel_1 blocks in (%sz, %sz, %sz) threads in (%sz, %sz, %sz)
112 module attributes {gpu.container_module} {
113 gpu.module @kernels { }
117 gpu.launch_func @kernels::@kernel_1 blocks in (%sz, %sz, %sz) threads in (%sz, %sz, %sz)
124 module attributes {gpu.container_module} {
125 gpu.module @kernels {
132 gpu.launch_func @kernels::@kernel_1 blocks in (%sz, %sz, %sz) threads in (%sz, %sz, %sz)
139 module attributes {gpu.container_module} {
141 gpu.func @kernel_1(%arg1 : !llvm.ptr) kernel {
142 gpu.return
148 gpu.launch_func @kernels::@kernel_1 blocks in (%sz, %sz, %sz) threads in (%sz, %sz, %sz) args(%arg : !llvm.ptr)
155 module attributes {gpu.container_module} {
156 gpu.module @kernels {
157 gpu.func @kernel_1(%arg1 : !llvm.ptr) {
158 gpu.return
163 // expected-error@+1 {{kernel function is missing the 'gpu.kernel' attribute}}
164 gpu.launch_func @kernels::@kernel_1 blocks in (%sz, %sz, %sz) threads in (%sz, %sz, %sz) args(%arg : !llvm.ptr)
171 module attributes {gpu.container_module} {
172 gpu.module @kernels {
173 gpu.func @kernel_1(%arg1 : !llvm.ptr) kernel {
174 gpu.return
180 gpu.launch_func @kernels::@kernel_1 blocks in (%sz, %sz, %sz) threads in (%sz, %sz, %sz) args(%arg : !llvm.ptr, %arg : !llvm.ptr)
187 module attributes {gpu.container_module} {
188 gpu.module @kernels {
189 gpu.func @kernel_1(%arg1 : f32) kernel {
190 gpu.return
196 gpu.launch_func @kernels::@kernel_1 blocks in (%sz, %sz, %sz) threads in (%sz, %sz, %sz) args(%arg : f32)
203 module attributes {gpu.container_module} {
206 gpu.launch_func @foo::@bar blocks in (%sz, %sz, %sz) threads in (%sz, %sz, %sz) args(%sz : index {foo})
214 // expected-error@+1 {{'gpu.all_reduce' op operand #0 must be Integer or Float}}
215 %res = gpu.all_reduce add %arg0 {} : (vector<4xf32>) -> vector<4xf32>
223 %res = "gpu.all_reduce"(%arg0) ({}) : (f32) -> (f32)
231 %res = "gpu.all_reduce"(%arg0) ({
233 "gpu.yield"(%lhs) : (f32) -> ()
234 }) {op = #gpu<all_reduce_op add>} : (f32) -> (f32)
242 %res = gpu.all_reduce foo %arg0 {} : (f32) -> (f32)
250 %res = gpu.all_reduce minsi %arg0 {} : (f32) -> (f32)
258 %res = gpu.all_reduce minui %arg0 {} : (f32) -> (f32)
266 %res = gpu.all_reduce maxsi %arg0 {} : (f32) -> (f32)
274 %res = gpu.all_reduce maxui %arg0 {} : (f32) -> (f32)
282 %res = gpu.all_reduce and %arg0 {} : (f32) -> (f32)
290 %res = gpu.all_reduce or %arg0 {} : (f32) -> (f32)
298 %res = gpu.all_reduce xor %arg0 {} : (f32) -> (f32)
306 %res = gpu.all_reduce minnumf %arg0 {} : (i32) -> (i32)
314 %res = gpu.all_reduce maxnumf %arg0 {} : (i32) -> (i32)
322 %res = gpu.all_reduce minimumf %arg0 {} : (i32) -> (i32)
330 %res = gpu.all_reduce maximumf %arg0 {} : (i32) -> (i32)
338 %res = gpu.subgroup_reduce add %arg0 cluster(size = 0) : (vector<4xf32>) -> vector<4xf32>
346 %res = gpu.subgroup_reduce add %arg0 cluster(size = 3) : (vector<4xf32>) -> vector<4xf32>
354 %res = gpu.subgroup_reduce add %arg0 cluster(size = 4, stride = 0) : (vector<4xf32>) -> vector<4xf32>
362 %res = gpu.subgroup_reduce add %arg0 { cluster_stride = 2 : i32 } : (vector<4xf32>) -> vector<4xf32>
370 // expected-error@+1 {{'gpu.subgroup_reduce' op operand #0 must be Integer or Float or vector of}}
371 %res = gpu.subgroup_reduce add %arg0 : (vector<2x2xf32>) -> vector<2x2xf32>
379 %res = gpu.subgroup_reduce add %arg0 : (vector<[2]xf32>) -> vector<[2]xf32>
387 %res = gpu.subgroup_reduce and %arg0 : (f32) -> (f32)
395 %res = gpu.subgroup_reduce maxnumf %arg0 : (i32) -> (i32)
403 %res = gpu.all_reduce %arg0 {
405 "gpu.yield"(%lhs) : (f32) -> ()
414 %res = gpu.all_reduce %arg0 {
416 "gpu.yield"(%lhs) : (f32) -> ()
424 // expected-error@+1 {{expected one gpu.yield operand}}
425 %res = gpu.all_reduce %arg0 {
427 "gpu.yield"(%lhs, %rhs) : (f32, f32) -> ()
435 // expected-error@+1 {{incorrect gpu.yield type}}
436 %res = gpu.all_reduce %arg0 {
439 "gpu.yield"(%one) : (i32) -> ()
447 // expected-error@+1 {{expected gpu.yield op in region}}
448 %res = gpu.all_reduce %arg0 {
459 %shfl, %pred = "gpu.shuffle"(%arg0, %arg1, %arg2) { mode = #gpu<shuffle_mode xor> } : (f32, i32, i32) -> (i32, i1)
467 %shfl, %pred = gpu.shuffle xor %arg0, %arg1, %arg2 : index
474 gpu.module @gpu_funcs {
475 // expected-error @+1 {{custom op 'gpu.func' gpu.func requires named arguments}}
476 gpu.func @kernel_1(f32, f32) {
478 gpu.return
486 gpu.module @gpu_funcs {
488 "gpu.func"() ({
489 gpu.return
497 gpu.module @gpu_funcs {
498 // expected-error @below {{'gpu.func' op expected memref type in attribution}}
499 gpu.func @kernel() workgroup(%0: i32) {
500 gpu.return
508 gpu.module @gpu_funcs {
509 // expected-error @below {{'gpu.func' op expected memory space workgroup in attribution}}
510 gpu.func @kernel() workgroup(%0: memref<4xf32, #gpu.address_space<private>>) {
511 gpu.return
519 gpu.module @gpu_funcs {
520 // expected-error @below {{'gpu.func' op expected memory space private in attribution}}
521 gpu.func @kernel() private(%0: memref<4xf32, #gpu.address_space<workgroup>>) {
522 gpu.return
530 gpu.module @gpu_funcs {
532 gpu.func @kernel() {
534 // expected-error @+1 {{'gpu.return' op expected 0 result operands}}
535 gpu.return %0 : index
543 gpu.module @gpu_funcs {
544 // expected-error @+1 {{'gpu.func' op expected void return type for kernel function}}
545 gpu.func @kernel() -> index kernel {
547 gpu.return
555 gpu.module @gpu_funcs {
556 // expected-error @+1 {{'gpu.func' op expected at least 5 arguments to body region}}
557 "gpu.func"() ({
559 "gpu.return"() : () -> ()
560 } ) {function_type = (f32, memref<?xf32>) -> (), gpu.kernel, sym_name = "kernel_1", workgroup_attributions = 3: i64} : () -> ()
567 gpu.module @gpu_funcs {
569 "gpu.func"() ({}) {function_type = () -> (), gpu.kernel, sym_name = "kernel"} : () -> ()
577 %t = gpu.wait
583 // expected-error @+1 {{custom op 'gpu.wait' needs to be named when marked 'async'}}
584 gpu.wait async
590 // expected-error @+1 {{'gpu.memcpy' op arguments have incompatible element type}}
591 gpu.memcpy %dst, %src : memref<?xf32>, memref<?xi32>
597 // expected-error @+1 {{'gpu.memcpy' op arguments have incompatible shape}}
598 gpu.memcpy %dst, %src : memref<7xf32>, memref<9xf32>
604 // expected-error @+1 {{'gpu.memset' op failed to verify that all of {dst, value} have same element type}}
605 gpu.memset %dst, %value : memref<?xf32>, i32
614 %0 = gpu.subgroup_mma_load_matrix %wg[%i, %i] {leadDimension = 32 : index} : memref<32x32xf16, 3> -> !gpu.mma_matrix<16x16x16xf16, "AOp">
624 %0 = gpu.subgroup_mma_load_matrix %wg[%i, %i] {leadDimension = 32 : index} : memref<32x32xf16, 3> -> !gpu.mma_matrix<16x16xf16, "EOp">
634 %0 = gpu.subgroup_mma_load_matrix %wg[%i, %i] {leadDimension = 32 : index} : memref<32x32xf16, 3> -> !gpu.mma_matrix<16x16xbf16, "AOp">
646 %0 = gpu.subgroup_mma_load_matrix %wg[%i, %i] {leadDimension = 32 : index} : memref<32x32xf16, #layout_map_col_major, 3> -> !gpu.mma_matrix<16x16xf16, "AOp">
654 %0 = gpu.subgroup_mma_load_matrix %src[%i, %i] {leadDimension = 4 : index} : memref<32x4xvector<4x8xf32>> -> !gpu.mma_matrix<16x16xf16, "AOp">
662 func.func @wmmaStoreOp_invalid_map(%arg0 : !gpu.mma_matrix<16x16xf16, "COp">) -> () {
667 gpu.subgroup_mma_store_matrix %arg0, %sg[%i,%j] {leadDimension= 32 : index} : !gpu.mma_matrix<16x16xf16, "COp">, memref<32x32xf16,#layout_map_col_major, 3>
673 func.func @wmmaStoreOp_invalid_store_operand(%arg0 : !gpu.mma_matrix<16x16xf16, "AOp">) -> () {
678 gpu.subgroup_mma_store_matrix %arg0, %sg[%i,%j] {leadDimension= 32 : index} : !gpu.mma_matrix<16x16xf16, "AOp">, memref<32x32xf16, 3>
684 func.func @wmmaMmaOp_invalid_operand_order(%A : !gpu.mma_matrix<16x16xf16, "AOp">, %B : !gpu.mma_matrix<16x16xf16, "BOp">, %C : !gpu.mma_matrix<16x16xf16, "COp">) -> () {
686 %D = gpu.subgroup_mma_compute %B, %A, %C : !gpu.mma_matrix<16x16xf16, "BOp">, !gpu.mma_matrix<16x16xf16, "AOp"> -> !gpu.mma_matrix<16x16xf16, "COp">
692 func.func @wmmaMmaOp_invalid_operand_shapes(%A : !gpu.mma_matrix<16x32xf16, "AOp">, %B : !gpu.mma_matrix<16x16xf16, "BOp">, %C : !gpu.mma_matrix<16x16xf16, "COp">) -> () {
694 %D = gpu.subgroup_mma_compute %A, %B, %C : !gpu.mma_matrix<16x32xf16, "AOp">, !gpu.mma_matrix<16x16xf16, "BOp"> -> !gpu.mma_matrix<16x16xf16, "COp">
703 %1 = gpu.alloc() : memref<2x4xf32, affine_map<(d0, d1)[s0] -> ((d0 + s0), d1)>, 1>
713 %1 = gpu.alloc()[%0] : memref<2x4xf32, 1>
723 %1 = gpu.alloc(%0, %0) : memref<2x?xf32, 1>
733 %1 = gpu.alloc(%0) : memref<2x?x?xf32, 1>
739 module attributes {gpu.container_module} {
740 // expected-error@+1 {{'func.func' op gpu.known_block_size must be a dense i32 array}}
741 func.func @kernel() attributes {gpu.known_block_size = 32 : i32} {
748 module attributes {gpu.container_module} {
749 gpu.module @kernel {
750 // expected-error@+1 {{'gpu.func' op attribute 'known_block_size' failed to satisfy constraint: i32 dense array attribute with 3 elements (if present)}}
751 gpu.func @kernel() kernel attributes {known_block_size = array<i32: 2, 1>} {
752 gpu.return
760 // expected-error@+1 {{'func.func' op gpu.known_block_size must contain exactly 3 elements}}
761 func.func @kernel() attributes {gpu.known_block_size = array<i32: 2, 1>} {
769 // expected-error @+1 {{'gpu.module' op attribute 'targets' failed to satisfy constraint: array of GPU target attributes with at least 1 elements}}
770 gpu.module @gpu_funcs [] {
777 // expected-error @+1 {{'gpu.module' op attribute 'targets' failed to satisfy constraint: array of GPU target attributes with at least 1 elements}}
778 gpu.module @gpu_funcs [1] {
785 // expected-error @+1 {{'gpu.binary' op attribute 'objects' failed to satisfy constraint: an array of GPU object attributes with at least 1 elements}}
786 gpu.binary @binary []
792 // expected-error @+1 {{'gpu.binary' op attribute 'offloadingHandler' failed to satisfy constraint: any attribute with the `OffloadingTranslationAttrTrait` trait.}}
793 gpu.binary @binary <1> [#gpu.object<#nvvm.target, "">]
801 gpu.launch blocks(%bx, %by, %bz) in (%sbx = %c1, %sby = %c1, %sbz = %c1)
805 // expected-error @below {{'gpu.dynamic_shared_memory' op address space must be address_space<workgroup>}}
806 %0 = gpu.dynamic_shared_memory : memref<?xi8>
807 gpu.terminator
818 gpu.launch blocks(%bx, %by, %bz) in (%sbx = %c1, %sby = %c1, %sbz = %c1)
822 // expected-error @below {{'gpu.dynamic_shared_memory' op result memref type must be memref<?xi8, #gpu.address_space<workgroup>>}}
823 %0 = gpu.dynamic_shared_memory : memref<1xi8, #gpu.address_space<workgroup>>
824 gpu.terminator
834 gpu.launch blocks(%bx, %by, %bz) in (%sbx = %c1, %sby = %c1, %sbz = %c1)
838 // expected-error @below {{'gpu.dynamic_shared_memory' op address space must be address_space<workgroup>}}
839 %0 = gpu.dynamic_shared_memory : memref<?xi8, #gpu.address_space<private>>
840 gpu.terminator
850 gpu.launch blocks(%bx, %by, %bz) in (%sbx = %c1, %sby = %c1, %sbz = %c1)
854 // expected-error @below {{'gpu.dynamic_shared_memory' op result #0 must be 1D memref of 8-bit signless integer values, but got 'memref<?xf32, #gpu.address_space<workgroup>}}
855 %0 = gpu.dynamic_shared_memory : memref<?xf32, #gpu.address_space<workgroup>>
856 gpu.terminator
863 module attributes {gpu.container_module} {
865 gpu.module @kernel <> {
871 gpu.binary @binary [#gpu.object<#rocdl.target<chip = "gfx900">,
873 kernels = #gpu.kernel_table<[
874 #gpu.kernel_metadata<"kernel", (i32) -> ()>,
875 #gpu.kernel_metadata<"kernel", (i32, f32) -> (), metadata = {sgpr_count = 255}>
884 // expected-error@+1 {{'gpu.warp_execute_on_lane_0' op expected same number of yield operands and return values.}}
885 %2 = gpu.warp_execute_on_lane_0(%laneid)[64] -> (vector<4xi32>) {
893 // expected-error@+1 {{'gpu.warp_execute_on_lane_0' op expected same number op arguments and block arguments.}}
894 gpu.warp_execute_on_lane_0(%laneid)[64] {
903 // expected-error@+1 {{'gpu.warp_execute_on_lane_0' op incompatible distribution dimensions from 'vector<128xi32>' to 'vector<4xi32>'}}
904 %2 = gpu.warp_execute_on_lane_0(%laneid)[64] -> (vector<4xi32>) {
906 gpu.yield %0 : vector<128xi32>
915 // expected-error@+1 {{'gpu.warp_execute_on_lane_0' op incompatible distribution dimensions from 'vector<128xi32>' to 'vector<4xi32>'}}
916 gpu.warp_execute_on_lane_0(%laneid)[64]
927 %2 = gpu.warp_execute_on_lane_0(%laneid)[32] -> (vector<4x4xi32>) {
929 gpu.yield %0 : vector<128x128xi32>
938 %2 = gpu.warp_execute_on_lane_0(%laneid)[32] -> (vector<1x3xi32>) {
940 gpu.yield %0 : vector<4x8xi32>
948 // expected-error@+1 {{'gpu.warp_execute_on_lane_0' op expected distributed vectors to have same rank and element type.}}
949 %2 = gpu.warp_execute_on_lane_0(%laneid)[32] -> (vector<4x4xi32>) {
951 gpu.yield %0 : vector<128xi32>
959 // expected-error@+1 {{'gpu.warp_execute_on_lane_0' op expected vector type for distributed operands.}}
960 %2 = gpu.warp_execute_on_lane_0(%laneid)[32] -> (i32) {
962 gpu.yield %0 : vector<128xi32>