28 #include "include/splitvector/splitvec.h"
37std::array<vmesh::MeshParameters,MAX_VMESH_PARAMETERS_COUNT> *velocityMeshes_upload;
39__global__
void debug_kernel(
const uint popID) {
54#pragma nv_diag_suppress=20091
60 for (
size_t InstanceIdx = 0; InstanceIdx <
sizeof(meshWrapperDevRegister) /
sizeof(
vmesh::MeshWrapper**);
62 if (
auto*& slot = meshWrapperDevRegister[InstanceIdx]; !slot) {
68 assert(
false &&
"Not enough slots to register mesh wrapper slots.");
75 CHK_ERR(
gpuMalloc((
void **)&velocityMeshes_upload,
sizeof(std::array<vmesh::MeshParameters,MAX_VMESH_PARAMETERS_COUNT>)) );
84 for (
size_t InstanceIdx = 0; InstanceIdx <
sizeof(meshWrapperDevRegister) /
sizeof(vmesh::MeshWrapper**);
86 if (
auto* slot = meshWrapperDevRegister[InstanceIdx]; slot) {
95 MPI_Comm_rank(MPI_COMM_WORLD,&
myRank);
97 printf(
"Done setting all %d instances of device mesh wrapper handler!\n",count);
105void vmesh::deallocateMeshWrapper() {
116 if (
meshWrapper->velocityMeshesCreation->size() != nMeshes) {
117 printf(
"Error! Initialized only %d velocity meshes out of %d created ones.\n",nMeshes,
122 meshWrapper->velocityMeshes =
new std::array<vmesh::MeshParameters,MAX_VMESH_PARAMETERS_COUNT>;
125 for (uint
i=0;
i<nMeshes; ++
i) {
#define gpuMemcpyHostToDevice
#define gpuMemcpyToSymbol
#define gpuDeviceSynchronize
ARCH_HOSTDEV void printVelocityMesh(const uint meshIndex)
MeshWrapper * host_getMeshWrapper()
void allocateMeshWrapper()
vmesh::LocalID gridLength[3]
vmesh::LocalID blockLength[3]
vmesh::LocalID max_velocity_blocks
void initVelocityMeshes(const uint nMeshes)
std::array< vmesh::MeshParameters, MAX_VMESH_PARAMETERS_COUNT > * velocityMeshes
static vmesh::MeshWrapper * meshWrapper