/home/runner/work/kynema/kynema/kynema/src/solver/linear_solver/dss_symbolic_mkl.hpp Source File

Kynema API: /home/runner/work/kynema/kynema/kynema/src/solver/linear_solver/dss_symbolic_mkl.hpp Source File
Kynema API
A flexible multibody structural dynamics code for wind turbines
Loading...
Searching...
No Matches
dss_symbolic_mkl.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <Kokkos_Core.hpp>
4#include <mkl_dss.h>
5
6#include "dss_algorithm.hpp"
7#include "dss_handle_mkl.hpp"
8
9namespace kynema::dss {
10template <typename CrsMatrixType>
11struct SymbolicFunction<Handle<Algorithm::MKL>, CrsMatrixType> {
12 static void symbolic(Handle<Algorithm::MKL>& dss_handle, CrsMatrixType& A) {
13 auto& handle = dss_handle.get_handle();
14 constexpr MKL_INT opt = MKL_DSS_NON_SYMMETRIC;
15
16 const MKL_INT num_rows = A.numRows();
17 const MKL_INT num_cols = A.numCols();
18 const MKL_INT num_non_zeros = A.nnz();
19
20 auto row_ptrs = Kokkos::create_mirror_view_and_copy(Kokkos::HostSpace(), A.graph.row_map);
21 auto col_inds = Kokkos::create_mirror_view_and_copy(Kokkos::HostSpace(), A.graph.entries);
22
23 dss_define_structure(
24 handle, opt, row_ptrs.data(), num_rows, num_cols, col_inds.data(), num_non_zeros
25 );
26
27 auto& perm = dss_handle.get_perm();
28 perm.resize(static_cast<size_t>(num_rows));
29 constexpr MKL_INT reorder_opt = MKL_DSS_AUTO_ORDER;
30 dss_reorder(handle, reorder_opt, perm.data());
31 }
32};
33} // namespace kynema::dss
Definition dss_handle.hpp:10
Definition dss_algorithm.hpp:4
Algorithm
Definition dss_algorithm.hpp:6
static void symbolic(Handle< Algorithm::MKL > &dss_handle, CrsMatrixType &A)
Definition dss_symbolic_mkl.hpp:12
Definition dss_symbolic.hpp:8