@@ -115,14 +115,12 @@ FusedKernelCUDA::FusedKernelCUDA(
115
115
// Acquires device and NVRTC properties (for compile arch and occupancy
116
116
// calculations)
117
117
prop_ = at::cuda::getCurrentDeviceProperties ();
118
- // NOLINTNEXTLINE(cppcoreguidelines-init-variables)
119
- int major, minor;
118
+ int major = 0 , minor = 0 ;
120
119
bool compile_to_sass = false ;
121
120
codegenOutputQuery (prop_, major, minor, compile_to_sass);
122
121
123
122
// Creates the NVRTC program
124
- // NOLINTNEXTLINE(cppcoreguidelines-init-variables)
125
- nvrtcProgram program;
123
+ nvrtcProgram program{};
126
124
AT_CUDA_NVRTC_CHECK (nvrtc ().nvrtcCreateProgram (
127
125
&program, code_.c_str (), nullptr , 0 , nullptr , nullptr ));
128
126
@@ -144,17 +142,14 @@ FusedKernelCUDA::FusedKernelCUDA(
144
142
" compute_" +
145
143
#endif
146
144
std::to_string (major) + std::to_string (minor);
147
- // NOLINTNEXTLINE(cppcoreguidelines-init-variables)
148
145
const std::vector<const char *> args = {
149
146
" --std=c++17" , compute.c_str (), " -default-device" };
150
147
#endif
151
148
const auto result =
152
149
nvrtc ().nvrtcCompileProgram (program, args.size (), args.data ());
153
150
if (result != NVRTC_SUCCESS) {
154
- // NOLINTNEXTLINE(cppcoreguidelines-init-variables)
155
- size_t logsize;
151
+ size_t logsize = 0 ;
156
152
AT_CUDA_NVRTC_CHECK (nvrtc ().nvrtcGetProgramLogSize (program, &logsize));
157
- // NOLINTNEXTLINE(cppcoreguidelines-init-variables)
158
153
std::vector<char > log (logsize);
159
154
AT_CUDA_NVRTC_CHECK (nvrtc ().nvrtcGetProgramLog (program, log .data ()));
160
155
std::stringstream cu;
@@ -164,8 +159,7 @@ FusedKernelCUDA::FusedKernelCUDA(
164
159
ResourceGuard holdProgram (
165
160
[&] { AT_CUDA_NVRTC_CHECK (nvrtc ().nvrtcDestroyProgram (&program)); });
166
161
AT_CUDA_NVRTC_CHECK (result);
167
- // NOLINTNEXTLINE(cppcoreguidelines-init-variables)
168
- size_t ptx_size;
162
+ size_t ptx_size = 0 ;
169
163
#if defined(CUDA_VERSION) && CUDA_VERSION >= 11010
170
164
// compile_to_sass determines whether we are generating SASS or PTX, hence
171
165
// the different API.
0 commit comments