Skip to content
This repository was archived by the owner on Jan 13, 2025. It is now read-only.

Commit

Permalink
Workarround to gemm interleaved with half type on Adaptivecpp
Browse files Browse the repository at this point in the history
  • Loading branch information
OuadiElfarouki committed Feb 27, 2024
1 parent f42fcd0 commit 8b4f189
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/operations/blas3/gemm_interleaved.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -493,9 +493,21 @@ class Gemm<input_t, output_t, /* DoubleBuffer = */ false, /* NbcA = */ false,
for (int j = 0; j < item_rows; ++j) {
#pragma unroll
for (int b = 0; b < item_batchs / VectorSize; ++b) {
#ifdef __ADAPTIVECPP__
if constexpr (is_half<element_t>::value) {
*reg_res = reg_a[j * (item_batchs / VectorSize) + b] *
reg_b[i * (item_batchs / VectorSize) + b] +
*reg_res;
} else {
*reg_res = cl::sycl::mad(reg_a[j * (item_batchs / VectorSize) + b],
reg_b[i * (item_batchs / VectorSize) + b],
*reg_res);
}
#else
*reg_res = cl::sycl::mad(reg_a[j * (item_batchs / VectorSize) + b],
reg_b[i * (item_batchs / VectorSize) + b],
*reg_res);
#endif
++reg_res;
}
}
Expand Down

0 comments on commit 8b4f189

Please sign in to comment.