Fix error reporting in NVRTC use of the fuser (#18327)
authorThomas Viehmann <tv.code@beamnet.de>
Fri, 22 Mar 2019 20:31:37 +0000 (13:31 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Fri, 22 Mar 2019 20:41:00 +0000 (13:41 -0700)
Summary:
Two functions were not directed ad NVRTC.
It's a bit hard to test this, as the fuser usually produces correct code - unless I try to hack on it. :)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/18327

Differential Revision: D14579285

Pulled By: soumith

fbshipit-source-id: 1be7ba461cc473d514ba619507742a47d4d7c97e

torch/csrc/jit/fuser/cuda/fused_kernel.cpp
torch/csrc/jit/fuser/cuda/thnvrtc.h

index 291cee2..c49f92f 100644 (file)
@@ -185,9 +185,9 @@ FusedKernelCUDA::FusedKernelCUDA(
       nvrtc().nvrtcCompileProgram(program, args.size(), args.data());
   if (result == NVRTC_ERROR_COMPILATION) {
     size_t logsize;
-    nvrtcGetProgramLogSize(program, &logsize);
+    nvrtc().nvrtcGetProgramLogSize(program, &logsize);
     std::vector<char> log(logsize);
-    nvrtcGetProgramLog(program, log.data());
+    nvrtc().nvrtcGetProgramLog(program, log.data());
     std::stringstream cu;
     cu << log.data();
     throw std::runtime_error(cu.str());
index 17f4a12..23c18ac 100644 (file)
@@ -16,6 +16,8 @@
   _(cuOccupancyMaxActiveBlocksPerMultiprocessor) \
   _(cuGetErrorString)                            \
   _(nvrtcGetErrorString)                         \
+  _(nvrtcGetProgramLogSize)                      \
+  _(nvrtcGetProgramLog)                          \
   _(cuLaunchKernel)                              \
   _(nvrtcCompileProgram)                         \
   _(cuCtxGetCurrent)                             \