7#ifndef KERNEL_LAFEM_ARCH_UNIT_FILTER_HPP
8#define KERNEL_LAFEM_ARCH_UNIT_FILTER_HPP 1
12#include <kernel/backend.hpp>
23 template <
typename DT_,
typename IT_>
24 static void filter_rhs(DT_ * v,
const DT_ *
const sv_elements,
const IT_ *
const sv_indices,
const Index ue)
26 filter_rhs_generic(v, sv_elements, sv_indices, ue);
29 static void filter_rhs(
float * v,
const float *
const sv_elements,
const std::uint32_t *
const sv_indices,
const Index ue)
31 BACKEND_SKELETON_VOID(filter_rhs_cuda, filter_rhs_generic, filter_rhs_generic, v, sv_elements, sv_indices, ue)
34 static void filter_rhs(
double * v,
const double *
const sv_elements,
const std::uint32_t *
const sv_indices,
const Index ue)
36 BACKEND_SKELETON_VOID(filter_rhs_cuda, filter_rhs_generic, filter_rhs_generic, v, sv_elements, sv_indices, ue)
39 static void filter_rhs(
float * v,
const float *
const sv_elements,
const std::uint64_t *
const sv_indices,
const Index ue)
41 BACKEND_SKELETON_VOID(filter_rhs_cuda, filter_rhs_mkl, filter_rhs_generic, v, sv_elements, sv_indices, ue)
44 static void filter_rhs(
double * v,
const double *
const sv_elements,
const std::uint64_t *
const sv_indices,
const Index ue)
46 BACKEND_SKELETON_VOID(filter_rhs_cuda, filter_rhs_mkl, filter_rhs_generic, v, sv_elements, sv_indices, ue)
49 template <
typename DT_,
typename IT_>
50 static void filter_def(DT_ * v,
const IT_ *
const sv_indices,
const Index ue)
52 filter_def_generic(v, sv_indices, ue);
55 template <
typename IT_>
56 static void filter_def(
float * v,
const IT_ *
const sv_indices,
const Index ue)
58 BACKEND_SKELETON_VOID(filter_def_cuda, filter_def_generic, filter_def_generic, v, sv_indices, ue)
61 template <
typename IT_>
62 static void filter_def(
double * v,
const IT_ *
const sv_indices,
const Index ue)
64 BACKEND_SKELETON_VOID(filter_def_cuda, filter_def_generic, filter_def_generic, v, sv_indices, ue)
67 template<
typename DT_,
typename IT_>
68 static void filter_unit_mat(DT_* mat,
const IT_*
const row_ptr,
const IT_*
const col_idx,
const IT_ *
const sv_indices,
const Index ue)
70 filter_unit_mat_generic(mat, row_ptr, col_idx, sv_indices, ue);
73 template<
typename IT_>
74 static void filter_unit_mat(
double* mat,
const IT_*
const row_ptr,
const IT_*
const col_idx,
const IT_ *
const sv_indices,
const Index ue)
76 BACKEND_SKELETON_VOID(filter_unit_mat_cuda, filter_unit_mat_generic, filter_unit_mat_generic, mat, row_ptr, col_idx, sv_indices, ue)
79 template<
typename IT_>
80 static void filter_unit_mat(
float* mat,
const IT_*
const row_ptr,
const IT_*
const col_idx,
const IT_ *
const sv_indices,
const Index ue)
82 BACKEND_SKELETON_VOID(filter_unit_mat_cuda, filter_unit_mat_generic, filter_unit_mat_generic, mat, row_ptr, col_idx, sv_indices, ue)
85 template<
typename DT_,
typename IT_>
86 static void filter_offdiag_row_mat(DT_* mat,
const IT_*
const row_ptr,
int block_width,
const IT_ *
const sv_indices,
const Index ue)
88 filter_offdiag_row_mat_generic(mat, row_ptr, block_width, sv_indices, ue);
91 template<
typename IT_>
92 static void filter_offdiag_row_mat(
double* mat,
const IT_*
const row_ptr,
int block_width,
const IT_ *
const sv_indices,
const Index ue)
94 BACKEND_SKELETON_VOID(filter_offdiag_row_mat_cuda, filter_offdiag_row_mat_generic, filter_offdiag_row_mat_generic, mat, row_ptr, block_width, sv_indices, ue)
97 template<
typename IT_>
98 static void filter_offdiag_row_mat(
float* mat,
const IT_*
const row_ptr,
int block_width,
const IT_ *
const sv_indices,
const Index ue)
100 BACKEND_SKELETON_VOID(filter_offdiag_row_mat_cuda, filter_offdiag_row_mat_generic, filter_offdiag_row_mat_generic, mat, row_ptr, block_width, sv_indices, ue)
103 template<
typename DT_,
typename IT_>
104 static void filter_weak_matrix_rows(DT_* mat_a,
const DT_*
const mat_m,
const IT_*
const row_ptr,
const DT_ *
const sv_elements,
const IT_ *
const sv_indices,
const Index ue)
106 filter_weak_matrix_rows_generic(mat_a, mat_m, row_ptr, sv_elements, sv_indices, ue);
109 template<
typename IT_>
110 static void filter_weak_matrix_rows(
double* mat_a,
const double*
const mat_m,
const IT_*
const row_ptr,
const double *
const sv_elements,
const IT_ *
const sv_indices,
const Index ue)
112 BACKEND_SKELETON_VOID(filter_weak_matrix_rows_cuda, filter_weak_matrix_rows_generic, filter_weak_matrix_rows_generic, mat_a, mat_m, row_ptr, sv_elements, sv_indices, ue)
115 template<
typename IT_>
116 static void filter_weak_matrix_rows(
float* mat_a,
const float*
const mat_m,
const IT_*
const row_ptr,
const float *
const sv_elements,
const IT_ *
const sv_indices,
const Index ue)
118 BACKEND_SKELETON_VOID(filter_weak_matrix_rows_cuda, filter_weak_matrix_rows_generic, filter_weak_matrix_rows_generic, mat_a, mat_m, row_ptr, sv_elements, sv_indices, ue)
121 template <
typename DT_,
typename IT_>
122 static void filter_rhs_generic(DT_ * v,
const DT_ *
const sv_elements,
const IT_ *
const sv_indices,
const Index ue);
124 template <
typename DT_,
typename IT_>
125 static void filter_def_generic(DT_ * v,
const IT_ *
const sv_indices,
const Index ue);
127 static void filter_rhs_mkl(
float * v,
const float *
const sv_elements,
const std::uint64_t *
const sv_indices,
const Index ue);
128 static void filter_rhs_mkl(
double * v,
const double *
const sv_elements,
const std::uint64_t *
const sv_indices,
const Index ue);
130 template <
typename DT_,
typename IT_>
131 static void filter_rhs_cuda(DT_ * v,
const DT_ *
const sv_elements,
const IT_ *
const sv_indices,
const Index ue);
133 template <
typename DT_,
typename IT_>
134 static void filter_def_cuda(DT_ * v,
const IT_ *
const sv_indices,
const Index ue);
136 template<
typename DT_,
typename IT_>
137 static void filter_unit_mat_generic(DT_* mat,
const IT_*
const row_ptr,
const IT_*
const col_idx,
const IT_ *
const sv_indices,
const Index ue);
139 template<
typename DT_,
typename IT_>
140 static void filter_unit_mat_cuda(DT_* mat,
const IT_*
const row_ptr,
const IT_*
const col_idx,
const IT_ *
const sv_indices,
const Index ue);
142 template<
typename DT_,
typename IT_>
143 static void filter_offdiag_row_mat_generic(DT_* mat,
const IT_*
const row_ptr,
int block_width,
const IT_ *
const sv_indices,
const Index ue);
145 template<
typename DT_,
typename IT_>
146 static void filter_offdiag_row_mat_cuda(DT_* mat,
const IT_*
const row_ptr,
int block_width,
const IT_ *
const sv_indices,
const Index ue);
148 template<
typename DT_,
typename IT_>
149 static void filter_weak_matrix_rows_generic(DT_* mat_a,
const DT_*
const mat_m,
const IT_*
const row_ptr,
const DT_ *
const sv_elements,
const IT_ *
const sv_indices,
const Index ue);
151 template<
typename DT_,
typename IT_>
152 static void filter_weak_matrix_rows_cuda(DT_* mat_a,
const DT_*
const mat_m,
const IT_*
const row_ptr,
const DT_ *
const sv_elements,
const IT_ *
const sv_indices,
const Index ue);
156 extern template void UnitFilter::filter_rhs_generic(
float * v,
const float *
const sv_elements,
const std::uint64_t *
const sv_indices,
const Index ue);
157 extern template void UnitFilter::filter_rhs_generic(
double * v,
const double *
const sv_elements,
const std::uint64_t *
const sv_indices,
const Index ue);
158 extern template void UnitFilter::filter_rhs_generic(
float * v,
const float *
const sv_elements,
const std::uint32_t *
const sv_indices,
const Index ue);
159 extern template void UnitFilter::filter_rhs_generic(
double * v,
const double *
const sv_elements,
const std::uint32_t *
const sv_indices,
const Index ue);
161 extern template void UnitFilter::filter_def_generic(
float * v,
const std::uint64_t *
const sv_indices,
const Index ue);
162 extern template void UnitFilter::filter_def_generic(
double * v,
const std::uint64_t *
const sv_indices,
const Index ue);
163 extern template void UnitFilter::filter_def_generic(
float * v,
const std::uint32_t *
const sv_indices,
const Index ue);
164 extern template void UnitFilter::filter_def_generic(
double * v,
const std::uint32_t *
const sv_indices,
const Index ue);
172#include <kernel/lafem/arch/unit_filter_generic.hpp>
std::uint64_t Index
Index data type.