Add extra info to error message in transfer_read operation with element and thread count info (#17695)
Added values of "number of elements" and "workgroup size" to `Anchoring
on transfer_read with unsupported number of elements (not divisible by
workgroup size)`
---------
Signed-off-by: Amily Wu <amilywu2@amd.com>
diff --git a/compiler/src/iree/compiler/Codegen/LLVMGPU/LLVMGPUVectorDistribute.cpp b/compiler/src/iree/compiler/Codegen/LLVMGPU/LLVMGPUVectorDistribute.cpp
index dab08c6..d37d624 100644
--- a/compiler/src/iree/compiler/Codegen/LLVMGPU/LLVMGPUVectorDistribute.cpp
+++ b/compiler/src/iree/compiler/Codegen/LLVMGPU/LLVMGPUVectorDistribute.cpp
@@ -225,9 +225,11 @@
ShapedType::getNumElements(transfer.getVectorType().getShape());
int64_t flatNumThreads = ShapedType::getNumElements(workgroupSize);
if (flatNumElements % flatNumThreads != 0) {
- transfer->emitOpError(
- "Anchoring on transfer_read with unsupported number of elements (not "
- "divisible by workgroup size)");
+ transfer->emitOpError()
+ << "Anchoring on transfer_read with unsupported number of elements "
+ "(not divisible by workgroup size)"
+ << ", number of elements: " << flatNumElements
+ << ", workgroup size: " << flatNumThreads;
return failure();
}
numElementsPerThread =