/home/runner/work/amr-wind/amr-wind/amr-wind/core/gpu_utils.H Source File

AMR-Wind API: /home/runner/work/amr-wind/amr-wind/amr-wind/core/gpu_utils.H Source File
AMR-Wind 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 amr_wind::gpu {
7
8template <typename T>
9inline amrex::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 amr_wind::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