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

[REVIEW] Check alignment before binaryOp dispatch #102

Merged
merged 1 commit into from
Nov 24, 2020

Conversation

tfeher
Copy link
Contributor

@tfeher tfeher commented Nov 22, 2020

This PR adds pointer alignment check for the binaryOp. Without this, the added unit test would trigger cudaErrorMisalignedAddress.

The alignment check is done the same way as for the unaryOp:

uint64_t inAddr = uint64_t(in);
uint64_t outAddr = uint64_t(out);
if (16 / maxSize && bytes % 16 == 0 && inAddr % 16 == 0 &&
outAddr % 16 == 0) {
unaryOpImpl<InType, 16 / maxSize, Lambda, OutType, IdxType, TPB>(
out, in, len, op, stream);
} else if (8 / maxSize && bytes % 8 == 0 && inAddr % 8 == 0 &&
outAddr % 8 == 0) {
unaryOpImpl<InType, 8 / maxSize, Lambda, OutType, IdxType, TPB>(
out, in, len, op, stream);
} else if (4 / maxSize && bytes % 4 == 0 && inAddr % 4 == 0 &&
outAddr % 4 == 0) {
unaryOpImpl<InType, 4 / maxSize, Lambda, OutType, IdxType, TPB>(
out, in, len, op, stream);
} else if (2 / maxSize && bytes % 2 == 0 && inAddr % 2 == 0 &&
outAddr % 2 == 0) {

@GPUtester
Copy link
Contributor

Please update the changelog in order to start CI tests.

View the gpuCI docs here.

Copy link
Member

@teju85 teju85 left a comment

Choose a reason for hiding this comment

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

Changes LGTM. (Thanks for adding an explicit mis-alignment unit-test!)

@tfeher
Copy link
Contributor Author

tfeher commented Nov 23, 2020

rerun tests

@dantegd dantegd merged commit b7c989a into rapidsai:branch-0.17 Nov 24, 2020
@tfeher tfeher deleted the bug-binary-op-alignment branch May 1, 2023 16:10
dantegd pushed a commit to dantegd/raft that referenced this pull request Jul 23, 2024
Part of rapidsai/build-planning#26, warnings in Python tests will now be treated as errors

Authors:
  - Matthew Roeschke (https://github.com/mroeschke)

Approvers:
  - Dante Gama Dessavre (https://github.com/dantegd)

URL: rapidsai/cuvs#102
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.

4 participants