Commit 17a269a4 authored by Shucai Xiao's avatar Shucai Xiao
Browse files

clang format

parent 63773ec0
...@@ -13,8 +13,7 @@ namespace gpu { ...@@ -13,8 +13,7 @@ namespace gpu {
namespace device { namespace device {
template <class T> template <class T>
__device__ void __device__ void reduce_max(T* data_ptr, size_t block_size, size_t thr_idx, size_t item_num)
reduce_max(T* data_ptr, size_t block_size, size_t thr_idx, size_t item_num)
{ {
auto stride = (item_num + 1) / 2; auto stride = (item_num + 1) / 2;
while(true) while(true)
...@@ -42,8 +41,7 @@ reduce_max(T* data_ptr, size_t block_size, size_t thr_idx, size_t item_num) ...@@ -42,8 +41,7 @@ reduce_max(T* data_ptr, size_t block_size, size_t thr_idx, size_t item_num)
} }
template <class T> template <class T>
__device__ void __device__ void reduce_sum(T* data_ptr, size_t block_size, size_t thr_idx, size_t item_num)
reduce_sum(T* data_ptr, size_t block_size, size_t thr_idx, size_t item_num)
{ {
auto stride = (item_num + 1) / 2; auto stride = (item_num + 1) / 2;
while(true) while(true)
...@@ -130,8 +128,7 @@ void softmax(hipStream_t stream, const argument& result, const argument& arg, in ...@@ -130,8 +128,7 @@ void softmax(hipStream_t stream, const argument& result, const argument& arg, in
if(i < batch_item_num) if(i < batch_item_num)
{ {
data_idx[axis] = i; data_idx[axis] = i;
lds_data[thr_idx] = lds_data[thr_idx] = input_ptr[desc_data.linear(data_idx)] - batch_max;
input_ptr[desc_data.linear(data_idx)] - batch_max;
lds_data[thr_idx] = ::exp(to_hip_type(lds_data[thr_idx])); lds_data[thr_idx] = ::exp(to_hip_type(lds_data[thr_idx]));
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment