Dummy at the moment, but now the boundary condition kernel caller can see what vertex buffer name is in use.

This commit is contained in:
Miikka Vaisala
2020-11-23 15:43:52 +08:00
parent 2f0f6ceac2
commit 543c565e5d
3 changed files with 36 additions and 24 deletions

View File

@@ -440,7 +440,7 @@ acDeviceGeneralBoundcondStep(const Device device, const Stream stream,
{ {
cudaSetDevice(device->id); cudaSetDevice(device->id);
return acKernelGeneralBoundconds(device->streams[stream], start, end, return acKernelGeneralBoundconds(device->streams[stream], start, end,
device->vba.in[vtxbuf_handle], config, bindex); device->vba.in[vtxbuf_handle], vtxbuf_handle, config, bindex);
} }
AcResult AcResult

View File

@@ -191,7 +191,8 @@ acKernelPeriodicBoundconds(const cudaStream_t stream, const int3 start, const in
AcResult AcResult
acKernelGeneralBoundconds(const cudaStream_t stream, const int3 start, const int3 end, acKernelGeneralBoundconds(const cudaStream_t stream, const int3 start, const int3 end,
AcReal* vtxbuf, const AcMeshInfo config, const int3 bindex) AcReal* vtxbuf, const VertexBufferHandle vtxbuf_handle,
const AcMeshInfo config, const int3 bindex)
{ {
const dim3 tpb(8, 2, 8); const dim3 tpb(8, 2, 8);
const dim3 bpg((unsigned int)ceil((end.x - start.x) / (float)tpb.x), const dim3 bpg((unsigned int)ceil((end.x - start.x) / (float)tpb.x),
@@ -203,6 +204,14 @@ acKernelGeneralBoundconds(const cudaStream_t stream, const int3 start, const int
int3 bc_bot = {config.int_params[AC_bc_type_bot_x], config.int_params[AC_bc_type_bot_y], int3 bc_bot = {config.int_params[AC_bc_type_bot_x], config.int_params[AC_bc_type_bot_y],
config.int_params[AC_bc_type_bot_z]}; config.int_params[AC_bc_type_bot_z]};
//#if AC_MPI_ENABLED
// printf( "WARNING : NON-PERIODIC BOUNDARY CONDITIONS NOT SUPPORTER BY MPI! Only working at node level.\n");
// return AC_FAILURE;
//#endif
if ( vtxbuf_handle != -1) // This is a dummy to make swithing boundary condition with respect to more possible later
{
if (bc_top.x == AC_BOUNDCOND_SYMMETRIC) if (bc_top.x == AC_BOUNDCOND_SYMMETRIC)
{ {
kernel_symmetric_boundconds<<<bpg, tpb, 0, stream>>>(start, end, vtxbuf, bindex, 1); kernel_symmetric_boundconds<<<bpg, tpb, 0, stream>>>(start, end, vtxbuf, bindex, 1);
@@ -227,5 +236,7 @@ acKernelGeneralBoundconds(const cudaStream_t stream, const int3 start, const int
return AC_FAILURE; return AC_FAILURE;
} }
}
return AC_SUCCESS; return AC_SUCCESS;
} }

View File

@@ -45,7 +45,8 @@ AcResult acKernelPeriodicBoundconds(const cudaStream_t stream, const int3 start,
AcReal* vtxbuf); AcReal* vtxbuf);
/** */ /** */
AcResult acKernelGeneralBoundconds(const cudaStream_t stream, const int3 start, const int3 end, AcResult acKernelGeneralBoundconds(const cudaStream_t stream, const int3 start, const int3 end,
AcReal* vtxbuf, const AcMeshInfo config, const int3 bindex); AcReal* vtxbuf, const VertexBufferHandle vtxbuf_handle,
const AcMeshInfo config, const int3 bindex);
/** */ /** */