From 2aac18098da08552362ea081c851f06b972a8d9f Mon Sep 17 00:00:00 2001 From: Thomas Viehmann Date: Fri, 22 Mar 2019 13:31:37 -0700 Subject: [PATCH] Fix error reporting in NVRTC use of the fuser (#18327) 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 | 4 ++-- torch/csrc/jit/fuser/cuda/thnvrtc.h | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/torch/csrc/jit/fuser/cuda/fused_kernel.cpp b/torch/csrc/jit/fuser/cuda/fused_kernel.cpp index 291cee2..c49f92f 100644 --- a/torch/csrc/jit/fuser/cuda/fused_kernel.cpp +++ b/torch/csrc/jit/fuser/cuda/fused_kernel.cpp @@ -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 log(logsize); - nvrtcGetProgramLog(program, log.data()); + nvrtc().nvrtcGetProgramLog(program, log.data()); std::stringstream cu; cu << log.data(); throw std::runtime_error(cu.str()); diff --git a/torch/csrc/jit/fuser/cuda/thnvrtc.h b/torch/csrc/jit/fuser/cuda/thnvrtc.h index 17f4a12..23c18ac 100644 --- a/torch/csrc/jit/fuser/cuda/thnvrtc.h +++ b/torch/csrc/jit/fuser/cuda/thnvrtc.h @@ -16,6 +16,8 @@ _(cuOccupancyMaxActiveBlocksPerMultiprocessor) \ _(cuGetErrorString) \ _(nvrtcGetErrorString) \ + _(nvrtcGetProgramLogSize) \ + _(nvrtcGetProgramLog) \ _(cuLaunchKernel) \ _(nvrtcCompileProgram) \ _(cuCtxGetCurrent) \ -- 2.7.4