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 compiling for CUDA with 2024.1 compiler #1630

Merged
merged 2 commits into from
Apr 3, 2024

Conversation

ndgrigorian
Copy link
Collaborator

Using the 2024.1 compiler and building with DPCTL_TARGET_CUDA=1 fails due to unrecognized symbols in elementwise functions like fabs, fabsf, copysign, and floor from the C++ std namespace.

This PR proposes replacing the non-working symbols with their Sycl namespace equivalents.

  • Have you provided a meaningful PR description?
  • Have you added a test, reproducer or referred to an issue with a reproducer?
  • Have you tested your changes locally for CPU and GPU devices?
  • Have you made sure that new changes do not introduce compiler warnings?
  • Have you checked performance impact of proposed changes?
  • If this PR is a work in progress, are you opening the PR as a draft?

…floor` with `sycl` variants

This is necessitated by issues linking when building for CUDA using 2024.1 compiler
@ndgrigorian
Copy link
Collaborator Author

@oleksandr-pavlyk
This PR may also be a good opportunity to test removing the work-around implemented in proj.hpp for the previous compiler.

Copy link

github-actions bot commented Apr 2, 2024

Deleted rendered PR docs from intelpython.github.com/dpctl, latest should be updated shortly. 🤞

@coveralls
Copy link
Collaborator

coveralls commented Apr 2, 2024

Coverage Status

coverage: 87.974%. remained the same
when pulling fc4a612 on fix-cuda-linking-2024-1
into 03c7615 on master.

Copy link

github-actions bot commented Apr 2, 2024

Array API standard conformance tests for dpctl=0.17.0dev0=py310h15de555_162 ran successfully.
Passed: 839
Failed: 0
Skipped: 92

The issue that was being work arround has been fixed in 2024.1
compiler
@oleksandr-pavlyk
Copy link
Collaborator

I have pushed a commit to remove the work-around. Local tests passed.

Copy link

github-actions bot commented Apr 2, 2024

Array API standard conformance tests for dpctl=0.17.0dev0=py310h15de555_163 ran successfully.
Passed: 839
Failed: 0
Skipped: 92

@oleksandr-pavlyk oleksandr-pavlyk marked this pull request as ready for review April 3, 2024 00:52
#ifdef USE_SYCL_FOR_COMPLEX_TYPES
return exprm_ns::abs(exprm_ns::complex<realT>(z));
#else
return std::hypot(std::real(z), std::imag(z));
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
return std::hypot(std::real(z), std::imag(z));
return std::hypot(x, y);

@oleksandr-pavlyk oleksandr-pavlyk merged commit 6abcd34 into master Apr 3, 2024
50 checks passed
@oleksandr-pavlyk oleksandr-pavlyk deleted the fix-cuda-linking-2024-1 branch April 3, 2024 14:39
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.

3 participants