Skip to content

Commit

Permalink
only go through dense mkl::gemm when all data pointers are valid.
Browse files Browse the repository at this point in the history
  • Loading branch information
yhmtsai committed Dec 18, 2024
1 parent d7e1450 commit 59a1f12
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions dpcpp/matrix/dense_kernels.dp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,8 @@ void simple_apply(std::shared_ptr<const DefaultExecutor> exec,
using namespace oneapi::mkl;
if constexpr (onemkl::is_supported<ValueType>::value) {
if (b->get_stride() != 0 && c->get_stride() != 0) {
if (a->get_size()[1] > 0) {
if (a->get_const_values() && b->get_const_values() &&
c->get_const_values()) {
oneapi::mkl::blas::row_major::gemm(
*exec->get_queue(), transpose::nontrans,
transpose::nontrans, c->get_size()[0], c->get_size()[1],
Expand Down Expand Up @@ -253,7 +254,8 @@ void apply(std::shared_ptr<const DefaultExecutor> exec,
using namespace oneapi::mkl;
if constexpr (onemkl::is_supported<ValueType>::value) {
if (b->get_stride() != 0 && c->get_stride() != 0) {
if (a->get_size()[1] > 0) {
if (a->get_const_values() && b->get_const_values() &&
c->get_const_values()) {
oneapi::mkl::blas::row_major::gemm(
*exec->get_queue(), transpose::nontrans,
transpose::nontrans, c->get_size()[0], c->get_size()[1],
Expand Down

0 comments on commit 59a1f12

Please sign in to comment.