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 Feb 18, 2025
1 parent e37369b commit 58cf7e9
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions dpcpp/matrix/dense_kernels.dp.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: 2017 - 2024 The Ginkgo authors
// SPDX-FileCopyrightText: 2017 - 2025 The Ginkgo authors
//
// SPDX-License-Identifier: BSD-3-Clause

Expand Down 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_size()[1] > 0 && 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_size()[1] > 0 && 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 58cf7e9

Please sign in to comment.