File Setup_GPU.h
FileList > src > Setup_GPU.h
Go to the source code of this file
#include "General.h"#include "Forcing.h"#include "Param.h"#include "Arrays.h"#include "MemManagement.h"#include "Halo.h"#include "InitialConditions.h"
Public Functions
| Type | Name |
|---|---|
| void | AllocateBndTEX (bndparam & side) Allocate boundary texture for GPU. |
| void | AllocateTEX (int nx, int ny, TexSetP & Tex, float * input) Allocate and bind a CUDA texture object. |
| void | CUDA_CHECK (cudaError CUDerr) Check CUDA error status and print message if error occurs. |
| void | CopyGPUtoCPU (int nblk, int blksize, T * z_cpu, T * z_gpu) Copy data from GPU to CPU memory. |
| void | CopytoGPU (int nblk, int blksize, Param XParam, Model< T > XModel_cpu, Model< T > XModel_gpu) Copy complex data structures from CPU to GPU. |
| void | CopytoGPU (int nblk, int blksize, T * z_cpu, T * z_gpu) Copy data from CPU to GPU memory. |
| void | CopytoGPU (int nblk, int blksize, EvolvingP< T > XEv_cpu, EvolvingP< T > XEv_gpu) Copy complex data structures from CPU to GPU. |
| void | CopytoGPU (int nblk, int blksize, EvolvingP_M< T > XEv_cpu, EvolvingP_M< T > XEv_gpu) Copy complex data structures from CPU to GPU. |
| void | CopytoGPU (int nblk, int blksize, GradientsP< T > XGrad_cpu, GradientsP< T > XGrad_gpu) Copy complex data structures from CPU to GPU. |
| void | SetupGPU (Param & XParam, Model< T > XModel, Forcing< float > & XForcing, Model< T > & XModel_g) Setup and initialize GPU for simulation. |
Public Functions Documentation
function AllocateBndTEX
Allocate boundary texture for GPU.
Allocates and binds boundary water level data as a CUDA texture for GPU use.
Parameters:
sideBoundary parameter structure
function AllocateTEX
Allocate and bind a CUDA texture object.
Allocates a CUDA array and creates a texture object for use in GPU kernels.
Parameters:
nxNumber of x grid pointsnyNumber of y grid pointsTexTexture set structureinputInput data array
function CUDA_CHECK
Check CUDA error status and print message if error occurs.
Checks the CUDA error code and prints an error message if the code indicates failure.
Parameters:
CUDerrCUDA error code
function CopyGPUtoCPU
Copy data from GPU to CPU memory.
Copies an array from device (GPU) memory to host (CPU) memory using CUDA.
Template parameters:
TData type
Parameters:
nblkNumber of blocksblksizeBlock sizez_cpuDestination array (CPU)z_gpuSource array (GPU)
function CopytoGPU
Copy complex data structures from CPU to GPU.
template<class T>
void CopytoGPU (
int nblk,
int blksize,
Param XParam,
Model < T > XModel_cpu,
Model < T > XModel_gpu
)
This function copies the entire model structure from the host (CPU) to the device (GPU) memory.
Template parameters:
TData type
Parameters:
nblkNumber of blocksblksizeBlock sizeXParamSimulation parametersXModel_cpuSource model structure (CPU)XModel_gpuDestination model structure (GPU)
function CopytoGPU
Copy data from CPU to GPU memory.
Copies an array from host (CPU) memory to device (GPU) memory using CUDA.
Template parameters:
TData type
Parameters:
nblkNumber of blocksblksizeBlock sizez_cpuSource array (CPU)z_gpuDestination array (GPU)
function CopytoGPU
Copy complex data structures from CPU to GPU.
template<class T>
void CopytoGPU (
int nblk,
int blksize,
EvolvingP < T > XEv_cpu,
EvolvingP < T > XEv_gpu
)
This function copies the evolving variables structure from the host (CPU) to the device (GPU) memory.
Template parameters:
TData type
Parameters:
nblkNumber of blocksblksizeBlock sizeXEv_cpuSource evolving variables structure (CPU)XEv_gpuDestination evolving variables structure (GPU)
function CopytoGPU
Copy complex data structures from CPU to GPU.
template<class T>
void CopytoGPU (
int nblk,
int blksize,
EvolvingP_M < T > XEv_cpu,
EvolvingP_M < T > XEv_gpu
)
This function copies the evolving variables with momentum structure from the host (CPU) to the device (GPU) memory.
Template parameters:
TData type
Parameters:
nblkNumber of blocksblksizeBlock sizeXEv_cpuSource evolving variables with momentum structure (CPU)XEv_gpuDestination evolving variables with momentum structure (GPU)
function CopytoGPU
Copy complex data structures from CPU to GPU.
template<class T>
void CopytoGPU (
int nblk,
int blksize,
GradientsP < T > XGrad_cpu,
GradientsP < T > XGrad_gpu
)
This function copies the gradients structure from the host (CPU) to the device (GPU) memory.
Template parameters:
TData type
Parameters:
nblkNumber of blocksblksizeBlock sizeXGrad_cpuSource gradients structure (CPU)XGrad_gpuDestination gradients structure (GPU)
function SetupGPU
Setup and initialize GPU for simulation.
template<class T>
void SetupGPU (
Param & XParam,
Model < T > XModel,
Forcing < float > & XForcing,
Model < T > & XModel_g
)
This function sets up the GPU device, allocates memory, and copies data from the host to the device.
Parameters:
XParamSimulation parametersXModelHost model data structureXForcingForcing data structureXModel_gDevice model data structure
The documentation for this class was generated from the following file src/Setup_GPU.h