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

clang format

parent 63773ec0
......@@ -13,8 +13,7 @@ namespace gpu {
namespace device {
template <class T>
__device__ void
reduce_max(T* data_ptr, size_t block_size, size_t thr_idx, size_t item_num)
__device__ void reduce_max(T* data_ptr, size_t block_size, size_t thr_idx, size_t item_num)
{
auto stride = (item_num + 1) / 2;
while(true)
......@@ -42,8 +41,7 @@ reduce_max(T* data_ptr, size_t block_size, size_t thr_idx, size_t item_num)
}
template <class T>
__device__ void
reduce_sum(T* data_ptr, size_t block_size, size_t thr_idx, size_t item_num)
__device__ void reduce_sum(T* data_ptr, size_t block_size, size_t thr_idx, size_t item_num)
{
auto stride = (item_num + 1) / 2;
while(true)
......@@ -130,8 +128,7 @@ void softmax(hipStream_t stream, const argument& result, const argument& arg, in
if(i < batch_item_num)
{
data_idx[axis] = i;
lds_data[thr_idx] =
input_ptr[desc_data.linear(data_idx)] - batch_max;
lds_data[thr_idx] = input_ptr[desc_data.linear(data_idx)] - batch_max;
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