[llvm-dev] cuda cross compiling issue for target aarch64-linux-androideabi

Justin Lebar via llvm-dev llvm-dev at lists.llvm.org
Fri Mar 23 12:57:06 PDT 2018


+Artem Belevich <tra at google.com>

On Fri, Mar 23, 2018 at 7:53 PM Bharath Bhoopalam via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

> I was wondering if anyone has encountered this issue when cross compiling
> cuda on Nvidia TX2 running android.
>
> The error is
> In file included from <built-in>:1:
> In file included from
> prebuilts/clang/host/linux-x86/clang-4667116/lib64/clang/7.0.1/include/__clang_cuda_runtime_wrapper.h:219:
> ../cuda/targets/aarch64-linux-androideabi/include/math_functions.hpp:3477:19:
> error: no matching function for call to '__isinf'
>   if (a == 0.0 || __isinf(a)) {
>                   ^~~~~~~
> ../cuda/targets/aarch64-linux-androideabi/include/math_functions_dbl_ptx3.hpp:165:38:
> note: candidate function not viable: call to __device__ function
>       from __host__ function
> __MATH_FUNCTIONS_DBL_PTX3_DECL__ int __isinf(double a) __THROW
>                                      ^
> In file included from <built-in>:1:
> In file included from
> ../prebuilts/clang/host/linux-x86/clang-4667116/lib64/clang/7.0.1/include/__clang_cuda_runtime_wrapper.h:219:
> ../cuda/targets/aarch64-linux-androideabi/include/math_functions.hpp:3501:19:
> error: no matching function for call to '__isinf'
>   if (a == 0.0 || __isinf(a)) {
>                   ^~~~~~~
> ../cuda/targets/aarch64-linux-androideabi/include/math_functions_dbl_ptx3.hpp:165:38:
> note: candidate function not viable: call to __device__ function
>       from __host__ function
> __MATH_FUNCTIONS_DBL_PTX3_DECL__ int __isinf(double a) __THROW
>                                      ^
> In file included from <built-in>:1:
> In file included from
> ../prebuilts/clang/host/linux-x86/clang-4667116/lib64/clang/7.0.1/include/__clang_cuda_runtime_wrapper.h:219:
> ../cuda/targets/aarch64-linux-androideabi/include/math_functions.hpp:3527:7:
> error: no matching function for call to '__isinf'
>   if (__isinf(a)) {
>       ^~~~~~~
> ../aarch64-linux-androideabi/include/math_functions_dbl_ptx3.hpp:165:38:
> note: candidate function not viable: call to __device__ function
>       from __host__ function
> __MATH_FUNCTIONS_DBL_PTX3_DECL__ int __isinf(double a) __THROW
>                                      ^
> 3 errors generated when compiling for sm_20.
>
>
> The command I used  is following
>
> prebuilts/clang/host/linux-x86/clang-4667116/bin/clang++ \
> -v \
> -target aarch64-linux-androideabi  \
> --cuda-path=/cuda/targets/aarch64-linux-androideabi \
> -I ./cuda/targets/aarch64-linux-androideabi/ \
> -I ../platforms/android-24/arch-arm64/usr/include \
> -I .prebuilts/ndk/current/sources/sources/cxx-stl/gnu-libstdc++/4.9/include
> \
> -I
> prebuilts/ndk/current/sources/cxx-stl/gnu-libstdc++/4.9/libs/arm64-v8a/include
> \
> -I ndk/sources/cxx-stl/system/include \
> -L ./cuda/targets/aarch64-linux-androideabi/lib \
> -lcudart -lcudart_static -ldl -lrt -pthread \
> -o axpy axpy.cu
>
> clang version I am using is
> Android (4667116 based on r326829) clang version 7.0.1 (
> https://android.googlesource.com/toolchain/clang
> 76e4d638afc560ad21845fad570888bef8c18045) (
> https://android.googlesource.com/toolchain/llvm
> 67f3e6a51d93777841e0fb6d07f71fdf343df239) (based on LLVM 7.0.1svn)
> Target: aarch64--linux-android
> Thread model: posix
>
>
> I dont have any issues build this file for native platform (ubuntu14.04)
> clang++
> --cuda-path=/usr/local/cuda-8.0 \
> -I /usr/local/cuda-8.0/include \
> -L/usr/local/cuda-8.0/lib64  \
> -lcudart -lcudart_static -ldl -lrt -pthread \
> -o axpy axpy.cu
>
> any guidance is appreciated.
>
>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180323/800ffec6/attachment.html>


More information about the llvm-dev mailing list