You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
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
The text was updated successfully, but these errors were encountered:
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
The text was updated successfully, but these errors were encountered: