[PATCH] D35703: [GPGPU] Add support for NVIDIA libdevice
Siddharth via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 20 15:54:51 PDT 2017
bollu added inline comments.
================
Comment at: lib/CodeGen/PPCGCodeGeneration.cpp:1314
+/// A list of functions that are available in NVIDIA's libdevice.
+std::vector<std::string> LibDeviceFunctions = {"exp", "expf", "expl", "cos",
+ "cosf"};
----------------
Consider changing to `SmallSet`? That feels correct in terms of semantics (a `set` of functions.)
================
Comment at: lib/CodeGen/PPCGCodeGeneration.cpp:1418
+
+ bool AllowLibDevice = Arch == GPUArch::NVPTX64;
+
----------------
`const bool`? :)
================
Comment at: lib/CodeGen/PPCGCodeGeneration.cpp:2131
+ }
+ }
+
----------------
consider moving computing `RequiresLibDevice` to a pure function?
================
Comment at: lib/CodeGen/PPCGCodeGeneration.cpp:2138
+
+ if (!LibDeviceModule) {
+ BuildSuccessful = false;
----------------
I believe we can `assert` at this point, since this is not a "mis-compile" in the strictest sense of the word?.
================
Comment at: lib/CodeGen/PPCGCodeGeneration.cpp:2148
+ // Set an nvptx64 target triple to avoid linker warnings. The original
+ // trible of the libdevice files are nvptx-unknown-unknown.
+ LibDeviceModule->setTargetTriple(Triple::normalize("nvptx64-nvidia-cuda"));
----------------
nit: `trible` -> `triple`.
https://reviews.llvm.org/D35703
More information about the llvm-commits
mailing list