From 600f4bf20c63e4c6aa70841e9bbfd1ae77d3ca39 Mon Sep 17 00:00:00 2001 From: Richard Barnes Date: Tue, 22 Feb 2022 13:11:44 -0800 Subject: [PATCH] Clean up some unused variable warnings (#73151) Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/73151 Test Plan: Sandcastle Reviewed By: malfet Differential Revision: D34365492 fbshipit-source-id: d9eaa2e21aacd8ff0b97152e590d83f682df4667 (cherry picked from commit ca0efc53db568b035049b09f5827387d2dc7e382) --- aten/src/ATen/native/cuda/SummaryOps.cu | 6 +++--- aten/src/ATen/native/cuda/UpSampleBilinear2d.cu | 10 ++-------- caffe2/operators/elementwise_ops.cu | 3 +++ 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/aten/src/ATen/native/cuda/SummaryOps.cu b/aten/src/ATen/native/cuda/SummaryOps.cu index 958ad88183e..4b47d0c9cd9 100644 --- a/aten/src/ATen/native/cuda/SummaryOps.cu +++ b/aten/src/ATen/native/cuda/SummaryOps.cu @@ -311,7 +311,7 @@ Tensor _bincount_cuda_template( weights.options().layout_opt(), weights.options().device_opt(), weights.options().pinned_memory_opt()); - auto ret = cuda::CUDA_tensor_histogram( + cuda::CUDA_tensor_histogram( output, self, weights, nbins, minvalue, maxvalue); } else { output = native::zeros( @@ -320,7 +320,7 @@ Tensor _bincount_cuda_template( c10::nullopt /* layout */, DeviceType::CUDA, c10::nullopt /* pin_memory */); - auto ret = cuda::CUDA_tensor_histogram( + cuda::CUDA_tensor_histogram( output, self, weights, nbins, minvalue, maxvalue); } return output; @@ -374,7 +374,7 @@ Tensor _histc_cuda_template( #endif TORCH_CHECK(minvalue < maxvalue, "max must be larger than min"); - auto ret = cuda::CUDA_tensor_histogram( + cuda::CUDA_tensor_histogram( output, self, Tensor(), nbins, minvalue, maxvalue); return output; } diff --git a/aten/src/ATen/native/cuda/UpSampleBilinear2d.cu b/aten/src/ATen/native/cuda/UpSampleBilinear2d.cu index d5153838139..09ec9528ead 100644 --- a/aten/src/ATen/native/cuda/UpSampleBilinear2d.cu +++ b/aten/src/ATen/native/cuda/UpSampleBilinear2d.cu @@ -456,7 +456,6 @@ C10_LAUNCH_BOUNDS_1(256) // 256 performs better then 1024 __global__ void upsample_gen2d_aa_out_frame( const accscalar_t height_scale, const accscalar_t width_scale, - const bool align_corners, const PackedTensorAccessor64 idata, PackedTensorAccessor64 odata, const InterpFilter & interp_filter) { @@ -550,7 +549,6 @@ C10_LAUNCH_BOUNDS_1(256) // 256 performs better then 1024 __global__ void upsample_gen2d_aa_backward_out_frame( const accscalar_t height_scale, const accscalar_t width_scale, - const bool align_corners, PackedTensorAccessor64 idata, const PackedTensorAccessor64 odata, const InterpFilter & interp_filter) { @@ -672,8 +670,6 @@ static void upsample_gen2d_aa_out_cuda_template( int output_height = output_size[0]; int output_width = output_size[1]; - int nbatch = input.size(0); - int channels = input.size(1); int input_height = input.size(2); int input_width = input.size(3); @@ -735,7 +731,7 @@ static void upsample_gen2d_aa_out_cuda_template( <<>>(height_scale, width_scale, align_corners, idata, odata, interp_filter); + stream>>>(height_scale, width_scale, idata, odata, interp_filter); C10_CUDA_KERNEL_LAUNCH_CHECK(); }); @@ -766,8 +762,6 @@ static void upsample_gen2d_aa_backward_out_cuda_template( int output_height = output_size[0]; int output_width = output_size[1]; - int nbatch = input_size[0]; - int channels = input_size[1]; int input_height = input_size[2]; int input_width = input_size[3]; @@ -819,7 +813,7 @@ static void upsample_gen2d_aa_backward_out_cuda_template( <<>>(height_scale, width_scale, align_corners, idata, odata, interp_filter); + stream>>>(height_scale, width_scale, idata, odata, interp_filter); C10_CUDA_KERNEL_LAUNCH_CHECK(); }); } diff --git a/caffe2/operators/elementwise_ops.cu b/caffe2/operators/elementwise_ops.cu index 932bd5dafda..fcbe26f927a 100644 --- a/caffe2/operators/elementwise_ops.cu +++ b/caffe2/operators/elementwise_ops.cu @@ -119,6 +119,9 @@ void device_reduce( int N, Tensor* buffer, CUDAContext* context) { + (void)N; // Suppress unused variable warning + (void)buffer; // Suppress unused variable warning + (void)context; // Suppress unused variable warning #if TORCH_HIP_VERSION >= 210 auto buffer_size = 1;