diff --git a/mace/kernels/eltwise.h b/mace/kernels/eltwise.h index a3c6333011b3e54180382edade73975fca1bb7a9..c6019f5acd0515f91d284679e62367756d55b1c5 100644 --- a/mace/kernels/eltwise.h +++ b/mace/kernels/eltwise.h @@ -41,7 +41,7 @@ struct EltwiseFunctor : EltwiseFunctorBase { StatsFuture *future) { Tensor::MappingGuard input0_guard(input0); Tensor::MappingGuard input1_guard(input1); - Tensor::MappingGuard output_guard(output); + Tensor::MappingGuard output_guard(output); const T *input0_ptr = input0->data(); const T *input1_ptr = input1->data(); @@ -56,12 +56,12 @@ struct EltwiseFunctor : EltwiseFunctorBase { } break; case SUM: - if (coeff_.empty()) { + if (coeff_.empty()) { #pragma omp parallel for - for (index_t i = 0; i < size; ++i) { + for (index_t i = 0; i < size; ++i) { output_ptr[i] = input0_ptr[i] + input1_ptr[i]; } - } else { + } else { #pragma omp parallel for for (index_t i = 0; i < size; ++i) { output_ptr[i] = @@ -69,13 +69,13 @@ struct EltwiseFunctor : EltwiseFunctorBase { } } break; - case MAX: + case MAX: #pragma omp parallel for for (index_t i = 0; i < size; ++i) { output_ptr[i] = std::max(input0_ptr[i], input1_ptr[i]); } break; - case MIN: + case MIN: #pragma omp parallel for for (index_t i = 0; i < size; ++i) { output_ptr[i] = std::min(input0_ptr[i], input1_ptr[i]); diff --git a/mace/kernels/opencl/depth_to_space_opencl.cc b/mace/kernels/opencl/depth_to_space_opencl.cc index 392d257ec60924bd7d8d7fc93cc0d224c26d00f4..eed23ba2d4e4a52729522235bc33ac0d2ef5a01c 100644 --- a/mace/kernels/opencl/depth_to_space_opencl.cc +++ b/mace/kernels/opencl/depth_to_space_opencl.cc @@ -21,7 +21,6 @@ void DepthToSpaceOpFunctor::operator()( const index_t input_depth = input->dim(3); const char *kernel_name = nullptr; - index_t kernel_width = input_width; index_t output_height, output_width, output_depth; if (d2s_) { @@ -29,13 +28,11 @@ void DepthToSpaceOpFunctor::operator()( output_width = input_width * block_size_; output_depth = input_depth / (block_size_ * block_size_); kernel_name = "depth_to_space"; - kernel_width = output_width; } else { output_height = input_height / block_size_; output_width = input_width / block_size_; output_depth = input_depth * block_size_ * block_size_; kernel_name = "space_to_depth"; - kernel_width = input_width; } const index_t input_depth_blocks = RoundUpDiv4(input_depth); const index_t output_depth_blocks = RoundUpDiv4(output_depth); diff --git a/mace/kernels/opencl/eltwise_opencl.cc b/mace/kernels/opencl/eltwise_opencl.cc index fd3766c7acaa2e012e3493205a41c3edd6c6fa11..548d907de08ba8d25c884a5098f4da8b82db70ee 100644 --- a/mace/kernels/opencl/eltwise_opencl.cc +++ b/mace/kernels/opencl/eltwise_opencl.cc @@ -22,7 +22,7 @@ void EltwiseFunctor::operator()(const Tensor *input0, const index_t channel_blocks = RoundUpDiv4(channels); const index_t width_pixels = channel_blocks * width; - const index_t batch_height_pixels = batch * height; + const index_t batch_height_pixels = batch * height; if (kernel_.get() == nullptr) { auto runtime = OpenCLRuntime::Global();