From df2d1769fd530fa3a57b92e50819d341768a7e80 Mon Sep 17 00:00:00 2001 From: qijun Date: Sat, 14 Oct 2017 16:21:26 -0700 Subject: [PATCH] fix code style --- paddle/framework/lod_tensor.h | 3 +++ paddle/framework/type_defs.h | 3 +++ paddle/operators/math/math_function.cu | 16 +++++++--------- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/paddle/framework/lod_tensor.h b/paddle/framework/lod_tensor.h index ee040a9144e..4db36ee7660 100644 --- a/paddle/framework/lod_tensor.h +++ b/paddle/framework/lod_tensor.h @@ -1,8 +1,11 @@ /* Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserve. + Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/paddle/framework/type_defs.h b/paddle/framework/type_defs.h index 0c0a72de31a..0d1564a7510 100644 --- a/paddle/framework/type_defs.h +++ b/paddle/framework/type_defs.h @@ -1,8 +1,11 @@ /* Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserve. + Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/paddle/operators/math/math_function.cu b/paddle/operators/math/math_function.cu index d31b223b2c8..fc16d1b0a7a 100644 --- a/paddle/operators/math/math_function.cu +++ b/paddle/operators/math/math_function.cu @@ -214,10 +214,8 @@ template struct SelectedRowsAdd; namespace { template __global__ void SelectedRowsAddTensorKernel(const T* selected_rows, - const int64_t* rows, - T* tensor_out, - int64_t row_numel, - int block_size) { + const int64_t* rows, T* tensor_out, + int64_t row_numel, int block_size) { const int ty = blockIdx.y; int tid = threadIdx.x; @@ -261,11 +259,11 @@ struct SelectedRowsAddTensor { int block_size = 256; dim3 threads(block_size, 1); dim3 grid(1, in1_height); - SelectedRowsAddTensorKernel<<< - grid, threads, 0, - reinterpret_cast(context).stream() - >>>(in1_data, in1_rows.data(), - out_data, in1_row_numel, block_size); + SelectedRowsAddTensorKernel< + T><<(context) + .stream()>>>(in1_data, in1_rows.data(), out_data, + in1_row_numel, block_size); auto out_eigen = framework::EigenVector::Flatten(*output); auto in2_eigen = framework::EigenVector::Flatten(input2); -- GitLab