spla
Loading...
Searching...
No Matches
config.hpp
Go to the documentation of this file.
1/**********************************************************************************/
2/* This file is part of spla project */
3/* https://github.com/SparseLinearAlgebra/spla */
4/**********************************************************************************/
5/* MIT License */
6/* */
7/* Copyright (c) 2023 SparseLinearAlgebra */
8/* */
9/* Permission is hereby granted, free of charge, to any person obtaining a copy */
10/* of this software and associated documentation files (the "Software"), to deal */
11/* in the Software without restriction, including without limitation the rights */
12/* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell */
13/* copies of the Software, and to permit persons to whom the Software is */
14/* furnished to do so, subject to the following conditions: */
15/* */
16/* The above copyright notice and this permission notice shall be included in all */
17/* copies or substantial portions of the Software. */
18/* */
19/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR */
20/* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, */
21/* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE */
22/* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER */
23/* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, */
24/* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE */
25/* SOFTWARE. */
26/**********************************************************************************/
27
28#ifndef SPLA_CONFIG_HPP
29#define SPLA_CONFIG_HPP
30
31#include <cinttypes>
32#include <cstddef>
33#include <functional>
34#include <string>
35
36#ifdef SPLA_MSVC
37 #ifdef SPLA_EXPORTS
38 #define SPLA_API __declspec(dllexport)
39 #else
40 #define SPLA_API __declspec(dllimport)
41 #endif
42#else
43 #define SPLA_API
44#endif
45
46namespace spla {
47
56 using uint = std::uint32_t;
57
62 enum class Status : uint {
64 Ok = 0,
66 Error = 1,
74 InvalidState = 5,
78 NoValue = 7,
82 NotImplemented = 1024
83 };
84
89 enum class AcceleratorType : uint {
91 None = 0,
93 OpenCL = 1
94 };
95
102 enum class FormatMatrix : uint {
104 CpuLil = 0,
106 CpuDok = 1,
108 CpuCoo = 2,
110 CpuCsr = 3,
112 CpuCsc = 4,
114 AccCoo = 5,
116 AccCsr = 6,
118 AccCsc = 7,
120 Count = 8
121 };
122
129 enum class FormatVector : uint {
131 CpuDok = 0,
133 CpuDense = 1,
135 CpuCoo = 2,
137 AccDense = 3,
139 AccCoo = 4,
141 Count = 5
142 };
143
154 using MessageCallback = std::function<void(Status status,
155 const std::string& msg,
156 const std::string& file,
157 const std::string& function,
158 int line)>;
159
168 using ScheduleCallback = std::function<void()>;
169
174}// namespace spla
175
176#endif//SPLA_CONFIG_HPP
Callback function called on library message event.
Callback function which can be scheduled in schedule.
Status of library operation execution.
CPU list of coordinates matrix format.
Definition cpu_formats.hpp:148
CPU compressed sparse row matrix format.
Definition cpu_formats.hpp:166
Dictionary of keys sparse matrix format.
Definition cpu_formats.hpp:128
CPU list-of-list matrix format for fast incremental build.
Definition cpu_formats.hpp:107
FormatMatrix
Definition config.hpp:102
FormatVector
Definition config.hpp:129
std::uint32_t uint
Library index and size type.
Definition config.hpp:56
Status
Definition config.hpp:62
AcceleratorType
Definition config.hpp:89
Definition algorithm.hpp:37