Skip to content

Commit 492c11b

Browse files
arnamoy10pszymich
authored andcommitted
Fix element type for fixed vector.
The code before had an assumption that the vector (representing the slice) will have integer type, regardless the type of the joint_matrix. This is not true for types e.g half, bf16. The fix takes care of the issue.
1 parent cc3d89a commit 492c11b

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

IGC/Compiler/Optimizer/OpenCLPasses/JointMatrixFuncsResolutionPass.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -450,10 +450,7 @@ static int getSliceSize(const JointMatrixTypeDescription *desc, Type *matTy) {
450450
IGCLLVM::FixedVectorType *ty = dyn_cast<IGCLLVM::FixedVectorType>(matTy);
451451
IGC_ASSERT_MESSAGE(ty, "Expecting vector type in calculating slice size");
452452

453-
IntegerType *vecElemType = dyn_cast<IntegerType>(ty->getElementType());
454-
IGC_ASSERT_MESSAGE(vecElemType, "Expecting integer type for vector element.");
455-
456-
unsigned contribTypeWidth = vecElemType->getBitWidth();
453+
unsigned contribTypeWidth = ty->getElementType()->getScalarSizeInBits();
457454
if (desc->layout == LayoutRowMajor) {
458455
return desc->rows;
459456
}

0 commit comments

Comments
 (0)