[PATCH] D35703: [GPGPU] Add support for NVIDIA libdevice

Singapuram Sanjay Srivallabh via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 24 08:10:56 PDT 2017


singam-sanjay added inline comments.


================
Comment at: lib/CodeGen/PPCGCodeGeneration.cpp:107
 
+static cl::opt<std::string> LibDevice(
+    "polly-acc-libdevice", cl::desc("Path to CUDA libdevice"), cl::Hidden,
----------------
tra wrote:
> This is something that is useful for all NVPTX users and should probably live there and it should not have any hardcoded path -- it's too easy to end up silently picking wrong library otherwise.
> 
> Hardcoded compute_20 is also problematic because it should depend on particular GPU arch we're compiling for.
> 
> Considering that LLVM has no idea about CUDA SDL location, this is sommething that should always be explicitly specified. Either base path + libdevice name derived from GPU arch, or complete path to specific libdevice variant (i.e. it's completely up to the user to provide correct libdevice).
Would it be better to call this CUDALibDevice or CULibDevice  instead ? since this applies only to NVPTX


================
Comment at: lib/CodeGen/PPCGCodeGeneration.cpp:109
+    "polly-acc-libdevice", cl::desc("Path to CUDA libdevice"), cl::Hidden,
+    cl::init("/usr/local/cuda-7.5/nvvm/libdevice/libdevice.compute_20.10.bc"),
+    cl::ZeroOrMore, cl::cat(PollyCategory));
----------------
Consider changing this to "/usr/local/**cuda**/nvvm/libdevice/libdevice.compute_20_10.bc". That would work on most Linux platforms by default.

I'm not sure if PTX code for a compute capability  2 device would run on any newer device. Is it possible to initialize this after figuring out the CC of device 0 ?

Also, I heard that CUDA SDK 8 would be the last to support CC 2.x. CUDA 9 supports all CCs from 3.0.


================
Comment at: lib/CodeGen/PPCGCodeGeneration.cpp:609
+  /// Link with the NVIDIA libdevice library (if needed and available).
+  void addLibDevice();
+
----------------
Would addCULibDevice be a better name ?


https://reviews.llvm.org/D35703





More information about the llvm-commits mailing list