1 #ifndef GRADIENT_MATRICES_HPP
2 #define GRADIENT_MATRICES_HPP
7 extern "C" void get_grad_mat_data(
int ind,
int* m,
int* n,
int* w,
int* nnz,
int* is_csr_int,
int** csr_ridx_or_eindex,
int** csr_cidx_or_nelement,
double** values);
18 int m, n, w, nnz, is_csr_int;
19 int* csr_ridx_or_eindex;
20 int* csr_cidx_or_nelement;
25 get_grad_mat_data(X, &m, &n, &w, &nnz, &is_csr_int, &csr_ridx_or_eindex, &csr_cidx_or_nelement, &values);
26 gradx =
Matrix<Device>(m, n, w, nnz, (is_csr_int==1), csr_ridx_or_eindex, csr_cidx_or_nelement, values);
29 get_grad_mat_data(Y, &m, &n, &w, &nnz, &is_csr_int, &csr_ridx_or_eindex, &csr_cidx_or_nelement, &values);
30 grady =
Matrix<Device>(m, n, w, nnz, (is_csr_int==1), csr_ridx_or_eindex, csr_cidx_or_nelement, values);
47 void grid_deriv(
const Grid<Device>& grid,
const Kokkos::View<double*,Kokkos::LayoutRight,Device>& qty,
const Kokkos::View<double*,Kokkos::LayoutRight,Device>& qty_deriv_x,
const Kokkos::View<double*,Kokkos::LayoutRight,Device>& qty_deriv_y,
bool discard_when_basis_is_one)
const{
49 gradx.mult(qty, qty_deriv_x);
50 grady.mult(qty, qty_deriv_y);
53 if (discard_when_basis_is_one){
55 if ( grid.
basis(i)==0 ){
Definition: gradient_matrices.hpp:10
void get_grad_mat_data(int ind, int *m, int *n, int *w, int *nnz, int *is_csr_int, int **csr_ridx_or_eindex, int **csr_cidx_or_nelement, double **values)
Kokkos::View< int *, Kokkos::LayoutRight, Device > basis
A basis for the guesses?
Definition: grid.hpp:91
Definition: matrix.hpp:11
void grid_deriv(const Grid< Device > &grid, const Kokkos::View< double *, Kokkos::LayoutRight, Device > &qty, const Kokkos::View< double *, Kokkos::LayoutRight, Device > &qty_deriv_x, const Kokkos::View< double *, Kokkos::LayoutRight, Device > &qty_deriv_y, bool discard_when_basis_is_one) const
Definition: gradient_matrices.hpp:47
Matrix< Device > grady
Definition: gradient_matrices.hpp:12
void parallel_for(const std::string name, int n_ptl, Function func, Option option, HostAoSoA aosoa_h, DeviceAoSoA aosoa_d)
Definition: streamed_parallel_for.hpp:252
Matrix< Device > gradx
Definition: gradient_matrices.hpp:11
int nnode
Number of grid nodes.
Definition: grid.hpp:83
GradientMatrices()
Definition: gradient_matrices.hpp:17