[PATCH] D69990: Populate CUDA flags on FreeBSD too, as many other toolchains do.

2019-12-18 Thread Gleb Popov via Phabricator via cfe-commits
6yearold added a comment.

In D69990#1790047 , @tra wrote:

> > ... I'm curious if it's particularly useful. Last time I checked NVIDIA 
> > didn't ship libcudart for FreeBSD and without it it's rather cumbersome to 
> > use CUDA in practice.
>
> FYI, I've just got our internal proof-of-concept runtime support library 
> which may get CUDA apps run on FreeBSD:
>  https://github.com/google/gpu-runtime
>
> It's somewhat old and misses few glue functions needed by CUDA-10, but it 
> should work well enough for CUDA-9.


Interesting, thanks for sharing. However, at quick look, it seems to require 
other CUDA libraries (`libcuda`, `libcublas`, etc.), which also aren't 
available for FreeBSD.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D69990/new/

https://reviews.llvm.org/D69990



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D69990: Populate CUDA flags on FreeBSD too, as many other toolchains do.

2019-11-12 Thread Gleb Popov via Phabricator via cfe-commits
6yearold added a comment.

Bump.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D69990/new/

https://reviews.llvm.org/D69990



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D69990: Populate CUDA flags on FreeBSD too, as many other toolchains do.

2019-11-07 Thread Gleb Popov via Phabricator via cfe-commits
6yearold created this revision.
Herald added subscribers: cfe-commits, emaste.
Herald added a project: clang.

This allows `clang` to be used to compile CUDA programs. Compiled
simple helloworld.cu with this.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D69990

Files:
  clang/lib/Driver/ToolChains/FreeBSD.cpp
  clang/lib/Driver/ToolChains/FreeBSD.h


Index: clang/lib/Driver/ToolChains/FreeBSD.h
===
--- clang/lib/Driver/ToolChains/FreeBSD.h
+++ clang/lib/Driver/ToolChains/FreeBSD.h
@@ -64,6 +64,8 @@
   llvm::opt::ArgStringList ) const override;
   void AddCXXStdlibLibArgs(const llvm::opt::ArgList ,
llvm::opt::ArgStringList ) const override;
+  void AddCudaIncludeArgs(const llvm::opt::ArgList ,
+  llvm::opt::ArgStringList ) const override;
 
   llvm::ExceptionHandling GetExceptionModel(
   const llvm::opt::ArgList ) const override;
Index: clang/lib/Driver/ToolChains/FreeBSD.cpp
===
--- clang/lib/Driver/ToolChains/FreeBSD.cpp
+++ clang/lib/Driver/ToolChains/FreeBSD.cpp
@@ -397,6 +397,11 @@
   }
 }
 
+void FreeBSD::AddCudaIncludeArgs(const ArgList ,
+ ArgStringList ) const {
+  CudaInstallation.AddCudaIncludeArgs(DriverArgs, CC1Args);
+}
+
 Tool *FreeBSD::buildAssembler() const {
   return new tools::freebsd::Assembler(*this);
 }


Index: clang/lib/Driver/ToolChains/FreeBSD.h
===
--- clang/lib/Driver/ToolChains/FreeBSD.h
+++ clang/lib/Driver/ToolChains/FreeBSD.h
@@ -64,6 +64,8 @@
   llvm::opt::ArgStringList ) const override;
   void AddCXXStdlibLibArgs(const llvm::opt::ArgList ,
llvm::opt::ArgStringList ) const override;
+  void AddCudaIncludeArgs(const llvm::opt::ArgList ,
+  llvm::opt::ArgStringList ) const override;
 
   llvm::ExceptionHandling GetExceptionModel(
   const llvm::opt::ArgList ) const override;
Index: clang/lib/Driver/ToolChains/FreeBSD.cpp
===
--- clang/lib/Driver/ToolChains/FreeBSD.cpp
+++ clang/lib/Driver/ToolChains/FreeBSD.cpp
@@ -397,6 +397,11 @@
   }
 }
 
+void FreeBSD::AddCudaIncludeArgs(const ArgList ,
+ ArgStringList ) const {
+  CudaInstallation.AddCudaIncludeArgs(DriverArgs, CC1Args);
+}
+
 Tool *FreeBSD::buildAssembler() const {
   return new tools::freebsd::Assembler(*this);
 }
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D60220: [CUDA][Windows] Final fix for bug 38811 (Step 3 of 3)

2019-10-28 Thread Gleb Popov via Phabricator via cfe-commits
6yearold added a comment.

I'm seeing quite similar errors on FreeBSD with Clang 8 and 9:

  In file included from :1:
  In file included from 
/usr/local/llvm90/lib/clang/9.0.0/include/__clang_cuda_runtime_wrapper.h:204:
  
/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/local/llvm90/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); }
 ^
  In file included from :1:
  In file included from 
/usr/local/llvm90/lib/clang/9.0.0/include/__clang_cuda_runtime_wrapper.h:204:
  
/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:2934:7:
 error: no matching function for call to '__isnan'
if (__isnan(a)) {
^~~
  
/usr/local/llvm90/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); }
 ^
  In file included from :1:
  In file included from 
/usr/local/llvm90/lib/clang/9.0.0/include/__clang_cuda_runtime_wrapper.h:204:
  
/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:2960:7:
 error: no matching function for call to '__isnan'
if (__isnan(a)) {
^~~
  
/usr/local/llvm90/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); }
 ^
  In file included from :1:
  In file included from 
/usr/local/llvm90/lib/clang/9.0.0/include/__clang_cuda_runtime_wrapper.h:204:
  
/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:3090:7:
 error: no matching function for call to '__isnan'
if (__isnan(a)) {
^~~
  
/usr/local/llvm90/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); }
 ^
  In file included from :1:
  In file included from 
/usr/local/llvm90/lib/clang/9.0.0/include/__clang_cuda_runtime_wrapper.h:204:
  
/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:3196:7:
 error: no matching function for call to '__isnan'
if (__isnan(a)) {
^~~
  
/usr/local/llvm90/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); }
 ^

Any idea how to fix this?


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D60220/new/

https://reviews.llvm.org/D60220



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits