Skip to content

Commit

Permalink
magma: fix linker errors for builds without cusolver (kokkos#2181)
Browse files Browse the repository at this point in the history
* magma: fix linker errors for builds without cusolver

* BatchedGemm test: workaround testing cublas+magma

- temporary workaround to skip magma test when cublas enabled to avoid issues like kokkos#2177
  • Loading branch information
ndellingwood authored and lucbv committed May 8, 2024
1 parent 37e2809 commit 40df8bc
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 2 deletions.
6 changes: 5 additions & 1 deletion batched/dense/unit_test/Test_Batched_BatchedGemm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,11 @@ void impl_test_batched_gemm(const int N, const int matAdim1, const int matAdim2,
ASSERT_EQ(batchedGemmHandleCublas.vecLen, 0);
#endif

#if defined(KOKKOSKERNELS_ENABLE_TPL_MAGMA)
// FIXME temporary workaround to run this magma test only if cublas is not
// enabled the design of the BatchedGemmHandle currently does not allow
// simultanous testing in this way. See issue #2177
#if defined(KOKKOSKERNELS_ENABLE_TPL_MAGMA) && \
!defined(KOKKOSKERNELS_ENABLE_TPL_CUBLAS)
magma_queue_t magma_queue;
BatchedGemmHandle batchedGemmHandleMagma(magma_queue, GemmTplAlgos::MAGMA,
0, 0);
Expand Down
6 changes: 6 additions & 0 deletions lapack/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ IF (KOKKOSKERNELS_ENABLE_TPL_CUSOLVER)
)
ENDIF()

IF (KOKKOSKERNELS_ENABLE_TPL_MAGMA)
LIST(APPEND SOURCES
lapack/tpls/KokkosLapack_Magma_tpl.cpp
)
ENDIF()

##################
# #
# ETI generation #
Expand Down
1 change: 0 additions & 1 deletion lapack/tpls/KokkosLapack_Cuda_tpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,3 @@
#include <Kokkos_Core.hpp>
#include <KokkosKernels_config.h>
#include <KokkosLapack_Cuda_tpl.hpp>
#include <KokkosLapack_Magma_tpl.hpp>
18 changes: 18 additions & 0 deletions lapack/tpls/KokkosLapack_Magma_tpl.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//@HEADER
// ************************************************************************
//
// Kokkos v. 4.0
// Copyright (2022) National Technology & Engineering
// Solutions of Sandia, LLC (NTESS).
//
// Under the terms of Contract DE-NA0003525 with NTESS,
// the U.S. Government retains certain rights in this software.
//
// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions.
// See https://kokkos.org/LICENSE for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//@HEADER
#include <Kokkos_Core.hpp>
#include <KokkosKernels_config.h>
#include <KokkosLapack_Magma_tpl.hpp>

0 comments on commit 40df8bc

Please sign in to comment.