File tree Expand file tree Collapse file tree 2 files changed +22
-3
lines changed
Expand file tree Collapse file tree 2 files changed +22
-3
lines changed Original file line number Diff line number Diff line change @@ -710,12 +710,20 @@ LogicalResult TransposeLoadOp::verify() {
710710// ===----------------------------------------------------------------------===//
711711
712712LogicalResult MakeDmaDescriptorOp::verify () {
713- if (getGlobalStaticStrides ().empty ()) {
713+ ArrayRef<int64_t > globalStaticStrides = getGlobalStaticStrides ();
714+
715+ if (globalStaticStrides.empty ()) {
714716 return emitOpError (" strides must not be empty." );
715717 }
716- if (getGlobalStaticStrides () .back () != 1 ) {
718+ if (globalStaticStrides .back () != 1 ) {
717719 return emitOpError (" strides for the innermost dimension must be 1." );
718720 }
721+
722+ ArrayRef<int64_t > globalStaticSizes = getGlobalStaticSizes ();
723+ if (globalStaticSizes.size () != globalStaticStrides.size ()) {
724+ return emitOpError (" strides and sizes must have same rank." );
725+ }
726+
719727 return success ();
720728}
721729
Original file line number Diff line number Diff line change @@ -371,6 +371,17 @@ func.func @make_dma_descriptor_invalid_empty_strides(%base: !amdgpu.tdm_base<i32
371371// CHECK-SAME: (%[[BASE:.+]]: !amdgpu.tdm_base<i32>)
372372func.func @make_dma_descriptor_invalid_innermost_stride (%base: !amdgpu.tdm_base <i32 >) {
373373 // expected-error@+1 {{'amdgpu.make_dma_descriptor' op strides for the innermost dimension must be 1.}}
374- amdgpu.make_dma_descriptor %base globalSize [0 ] globalStride [1 , 2 ] sharedSize [0 ] : !amdgpu.tdm_base <i32 > -> !amdgpu.tdm_descriptor
374+ amdgpu.make_dma_descriptor %base globalSize [2 , 2 ] globalStride [1 , 2 ] sharedSize [0 ] : !amdgpu.tdm_base <i32 > -> !amdgpu.tdm_descriptor
375375 func.return
376376}
377+
378+ // -----
379+
380+ // CHECK-LABEL: func @make_dma_descriptor_invalid_size_and_stride_sizes
381+ // CHECK-SAME: (%[[BASE:.+]]: !amdgpu.tdm_base<i32>)
382+ func.func @make_dma_descriptor_invalid_size_and_stride_sizes (%base: !amdgpu.tdm_base <i32 >) {
383+ // expected-error@+1 {{'amdgpu.make_dma_descriptor' op strides and sizes must have same rank.}}
384+ amdgpu.make_dma_descriptor %base globalSize [1 ] globalStride [1 , 1 ] sharedSize [0 ] : !amdgpu.tdm_base <i32 > -> !amdgpu.tdm_descriptor
385+ func.return
386+ }
387+
You can’t perform that action at this time.
0 commit comments