Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support get ith element location in a region for mixed data types. #72

Merged
merged 1 commit into from
Jul 31, 2024

Conversation

deyuan
Copy link
Collaborator

@deyuan deyuan commented Jul 28, 2024

2nd batch of code for supporting mixed data types and element padding:

  • Support querying ith element location directly from a region instead of in pimCmd
  • Fixed a bug in pimRotateElementsLeft. No impact on benchmarks since it is not used.

No impact on existing behavior. Can be merged before other PRs.
Related to Issue #16.

Comment on lines +503 to +504
auto locSrc = srcRegion.locateIthElemInRegion(j);
auto locDest = destRegion.locateIthElemInRegion(j);
Copy link
Collaborator

Choose a reason for hiding this comment

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

how are you deciding if it's vertical or horizontal? as it seems like previously we were passing it on a parameter.

Copy link
Collaborator Author

@deyuan deyuan Jul 29, 2024

Choose a reason for hiding this comment

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

The key is numColsPerElement. For vertical layout it's 1. Each region knows if it's V or H layout.

Comment on lines +51 to +53
assert(i < getNumElemInRegion());
unsigned rowIdx = m_rowIdx; // only one row of elements per region
unsigned colIdx = m_colIdx + i * m_numColsPerElem;
Copy link
Collaborator

Choose a reason for hiding this comment

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

for vertical layout isn't it multiple rows?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Each region contains one row of elements, no matter if it's V or H layout. You can think each element takes a rectangle area of bits, and here we need to get the location of upper left corner.

@fasiddique fasiddique merged commit c22ed9a into main Jul 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants