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

Fix calling default constructor to use uniform initialization. #334

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

sukeya
Copy link
Contributor

@sukeya sukeya commented Jul 18, 2023

Hello,

I faced an error that let C be a template parameter, C() is interpreted as a function call when C is a type alias.
So, I replaced all ambiguous expression C() to uniform initialization C{}.
Could you please merge this PR?

@cary-ilm
Copy link
Member

This looks fine, thanks. For completeness, could you add a test somewhere (src/ImathTest/testVec.cpp maybe?) that fails with the current () initializers but succeeds with the change?

@sukeya
Copy link
Contributor Author

sukeya commented Jul 19, 2023

I added a test case which fails with the current () initializers, but it requires CUDA.

@@ -88,6 +89,11 @@ main (int argc, char* argv[])
TEST (testFrustumTest);
TEST (testInterop);
TEST (testNoInterop);

Copy link
Member

Choose a reason for hiding this comment

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

This needs a #ifdef __CUDACC__. That appears to be the reason the CI build fails.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think __CUDACC__ is defined when nvcc compiles device code, so it never be defined in host code.

Copy link
Member

Choose a reason for hiding this comment

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

That's the point, when compiling the code without CUDA, it's currently failing because testVecCUDA isn't defined. Check the errors in the log from the failed CI job: https://github.com/AcademySoftwareFoundation/Imath/actions/runs/5599599937/jobs/10240779807?pr=334#step:6:105
Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I fixed. I'm sorry, but could you please review?

@cary-ilm
Copy link
Member

We discussed this in today's technical steering committee meeting, and we support this contribution in principle and we'd like to work towards accepting it.

We'd like to confirm what versions of CUDA this relies on, and confirm that the #ifdef's properly exclude ones it doesn't.

We'd also like to add a CUDA validation job to the CI.

We are planning a v3.2 release in mid-August, which will be cut from the main branch, so we'd like to wait until after that before merging the PR. That will provide more time for evaluation before official release.

In spite of my earlier advice to add a test, your original submission to switch to uniform initialization is fairly uncontroversial, so if you'd like to submit that as a separate PR, we can accept that right away, while we work through the issues with the addition of the CUDA test.

Again, thanks for your contribution and your patience.

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