Skip to content

Commit

Permalink
[Bugfix] Add cast swapping for swapped gemm inputs. (#2443)
Browse files Browse the repository at this point in the history
* add swapping for cast types when swapping A+B for gemm
  • Loading branch information
cderb authored Oct 9, 2023
1 parent 6f5cb68 commit 8c4239d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/gemm_v2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,7 @@ miopenStatus_t CallGemm(const Handle& handle,
gemm_desc.isColMajor = !gemm_desc.isColMajor;
std::swap(A, B);
std::swap(a_offset, b_offset);
std::swap(gemm_desc.a_cast_type, gemm_desc.b_cast_type);
std::swap(gemm_desc.transA, gemm_desc.transB);
std::swap(gemm_desc.m, gemm_desc.n);
std::swap(gemm_desc.lda, gemm_desc.ldb);
Expand Down Expand Up @@ -665,6 +666,7 @@ miopenStatus_t CallGemmStridedBatched(const Handle& handle,
gemm_desc.isColMajor = !gemm_desc.isColMajor;
std::swap(A, B);
std::swap(a_offset, b_offset);
std::swap(gemm_desc.a_cast_type, gemm_desc.b_cast_type);
std::swap(gemm_desc.transA, gemm_desc.transB);
std::swap(gemm_desc.m, gemm_desc.n);
std::swap(gemm_desc.lda, gemm_desc.ldb);
Expand Down Expand Up @@ -938,6 +940,7 @@ miopenStatus_t CallGemmStridedBatchedSequential(const Handle& handle,
gemm_desc.isColMajor = !gemm_desc.isColMajor;
std::swap(A, B);
std::swap(a_offset, b_offset);
std::swap(gemm_desc.a_cast_type, gemm_desc.b_cast_type);
std::swap(gemm_desc.transA, gemm_desc.transB);
std::swap(gemm_desc.m, gemm_desc.n);
std::swap(gemm_desc.lda, gemm_desc.ldb);
Expand Down

0 comments on commit 8c4239d

Please sign in to comment.