Morpheus 1.0.0
Dynamic matrix type and algorithms for sparse matrices
Loading...
Searching...
No Matches
DenseVector/Kernels/Morpheus_Copy_Impl.hpp
1
24#ifndef MORPHEUS_DENSEVECTOR_KERNELS_COPY_IMPL_HPP
25#define MORPHEUS_DENSEVECTOR_KERNELS_COPY_IMPL_HPP
26
27#if defined(MORPHEUS_ENABLE_HIP)
28#include <impl/Morpheus_HIPUtils.hpp>
29#elif defined(MORPHEUS_ENABLE_CUDA)
30#include <impl/Morpheus_CudaUtils.hpp>
31#endif
32
33namespace Morpheus {
34namespace Impl {
35namespace Kernels {
36
37template <typename ValueType, typename IndexType, typename SizeType>
38__global__ void copy_by_key_kernel(SizeType n, const IndexType* keys,
39 const ValueType* src, ValueType* dst) {
40 const SizeType tid = blockDim.x * blockIdx.x + threadIdx.x;
41 if (tid > n) return;
42
43 dst[tid] = src[keys[tid]];
44}
45
46} // namespace Kernels
47} // namespace Impl
48} // namespace Morpheus
49
50#endif // MORPHEUS_DENSEVECTOR_KERNELS_COPY_IMPL_HPP
Generic Morpheus interfaces.
Definition: dummy.cpp:24