File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed
Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -720,10 +720,16 @@ LogicalResult MakeDmaDescriptorOp::verify() {
720720 }
721721
722722 ArrayRef<int64_t > globalStaticSizes = getGlobalStaticSizes ();
723- if (globalStaticSizes.size () != globalStaticStrides.size ()) {
723+ size_t rank = globalStaticSizes.size ();
724+ if (rank != globalStaticStrides.size ()) {
724725 return emitOpError (" strides and sizes must have same rank." );
725726 }
726727
728+ ArrayRef<int64_t > sharedStaticSizes = getSharedStaticSizes ();
729+ if (rank != sharedStaticSizes.size ()) {
730+ return emitOpError (" tensor must have same rank as tile." );
731+ }
732+
727733 return success ();
728734}
729735
Original file line number Diff line number Diff line change @@ -385,3 +385,12 @@ func.func @make_dma_descriptor_invalid_size_and_stride_sizes(%base: !amdgpu.tdm_
385385 func.return
386386}
387387
388+ // -----
389+
390+ // CHECK-LABEL: func @make_dma_descriptor_invalid_shared_and_global_rank
391+ // CHECK-SAME: (%[[BASE:.+]]: !amdgpu.tdm_base<i32>)
392+ func.func @make_dma_descriptor_invalid_shared_and_global_rank (%base: !amdgpu.tdm_base <i32 >) {
393+ // expected-error@+1 {{'amdgpu.make_dma_descriptor' op tensor must have same rank as tile.}}
394+ amdgpu.make_dma_descriptor %base globalSize [4 , 4 ] globalStride [1 , 1 ] sharedSize [2 ] : !amdgpu.tdm_base <i32 > -> !amdgpu.tdm_descriptor
395+ func.return
396+ }
You can’t perform that action at this time.
0 commit comments