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

normalize Vector with size 1 #97

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

kwitaechong
Copy link
Collaborator

No description provided.

@kwitaechong
Copy link
Collaborator Author

Do we need to checkout when its size norm2= 0 for this and other normalize?

Copy link
Collaborator

@streeve streeve left a comment

Choose a reason for hiding this comment

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

Need to add to the tests. Could handle divide by zero in a separate PR or here

src/Picasso_BatchedLinearAlgebra.hpp Outdated Show resolved Hide resolved
Copy link
Collaborator

@streeve streeve left a comment

Choose a reason for hiding this comment

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

Can you add a check in the unit test?

LinearAlgebra::Vector<double, 1> vec1 = { 4.7 };
vec1.normalize();
EXPECT_DOUBLE_EQ( vec1, 1.0 );

// Size 1 vector test.
// FIXME: construction of length 1 vector fails with NVCC.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does this test pass? We commented this out below because of issues with cuda

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, it passed on V100

Copy link
Collaborator

Choose a reason for hiding this comment

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

Does the commented code below pass?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh maybe it's trying to construct from a scalar that fails

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, commented code also get passed on V100

@streeve
Copy link
Collaborator

streeve commented Oct 26, 2023

retest this please.

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.

None yet

2 participants