提交 e15b19ef 编写于 作者: U Unknown 提交者: liutuo

cpplint check

上级 6e1b70a3
......@@ -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<T>();
const T *input1_ptr = input1->data<T>();
......@@ -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<T>(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<T>(input0_ptr[i], input1_ptr[i]);
......
......@@ -21,7 +21,6 @@ void DepthToSpaceOpFunctor<DeviceType::OPENCL, T>::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<DeviceType::OPENCL, T>::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);
......
......@@ -22,7 +22,7 @@ void EltwiseFunctor<DeviceType::OPENCL, T>::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();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册