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

Kynema API: /home/runner/work/kynema/kynema/kynema/src/solver/linear_solver/dss_handle_cudss.hpp Source File
Kynema API
A flexible multibody structural dynamics code for wind turbines
Loading...
Searching...
No Matches
dss_handle_cudss.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <cudss.h>
4
5#include "dss_algorithm.hpp"
6
7namespace kynema::dss {
8template <>
10 struct cudssDssHandleType {
11 cudssHandle_t handle;
12 cudssConfig_t solverConfig;
13 cudssData_t solverData;
14 bool is_first_factorization;
15
16 cudssDssHandleType() : is_first_factorization{true} {
17 cudssCreate(&handle);
18 cudssConfigCreate(&solverConfig);
19 auto flag = CUDSS_ALG_1;
20 cudssConfigSet(solverConfig, CUDSS_CONFIG_REORDERING_ALG, &flag, sizeof(flag));
21 cudssDataCreate(handle, &solverData);
22 }
23
24 ~cudssDssHandleType() {
25 cudssDataDestroy(handle, solverData);
26 cudssConfigDestroy(solverConfig);
27 cudssDestroy(handle);
28 }
29 };
30 std::shared_ptr<cudssDssHandleType> cudss_dss_handle;
31
32public:
33 Handle() : cudss_dss_handle(std::make_shared<cudssDssHandleType>()) {}
34
35 cudssHandle_t& get_handle() { return cudss_dss_handle->handle; }
36
37 cudssConfig_t& get_config() { return cudss_dss_handle->solverConfig; }
38
39 cudssData_t& get_data() { return cudss_dss_handle->solverData; }
40
41 void set_initial_factorization(bool value) { cudss_dss_handle->is_first_factorization = value; }
42
43 bool is_initial_factorization() const { return cudss_dss_handle->is_first_factorization; }
44};
45
46} // namespace kynema::dss
bool is_initial_factorization() const
Definition dss_handle_cudss.hpp:43
cudssHandle_t & get_handle()
Definition dss_handle_cudss.hpp:35
Handle()
Definition dss_handle_cudss.hpp:33
cudssData_t & get_data()
Definition dss_handle_cudss.hpp:39
void set_initial_factorization(bool value)
Definition dss_handle_cudss.hpp:41
cudssConfig_t & get_config()
Definition dss_handle_cudss.hpp:37
Definition dss_handle.hpp:10
Definition dss_algorithm.hpp:4
Algorithm
Definition dss_algorithm.hpp:6