spla
Loading...
Searching...
No Matches
cl_formats.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_CL_FORMATS_HPP
29#define SPLA_CL_FORMATS_HPP
30
31#include <spla/config.hpp>
32
33#include <core/tdecoration.hpp>
34#include <util/pair_hash.hpp>
35
37
38#include <algorithm>
39#include <cassert>
40#include <functional>
41#include <numeric>
42#include <string>
43#include <unordered_map>
44#include <utility>
45#include <vector>
46
47namespace spla {
48
60 template<typename T>
61 class CLDenseVec : public TDecoration<T> {
62 public:
64
65 ~CLDenseVec() override = default;
66
67 cl::Buffer Ax;
68 };
69
76 template<typename T>
77 class CLCooVec : public TDecoration<T> {
78 public:
80
81 ~CLCooVec() override = default;
82
83 cl::Buffer Ai;
84 cl::Buffer Ax;
85 };
86
93 template<typename T>
94 class CLCsr : public TDecoration<T> {
95 public:
97
98 ~CLCsr() override = default;
99
100 cl::Buffer Ap;
101 cl::Buffer Aj;
102 cl::Buffer Ax;
103 };
104
105
110}// namespace spla
111
112#endif//SPLA_CL_FORMATS_HPP
Named storage format for library matrix data objects.
Named storage format for library vector data objects.
OpenCL list-of-coordinates sparse vector representation.
Definition cl_formats.hpp:77
cl::Buffer Ax
Definition cl_formats.hpp:84
cl::Buffer Ai
Definition cl_formats.hpp:83
~CLCooVec() override=default
static constexpr FormatVector FORMAT
Definition cl_formats.hpp:79
OpenCL compressed sparse row matrix representation.
Definition cl_formats.hpp:94
cl::Buffer Ax
Definition cl_formats.hpp:102
static constexpr FormatMatrix FORMAT
Definition cl_formats.hpp:96
~CLCsr() override=default
cl::Buffer Ap
Definition cl_formats.hpp:100
cl::Buffer Aj
Definition cl_formats.hpp:101
OpenCL one-dim array for dense vector representation.
Definition cl_formats.hpp:61
static constexpr FormatVector FORMAT
Definition cl_formats.hpp:63
~CLDenseVec() override=default
cl::Buffer Ax
Definition cl_formats.hpp:67
Base class for typed decoration for storage object.
Definition tdecoration.hpp:50
Definition algorithm.hpp:37