-
Notifications
You must be signed in to change notification settings - Fork 119
Expand file tree
/
Copy pathhybrid_kernels.hpp
More file actions
62 lines (41 loc) · 2.42 KB
/
Copy pathhybrid_kernels.hpp
File metadata and controls
62 lines (41 loc) · 2.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// SPDX-FileCopyrightText: 2017 - 2026 The Ginkgo authors
//
// SPDX-License-Identifier: BSD-3-Clause
#ifndef GKO_CORE_MATRIX_HYBRID_KERNELS_HPP_
#define GKO_CORE_MATRIX_HYBRID_KERNELS_HPP_
#include <ginkgo/core/matrix/csr.hpp>
#include <ginkgo/core/matrix/dense.hpp>
#include "core/base/kernel_declaration.hpp"
namespace gko {
namespace kernels {
#define GKO_DECLARE_HYBRID_COMPUTE_ROW_NNZ \
void compute_row_nnz(std::shared_ptr<const DefaultExecutor> exec, \
const array<int64>& row_ptrs, size_type* row_nnzs)
#define GKO_DECLARE_HYBRID_COMPUTE_COO_ROW_PTRS_KERNEL \
void compute_coo_row_ptrs(std::shared_ptr<const DefaultExecutor> exec, \
const array<size_type>& row_nnz, \
size_type ell_lim, int64* coo_row_ptrs)
#define GKO_DECLARE_HYBRID_FILL_IN_MATRIX_DATA_KERNEL(ValueType, IndexType) \
void fill_in_matrix_data( \
std::shared_ptr<const DefaultExecutor> exec, \
const device_matrix_data<ValueType, IndexType>& data, \
const int64* row_ptrs, const int64* coo_row_ptrs, \
matrix::view::hybrid<ValueType, IndexType> result)
#define GKO_DECLARE_HYBRID_CONVERT_TO_CSR_KERNEL(ValueType, IndexType) \
void convert_to_csr( \
std::shared_ptr<const DefaultExecutor> exec, \
matrix::view::hybrid<const ValueType, const IndexType> source, \
const IndexType* ell_row_ptrs, const IndexType* coo_row_ptrs, \
matrix::Csr<ValueType, IndexType>* result)
#define GKO_DECLARE_ALL_AS_TEMPLATES \
GKO_DECLARE_HYBRID_COMPUTE_ROW_NNZ; \
GKO_DECLARE_HYBRID_COMPUTE_COO_ROW_PTRS_KERNEL; \
template <typename ValueType, typename IndexType> \
GKO_DECLARE_HYBRID_FILL_IN_MATRIX_DATA_KERNEL(ValueType, IndexType); \
template <typename ValueType, typename IndexType> \
GKO_DECLARE_HYBRID_CONVERT_TO_CSR_KERNEL(ValueType, IndexType)
GKO_DECLARE_FOR_ALL_EXECUTOR_NAMESPACES(hybrid, GKO_DECLARE_ALL_AS_TEMPLATES);
#undef GKO_DECLARE_ALL_AS_TEMPLATES
} // namespace kernels
} // namespace gko
#endif // GKO_CORE_MATRIX_HYBRID_KERNELS_HPP_