/home/runner/work/kynema-sgf/kynema-sgf/src/core/gpu_utils.H Source File

Kynema-SGF API: /home/runner/work/kynema-sgf/kynema-sgf/src/core/gpu_utils.H Source File
Kynema-SGF API v0.1.0
CFD solver for wind plant simulations
Loading...
Searching...
No Matches
gpu_utils.H
Go to the documentation of this file.
1#ifndef GPU_UTILS_H
2#define GPU_UTILS_H
3
4#include "AMReX_Gpu.H"
5
6namespace kynema_sgf::gpu {
7
8template <typename T>
9amrex::Gpu::DeviceVector<T> device_view(const amrex::Vector<T>& hview)
10{
11 amrex::Gpu::DeviceVector<T> dview(hview.size());
12 amrex::Gpu::copy(
13 amrex::Gpu::hostToDevice, hview.begin(), hview.end(), dview.begin());
14 return dview;
15}
16
17} // namespace kynema_sgf::gpu
18
19#endif /* GPU_UTILS_H */
Definition gpu_utils.H:6
amrex::Gpu::DeviceVector< T > device_view(const amrex::Vector< T > &hview)
Definition gpu_utils.H:9