Skip to content

Commit

Permalink
assign a variable to avoid hip use too many VGPRs
Browse files Browse the repository at this point in the history
  • Loading branch information
yhmtsai committed Apr 15, 2020
1 parent f2d7f64 commit b2dd8fa
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions common/components/warp_blas.hpp.inc
Original file line number Diff line number Diff line change
Expand Up @@ -215,17 +215,16 @@ __device__ __forceinline__ void copy_matrix(
size_type stride)
{
GKO_ASSERT(problem_size <= max_problem_size);
#if !defined(__NVCC__)
#pragma unroll 1
#else
#pragma unroll
#endif // !defined(__NVCC__)
for (int32 i = 0; i < max_problem_size; ++i) {
if (i < problem_size) {
const auto idx = group.shfl(col_perm, i);
if (group.thread_rank() < problem_size) {
// Need to assign a variable for the source_row, or hip
// will use a lot of VGPRs in unroll. This might lead a problem.
const auto val = source_row[i * increment];
destination[get_row_major_index<mod>(idx, row_perm, stride)] =
static_cast<ResultValueType>(source_row[i * increment]);
static_cast<ResultValueType>(val);
}
}
}
Expand Down

0 comments on commit b2dd8fa

Please sign in to comment.