Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 10 Nov 2019 17:34:11 +0000
From:      bugzilla-noreply@freebsd.org
To:        toolchain@FreeBSD.org
Subject:   [Bug 241550] Base Clang can't compile trivial CUDA programs: error: no matching function for call to '__isnan'
Message-ID:  <bug-241550-29464-IQ9H9zImtR@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-241550-29464@https.bugs.freebsd.org/bugzilla/>
References:  <bug-241550-29464@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D241550

--- Comment #9 from commit-hook@freebsd.org ---
A commit references this bug:

Author: dim
Date: Sun Nov 10 17:33:12 UTC 2019
New revision: 354596
URL: https://svnweb.freebsd.org/changeset/base/354596

Log:
  MFC r354255:

  Add __isnan()/__isnanf() aliases for compatibility with glibc and CUDA

  Even though clang comes with a number of internal CUDA wrapper headers,
  compiling sample CUDA programs will result in errors similar to:

  In file included from <built-in>:1:
  In file included from
/usr/lib/clang/9.0.0/include/__clang_cuda_runtime_wrapper.h:204:
=20
/usr/home/arr/cuda/var/cuda-repo-10-0-local-10.0.130-410.48/usr/local/cuda-=
10.0//include/crt/math_functions.hpp:2910:7:
error: no matching function for call to '__isnan'
    if (__isnan(a)) {
        ^~~~~~~
  /usr/lib/clang/9.0.0/include/__clang_cuda_device_functions.h:460:16: note:
candidate function not viable: call to __device__ function from __host__
function
  __DEVICE__ int __isnan(double __a) { return __nv_isnand(__a); }
                 ^

  CUDA expects __isnan() and __isnanf() declarations to be available,
  which are glibc specific extensions, equivalent to the regular isnan()
  and isnanf().

  To provide these, define __isnan() and __isnanf() as aliases of the
  already existing static inline functions __inline_isnan() and
  __inline_isnanf() from math.h.

  Reported by:  arrowd
  PR:           241550

Changes:
_U  stable/10/
  stable/10/lib/libc/gen/isnan.c
  stable/10/lib/msun/src/math.h
  stable/10/lib/msun/src/s_isnan.c
_U  stable/11/
  stable/11/lib/libc/gen/isnan.c
  stable/11/lib/msun/src/math.h
  stable/11/lib/msun/src/s_isnan.c
_U  stable/12/
  stable/12/lib/libc/gen/isnan.c
  stable/12/lib/msun/src/math.h
  stable/12/lib/msun/src/s_isnan.c

--=20
You are receiving this mail because:
You are on the CC list for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-241550-29464-IQ9H9zImtR>