Skip to content

Commit

Permalink
support hip
Browse files Browse the repository at this point in the history
  • Loading branch information
ZzSean committed Jan 5, 2022
1 parent 02215a5 commit e0b6286
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions paddle/fluid/operators/softmax_cudnn_op.cu.h
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,11 @@ static void GetGridDim(int high_dim, int mid_dim, int low_dim,
}

static void GetBlockDim(int mid_dim, int low_dim, dim3* block) {
#ifdef __HIPCC__
constexpr int max_num_threads = 256;
#else
constexpr int max_num_threads = 1024;
#endif
int block_x = 1 << log2_ceil(low_dim);
int block_y = 1 << log2_ceil(mid_dim);
block->x = std::min(block_x, 32);
Expand Down

0 comments on commit e0b6286

Please sign in to comment.