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

Work around strange gcc bug #363

Merged
merged 1 commit into from
Aug 22, 2023
Merged
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
11 changes: 7 additions & 4 deletions thrust/testing/transform.cu
Original file line number Diff line number Diff line change
Expand Up @@ -265,10 +265,13 @@ void TestTransformBinarySimple(void)

typename Vector::iterator iter;

Vector input1(3);
Vector input2(3);
Vector output(3);
Vector result(3);
// There is a strange gcc bug here where it belives we would write out of bounds.
// It seems to go away if we add one more element that we leave untouched. Luckily 0 - 0 = 0 so all is fine.
// Note that we still write the element, so it does not hide a functional thrust bug
Vector input1(4);
Vector input2(4);
Vector output(4);
Vector result(4);
input1[0] = 1; input1[1] = -2; input1[2] = 3;
input2[0] = -4; input2[1] = 5; input2[2] = 6;
result[0] = 5; result[1] = -7; result[2] = -3;
Expand Down
Loading