Skip to content

[SYCL][CUDA] Enable CXX standard library funcs for CUDA backend #6482

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

Merged
merged 38 commits into from
Sep 2, 2022

Conversation

hdelan
Copy link
Contributor

@hdelan hdelan commented Jul 27, 2022

This PR allows CXX stdlib funcs to be used for NVPTX backend.

See #6379

llvm-test-suite test: intel/llvm-test-suite#1112

It also adds the compiler flag "-fbundle-no-offload-arch", which allows device code bundles to omit arch information, meaning a bundle with the tag sycl-nvptx64-nvidia-cuda-sm_50 can be bundled with the tag sycl-nvptx64-nvidia-cuda when the flag is enabled. This allows for generic bc bundles for a given backend.

I have not moved the NVPTX complex implementation to libdevice. Let me know if I should do so.

The behaviour of IsMathErrnoDefault() now changes so that -fmath-errno is enabled by default for the CUDA toolchain. This allows libdevice funcs to be used by a similar exploit that the SYCL toolchain uses. If necessary this could be reset once the upstream discussion on NVPTX codegen for llvm.sin and other llvm builtins has been resolved and implemented. See https://discourse.llvm.org/t/nvptx-codegen-for-llvm-sin-and-friends/58170/11?u=jdoerfert

cc @Naghasan @AerialMantis @steffenlarsen @bader @jdoerfert

hdelan and others added 2 commits July 27, 2022 14:47
Co-authored-by: smanna12 <soumi.manna@intel.com>
steffenlarsen
steffenlarsen previously approved these changes Aug 11, 2022
@hdelan hdelan requested a review from mdtoguchi August 16, 2022 16:09
@hdelan
Copy link
Contributor Author

hdelan commented Aug 16, 2022

ping @jinge90

@jinge90
Copy link
Contributor

jinge90 commented Aug 17, 2022

ping @jinge90

Hi, @hdelan
The libdevice change looks OK and I have 2 questions:

  1. Could you also include related libdevice functions in this PR, they are used to support std::complex in SYCL device programming.
  2. For assert support, it seems that we finally rely on CUDA runtime to handle "__assertfail", am I correct?

Thanks very much.

@hdelan
Copy link
Contributor Author

hdelan commented Aug 17, 2022

1. Could you also include  related libdevice functions in this PR, they are used to support std::complex in SYCL device programming.

2. For assert support, it seems that we finally rely on CUDA runtime to handle "__assertfail", am I correct?

Thanks for response.

  1. In discussions we have sort of decided that the current approach to std::complex is OK and we don't need to implement std::complex through libdevice. @bader please confirm.
  2. Yes this is correct. This specialization is happening in libdevice since in earlier discussions we concluded that assertfail doesn't belong in libclc, where spirv or other builtins are specialized for PTX backend if compiling for that triple.

Let me know if you have any other questions

@jinge90
Copy link
Contributor

jinge90 commented Aug 18, 2022

OK, thanks for the clarification.

jinge90
jinge90 previously approved these changes Aug 18, 2022
@hdelan hdelan closed this Aug 25, 2022
@hdelan hdelan reopened this Aug 25, 2022
@hdelan hdelan closed this Aug 29, 2022
@hdelan hdelan reopened this Aug 29, 2022
@hdelan hdelan requested review from jinge90 and smanna12 August 31, 2022 08:20
@steffenlarsen
Copy link
Contributor

@jinge90 & @smanna12 - Friendly ping.

@elizabethandrews
Copy link
Contributor

@jinge90 & @smanna12 - Friendly ping.

@smanna12 is OOO for a few weeks. I don't see any FE changes remaining in this PR, so FE approval is not required.

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.

9 participants