|
16 | 16 | #include <cmath>
|
17 | 17 | #include <sstream>
|
18 | 18 | #include <stdexcept>
|
19 |
| -#include <tuple> |
20 | 19 | #include <vector>
|
21 | 20 |
|
22 |
| -namespace torch { |
23 |
| -namespace jit { |
24 |
| -namespace fuser { |
25 |
| -namespace cuda { |
| 21 | +namespace torch::jit::fuser::cuda { |
26 | 22 |
|
27 | 23 | // See NOTE [ USE OF NVRTC AND DRIVER API ]
|
28 | 24 | const at::cuda::NVRTC& nvrtc() {
|
@@ -85,7 +81,6 @@ void codegenOutputQuery(
|
85 | 81 | }
|
86 | 82 |
|
87 | 83 | // Compiles the specified kernel and stores the metadata required to run it
|
88 |
| -// NOLINTNEXTLINE(cppcoreguidelines-pro-type-member-init) |
89 | 84 | FusedKernelCUDA::FusedKernelCUDA(
|
90 | 85 | at::DeviceIndex device,
|
91 | 86 | std::string name,
|
@@ -114,6 +109,7 @@ FusedKernelCUDA::FusedKernelCUDA(
|
114 | 109 |
|
115 | 110 | // Acquires device and NVRTC properties (for compile arch and occupancy
|
116 | 111 | // calculations)
|
| 112 | + // NOLINTNEXTLINE(cppcoreguidelines-prefer-member-initializer) |
117 | 113 | prop_ = at::cuda::getCurrentDeviceProperties();
|
118 | 114 | int major = 0, minor = 0;
|
119 | 115 | bool compile_to_sass = false;
|
@@ -197,8 +193,7 @@ static int ceilDiv(const int a, const int b) {
|
197 | 193 | void FusedKernelCUDA::launch_raw(
|
198 | 194 | const uint32_t numel,
|
199 | 195 | std::vector<void*>& arguments) const {
|
200 |
| - // NOLINTNEXTLINE(bugprone-unused-raii) |
201 |
| - at::cuda::CUDAGuard{device_}; |
| 196 | + at::cuda::CUDAGuard guard{device_}; |
202 | 197 | // Hacked at::DeviceGuard (see note above)
|
203 | 198 | const auto prior_device = at::cuda::current_device();
|
204 | 199 | at::cuda::set_device(device_);
|
@@ -269,7 +264,4 @@ static std::shared_ptr<FusedKernel> createFusionKernel(
|
269 | 264 |
|
270 | 265 | RegisterFusionBackend reg(DeviceType::CUDA, createFusionKernel);
|
271 | 266 |
|
272 |
| -} // namespace cuda |
273 |
| -} // namespace fuser |
274 |
| -} // namespace jit |
275 |
| -} // namespace torch |
| 267 | +} // namespace torch::jit::fuser::cuda |
0 commit comments