Loading...
Searching...
No Matches
CutlassGemm.h
Go to the documentation of this file.
1// SPDX-License-Identifier: MIT
2// Copyright (c) gpridge developers
3// See LICENSE for details.
4
14
15#ifndef GPR_LINALG_CUTLASS_GEMM_H_
16#define GPR_LINALG_CUTLASS_GEMM_H_
17
18#include <stdexcept>
19#include <string>
20
22
23namespace gpr {
24namespace linalg {
25namespace cutlass {
26
27#ifdef GPR_HAVE_CUTLASS
28
29[[nodiscard]] bool compiled() noexcept;
30[[nodiscard]] bool available() noexcept;
31[[nodiscard]] bool availableForLocalRank(int local_rank,
32 int local_nprocs) noexcept;
33[[nodiscard]] EigenMatrix gemm_nn(const EigenMatrix& A, const EigenMatrix& B);
34void setPluginPath(std::string path);
35
36#else
37
38[[nodiscard]] inline bool compiled() noexcept
39{
40 return false;
41}
42
43[[nodiscard]] inline bool available() noexcept
44{
45 return false;
46}
47
48inline void setPluginPath(std::string path)
49{
50 (void)path;
51}
52
53[[nodiscard]] inline bool availableForLocalRank(int local_rank,
54 int local_nprocs) noexcept
55{
56 (void)local_rank;
57 (void)local_nprocs;
58 return false;
59}
60
61[[nodiscard]] inline EigenMatrix gemm_nn(const EigenMatrix& A,
62 const EigenMatrix& B)
63{
64 (void)A;
65 (void)B;
66 throw std::logic_error(
67 "CUTLASS GEMM requested in a build without GPR_HAVE_CUTLASS");
68}
69
70#endif
71
72} // namespace cutlass
73} // namespace linalg
74} // namespace gpr
75
76#endif // GPR_LINALG_CUTLASS_GEMM_H_
bool available() noexcept
Definition CutlassGemm.h:43
bool availableForLocalRank(int local_rank, int local_nprocs) noexcept
Definition CutlassGemm.h:53
EigenMatrix gemm_nn(const EigenMatrix &A, const EigenMatrix &B)
Definition CutlassGemm.h:61
bool compiled() noexcept
Definition CutlassGemm.h:38
void setPluginPath(std::string path)
Definition CutlassGemm.h:48
Dense and structured linear algebra behind the GP: Cholesky and eigen solvers, linear operators,...
Gaussian-process regression, kernels, priors, and the searches that run on the surrogate.
Definition Macros.h:16
Eigen::Matrix< double, EigenDynamic, EigenDynamic, EigenMatrixStorage > EigenMatrix
Definition Macros.h:20