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

Complex math functions not linking on nvptx #50981

Closed
pdhaliwal-amd opened this issue Aug 27, 2021 · 4 comments
Closed

Complex math functions not linking on nvptx #50981

pdhaliwal-amd opened this issue Aug 27, 2021 · 4 comments
Labels
bugzilla Issues migrated from bugzilla openmp

Comments

@pdhaliwal-amd
Copy link
Contributor

Bugzilla Link 51639
Resolution FIXED
Resolved on Sep 01, 2021 17:40
Version trunk
OS All
Blocks #50580
CC @jdoerfert,@jdoerfert,@tstellar
Fixed by commit(s) 2930c83 73c36a9

Extended Description

I have been trying to use complex math functions in the openmp target
region. I am able to use basic complex arithmetic but math functions
like abs, sin do not work. I get a linker undefined error when I use
these methods. I noticed that these methods are defined in
openmp_wrappers/complex_cmath.h in the variant region in
https://github.com/llvm/llvm-project/blob/main/clang/lib/Headers/openmp_wrappers/complex#L47.
Am I missing something?

More details,
command line: clang++ test.cpp -fopenmp -fopenmp-targets=nvptx64-nvidia-cuda
test.cpp:
#include
#include
#include

int main() {
std::complex x, a, b;
#pragma omp target map(tofrom: x)
{
x = std::exp(a * b);
}

std::cout << x << std::endl;
return 0;
}

linker error: nvlink error : Undefined reference to 'cexp' in
'/tmp/test-a02307.cubin'
CUDA details:
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2020 NVIDIA Corporation
Built on Tue_Sep_15_19:10:02_PDT_2020
Cuda compilation tools, release 11.1, V11.1.74
Build cuda_11.1.TC455_06.29069683_0

@jdoerfert
Copy link
Member

Fixed by 5877356db6966409f4f9f2cdbcf3a07

@​Tom can we back port this too.

@tstellar
Copy link
Collaborator

Fixed by 5877356db6966409f4f9f2cdbcf3a07

@​Tom can we back port this too.

Is the fix 5877356db6966409f4f9f2cdbcf3a07 or 2930c83 ?

@jdoerfert
Copy link
Member

Fixed by 5877356db6966409f4f9f2cdbcf3a07

@​Tom can we back port this too.

Is the fix 5877356db6966409f4f9f2cdbcf3a07 or
2930c83 ?

5877... is a suffix of the actual 2930c... git hash.
I managed to loose the first few digits somehow.
The fix is: 2930c83

@tstellar
Copy link
Collaborator

tstellar commented Sep 2, 2021

Merged: 73c36a9

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 11, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla openmp
Projects
None yet
Development

No branches or pull requests

3 participants