24#ifndef MORPHEUS_CSR_KERNELS_MATRIXOPERATIONS_IMPL_HPP
25#define MORPHEUS_CSR_KERNELS_MATRIXOPERATIONS_IMPL_HPP
27#include <Morpheus_Macros.hpp>
28#if defined(MORPHEUS_ENABLE_CUDA) || defined(MORPHEUS_ENABLE_HIP)
34template <
typename ValueType,
typename IndexType,
typename SizeType>
35__global__
void update_csr_diagonal_kernel(
const SizeType nrows,
37 const IndexType* Aj, ValueType* Ax,
38 const ValueType* diagonal) {
39 const SizeType thread_id = blockDim.x * blockIdx.x + threadIdx.x;
40 const SizeType grid_size = gridDim.x * blockDim.x;
42 for (SizeType row = thread_id; row < nrows; row += grid_size) {
43 const IndexType row_start = Ap[row];
44 const IndexType row_end = Ap[row + 1];
46 for (IndexType jj = row_start; jj < row_end; jj++) {
48 Ax[jj] = diagonal[row];
Generic Morpheus interfaces.
Definition: dummy.cpp:24