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

Improve SSCP std builtins remapping for -ffast-math #1435

Open
breyerml opened this issue Apr 9, 2024 · 1 comment
Open

Improve SSCP std builtins remapping for -ffast-math #1435

breyerml opened this issue Apr 9, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@breyerml
Copy link
Contributor

breyerml commented Apr 9, 2024

Bug summary
If fast-math is enabled, the JIT compilation (on an NVIDIA GPU) fails when using std::pow inside std::for_each with:

fatal error: error in backend: Undefined external symbol "__powidf2"
[AdaptiveCpp Error] from adaptivecpp/source/include/hipSYCL/glue/llvm-sscp/jit.hpp:265 @ compile(): jit::compile: Encountered errors:
0: LLVMToPtx: clang invocation failed with exit code 70

The same also happens with std::exp:

fatal error: error in backend: Undefined external symbol "exp"
[AdaptiveCpp Error] adaptivecpp/source/include/hipSYCL/glue/llvm-sscp/jit.hpp:265 @ compile(): jit::compile: Encountered errors:
0: LLVMToPtx: clang invocation failed with exit code 70

To Reproduce
Compile a code snippet using C++ standard parallelism on an NVIDIA GPU with AdaptiveCpp v24.02.0

Expected behavior
JIT compilation should not fail.

@breyerml breyerml added the bug Something isn't working label Apr 9, 2024
@illuhad illuhad changed the title JIT compilation fails if fast-math is enabled Improve SSCP std builtins remapping for -ffast-math Apr 9, 2024
@illuhad
Copy link
Collaborator

illuhad commented Apr 9, 2024

We should also look into supporting the functions here: https://gcc.gnu.org/onlinedocs/gccint/Soft-float-library-routines.html which is where the mentioned __powidf2 is listed.

Not sure though why these are specifically emitted with fast-math, seems as this is more related to emulating functions without hardware support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants