Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -287,12 +287,14 @@ static LDSLayoutConfigDim getLDSLayoutConfigDim(Type elementType, int64_t kpack,
LDSLayoutConfigDim cfg;
int64_t maxVlen = 128 / elementType.getIntOrFloatBitWidth();
int64_t copyDPerThread = vecDimInfo.inDPerThread;
int64_t copyKPerThread = vecDimInfo.inKPerThread;
bool isKContiguousDim = vecDimInfo.vectorDim == GemmDimension::K;
// If kpack is less than the hardware max vector length, and we are
// writing more contiguous kpack elements, there is a possibility to
// vectorize that we want to preserve (i.e., we favour vectorization over
// bank conflicts resolution)
bool isPossibleToVectorizeD = (kpack < maxVlen && copyDPerThread > 1);
bool isPossibleToVectorizeD =
(kpack < maxVlen && copyDPerThread > 1) && (copyKPerThread >= kpack);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add a comment to explain this?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: no need to have two parentheses.

cfg.doRotateWithK = isKContiguousDim && !isPossibleToVectorizeD;
cfg.doSwapThreadIterSubDims = !isKContiguousDim && !isPossibleToVectorizeD;
cfg.ldsLayoutDxK = false;
Expand Down