isnan error with ROCm 4.2.0

Issue #45 resolved
Gerald Ragghianti created an issue

Testing for next release from the master branch using a centos:7 container and spack. I can build successfully with ROCm 4.0.0:

spack install magma@master +rocm ~cuda amdgpu_target=gfx900 ^openblas@0.3.10 ^hip@4.0.0 ^hipblas@4.0.0 ^hipsparse@4.0.0

With ROCm 4.2.0 I get an error “call to isnan is ambiguous”:

spack install magma@master +rocm ~cuda amdgpu_target=gfx900 ^openblas@0.3.10 ^hip@4.2.0 ^hipblas@4.2.0 ^hipsparse@4.2.0

     4433    [ 13%] Building CXX object CMakeFiles/magma.dir/magmablas_hip/sgem
             m_vbatched_core.hip.cpp.o
     4434 /opt/spack/opt/spack/linux-centos7-zen/gcc-7.3.0/hip-4.2.0-6mzkm46
             olwyb2oeu35zdapwlie35oj2h/bin/hipcc -D__HIP_PLATFORM_AMD__=1 -D__H
             IP_PLATFORM_HCC__=1 -Dmagma_EXPORTS -I/tmp/root/spack-stage/spack-
stage-magma-master-7yubauaiu6fsktrjne5ayboorxwinvnh/spack-build-7y
             ubaua/include -I/tmp/root/spack-stage/spack-stage-magma-master-7yu
             bauaiu6fsktrjne5ayboorxwinvnh/spack-src/include -I/tmp/root/spack-
stage/spack-stage-magma-master-7yubauaiu6fsktrjne5ayboorxwinvnh/sp
             ack-src/control -I/tmp/root/spack-stage/spack-stage-magma-master-7
yubauaiu6fsktrjne5ayboorxwinvnh/spack-src/magmablas_hip -I/tmp/roo
t/spack-stage/spack-stage-magma-master-7yubauaiu6fsktrjne5ayboorxw
             invnh/spack-src/sparse_hip/include -I/tmp/root/spack-stage/spack-s
tage-magma-master-7yubauaiu6fsktrjne5ayboorxwinvnh/spack-src/spars
             e_hip/control -I/tmp/root/spack-stage/spack-stage-magma-master-7yu
             bauaiu6fsktrjne5ayboorxwinvnh/spack-src/testing -isystem /opt/spac
k/opt/spack/linux-centos7-zen/gcc-7.3.0/hipblas-4.2.0-pcfsgt4zmkif
             3lzq75ik2puamqzfdpdf/include -isystem /opt/spack/opt/spack/linux-c
entos7-zen/gcc-7.3.0/hipsparse-4.2.0-vzmuzjnc47ggf7db3enur4wu36zp6
             k4f/include -std=c++11 -fopenmp=libomp -Wall -Wno-unused-function
             -O2 -g -DNDEBUG -fPIC -MD -MT CMakeFiles/magma.dir/magmablas_hip/s
             gemm_vbatched_core.hip.cpp.o -MF CMakeFiles/magma.dir/magmablas_hi
             p/sgemm_vbatched_core.hip.cpp.o.d -o CMakeFiles/magma.dir/magmabla
             s_hip/sgemm_vbatched_core.hip.cpp.o -c /tmp/root/spack-stage/spack
-stage-magma-master-7yubauaiu6fsktrjne5ayboorxwinvnh/spack-src/mag
             mablas_hip/sgemm_vbatched_core.hip.cpp
     4435    In file included from /tmp/root/spack-stage/spack-stage-magma-mast
er-7yubauaiu6fsktrjne5ayboorxwinvnh/spack-src/magmablas_hip/zpotf2
             _kernels.hip.cpp:40:
  >> 4436 /tmp/root/spack-stage/spack-stage-magma-master-7yubauaiu6fsktrjne5
ayboorxwinvnh/spack-src/magmablas_hip/zpotf2_devicesfunc.hip.hpp:9
             5:63: error: call to 'isnan' is ambiguous
     4437                linfo = ( linfo == 0 && (xreal <= MAGMA_D_ZERO || ::is
             nan(xreal)) ) ? (iter+1) : linfo;
4438 ^~~~
             ~~~
     4439 /opt/spack/opt/spack/linux-centos7-x86_64_v3/gcc-4.8.5/gcc-7.3.0-m
k6gchzaxqfxteggcdfv2hp65bwjwe66/lib/gcc/x86_64-pc-linux-gnu/7.3.0/
             ../../../../include/c++/7.3.0/cmath:618:3: note: candidate functio
             n
     4440      isnan(float __x)
     4441      ^
     4442 /opt/spack/opt/spack/linux-centos7-x86_64_v3/gcc-4.8.5/gcc-7.3.0-m
k6gchzaxqfxteggcdfv2hp65bwjwe66/lib/gcc/x86_64-pc-linux-gnu/7.3.0/
             ../../../../include/c++/7.3.0/cmath:631:3: note: candidate functio
             n
     4443      isnan(long double __x)
     4444      ^
     4445    1 error generated when compiling for host.
  >> 4446    make[2]: *** [CMakeFiles/magma.dir/magmablas_hip/zpotf2_kernels.hi
             p.cpp.o] Error 1

Comments (6)

  1. Gerald Ragghianti reporter

    This does appear to have resolved the issue and allows me to fully compile magma with rocm 4.2.0. Thanks.

  2. Log in to comment