constexpr static int c_bufOpsThreadsPerBlock = 128;
/*! Nonbonded kernel function pointer type */
-typedef void (*nbnxn_cu_kfunc_ptr_t)(const NBAtomData, const NBParamGpu, const gpu_plist, bool);
+typedef void (*nbnxn_cu_kfunc_ptr_t)(const NBAtomDataGpu, const NBParamGpu, const gpu_plist, bool);
/*********************************/
*/
void gpu_launch_kernel(NbnxmGpu* nb, const gmx::StepWorkload& stepWork, const InteractionLocality iloc)
{
- NBAtomData* adat = nb->atdat;
+ NBAtomDataGpu* adat = nb->atdat;
NBParamGpu* nbp = nb->nbparam;
gpu_plist* plist = nb->plist[iloc];
Nbnxm::GpuTimers* timers = nb->timers;
void gpu_launch_kernel_pruneonly(NbnxmGpu* nb, const InteractionLocality iloc, const int numParts)
{
- NBAtomData* adat = nb->atdat;
+ NBAtomDataGpu* adat = nb->atdat;
NBParamGpu* nbp = nb->nbparam;
gpu_plist* plist = nb->plist[iloc];
Nbnxm::GpuTimers* timers = nb->timers;
{
GMX_ASSERT(nb, "Need a valid nbnxn_gpu object");
- NBAtomData* adat = nb->atdat;
+ NBAtomDataGpu* adat = nb->atdat;
const int numColumns = grid.numColumns();
const int cellOffset = grid.cellOffset();
__global__ void NB_KERNEL_FUNC_NAME(nbnxn_kernel, _F_cuda)
# endif /* CALC_ENERGIES */
#endif /* PRUNE_NBL */
- (const NBAtomData atdat, const NBParamGpu nbparam, const Nbnxm::gpu_plist plist, bool bCalcFshift)
+ (const NBAtomDataGpu atdat, const NBParamGpu nbparam, const Nbnxm::gpu_plist plist, bool bCalcFshift)
#ifdef FUNCTION_DECLARATION_ONLY
; /* Only do function declaration, omit the function body. */
#else
#ifndef FUNCTION_DECLARATION_ONLY
/* Instantiate external template functions */
template __global__ void
-nbnxn_kernel_prune_cuda<false>(const NBAtomData, const NBParamGpu, const Nbnxm::gpu_plist, int, int);
+nbnxn_kernel_prune_cuda<false>(const NBAtomDataGpu, const NBParamGpu, const Nbnxm::gpu_plist, int, int);
template __global__ void
-nbnxn_kernel_prune_cuda<true>(const NBAtomData, const NBParamGpu, const Nbnxm::gpu_plist, int, int);
+nbnxn_kernel_prune_cuda<true>(const NBAtomDataGpu, const NBParamGpu, const Nbnxm::gpu_plist, int, int);
#endif
*/
template<bool haveFreshList>
__launch_bounds__(THREADS_PER_BLOCK, MIN_BLOCKS_PER_MP) __global__
- void nbnxn_kernel_prune_cuda(const NBAtomData atdat,
+ void nbnxn_kernel_prune_cuda(const NBAtomDataGpu atdat,
const NBParamGpu nbparam,
const Nbnxm::gpu_plist plist,
int numParts,
// Add extern declarations so each translation unit understands that
// there will be a definition provided.
extern template __global__ void
-nbnxn_kernel_prune_cuda<true>(const NBAtomData, const NBParamGpu, const Nbnxm::gpu_plist, int, int);
+nbnxn_kernel_prune_cuda<true>(const NBAtomDataGpu, const NBParamGpu, const Nbnxm::gpu_plist, int, int);
extern template __global__ void
-nbnxn_kernel_prune_cuda<false>(const NBAtomData, const NBParamGpu, const Nbnxm::gpu_plist, int, int);
+nbnxn_kernel_prune_cuda<false>(const NBAtomDataGpu, const NBParamGpu, const Nbnxm::gpu_plist, int, int);
#else
{
bool bNonLocalStreamDoneMarked = false;
/*! \brief atom data */
- NBAtomData* atdat = nullptr;
+ NBAtomDataGpu* atdat = nullptr;
/*! \brief array of atom indices */
int* atomIndices = nullptr;
/*! \brief size of atom indices */
* \param[in] atomLocality Atom locality specifier
* \returns Range of indexes for selected locality.
*/
-static inline gmx::Range<int> getGpuAtomRange(const NBAtomData* atomData, const AtomLocality atomLocality)
+static inline gmx::Range<int> getGpuAtomRange(const NBAtomDataGpu* atomData, const AtomLocality atomLocality)
{
assert(atomData);
/** \internal
* \brief Nonbonded atom data - both inputs and outputs.
*/
-struct NBAtomData
+struct NBAtomDataGpu
{
//! number of atoms
int numAtoms;
}
/*! \brief Initialize \p atomdata first time; it only gets filled at pair-search. */
-static void initAtomdataFirst(NBAtomData* atomdata,
+static void initAtomdataFirst(NBAtomDataGpu* atomdata,
int numTypes,
const DeviceContext& deviceContext,
const DeviceStream& localStream)
{
auto* nb = new NbnxmGpu();
nb->deviceContext_ = &deviceStreamManager.context();
- nb->atdat = new NBAtomData;
+ nb->atdat = new NBAtomDataGpu;
nb->nbparam = new NBParamGpu;
nb->plist[InteractionLocality::Local] = new Nbnxm::gpu_plist;
if (bLocalAndNonlocal)
void gpu_upload_shiftvec(NbnxmGpu* nb, const nbnxn_atomdata_t* nbatom)
{
- NBAtomData* adat = nb->atdat;
+ NBAtomDataGpu* adat = nb->atdat;
const DeviceStream& localStream = *nb->deviceStreams[InteractionLocality::Local];
/* only if we have a dynamic box */
{
bool bDoTime = nb->bDoTime;
Nbnxm::GpuTimers* timers = bDoTime ? nb->timers : nullptr;
- NBAtomData* atdat = nb->atdat;
+ NBAtomDataGpu* atdat = nb->atdat;
const DeviceContext& deviceContext = *nb->deviceContext_;
const DeviceStream& localStream = *nb->deviceStreams[InteractionLocality::Local];
void gpu_clear_outputs(NbnxmGpu* nb, bool computeVirial)
{
- NBAtomData* adat = nb->atdat;
+ NBAtomDataGpu* adat = nb->atdat;
const DeviceStream& localStream = *nb->deviceStreams[InteractionLocality::Local];
// Clear forces
clearDeviceBufferAsync(&adat->f, 0, nb->atdat->numAtoms, localStream);
"beginning of the copy back function.");
/* extract the data */
- NBAtomData* adat = nb->atdat;
+ NBAtomDataGpu* adat = nb->atdat;
Nbnxm::GpuTimers* timers = nb->timers;
bool bDoTime = nb->bDoTime;
const DeviceStream& deviceStream = *nb->deviceStreams[iloc];
const InteractionLocality iloc = atomToInteractionLocality(atomLocality);
- NBAtomData* adat = nb->atdat;
+ NBAtomDataGpu* adat = nb->atdat;
gpu_plist* plist = nb->plist[iloc];
Nbnxm::GpuTimers* timers = nb->timers;
const DeviceStream& deviceStream = *nb->deviceStreams[iloc];
delete nb->timers;
sfree(nb->timings);
- NBAtomData* atdat = nb->atdat;
- NBParamGpu* nbparam = nb->nbparam;
+ NBAtomDataGpu* atdat = nb->atdat;
+ NBParamGpu* nbparam = nb->nbparam;
/* Free atdat */
freeDeviceBuffer(&(nb->atdat->xq));
*/
void gpu_launch_kernel(NbnxmGpu* nb, const gmx::StepWorkload& stepWork, const Nbnxm::InteractionLocality iloc)
{
- NBAtomData* adat = nb->atdat;
+ NBAtomDataGpu* adat = nb->atdat;
NBParamGpu* nbp = nb->nbparam;
gpu_plist* plist = nb->plist[iloc];
Nbnxm::GpuTimers* timers = nb->timers;
*/
void gpu_launch_kernel_pruneonly(NbnxmGpu* nb, const InteractionLocality iloc, const int numParts)
{
- NBAtomData* adat = nb->atdat;
+ NBAtomDataGpu* adat = nb->atdat;
NBParamGpu* nbp = nb->nbparam;
gpu_plist* plist = nb->plist[iloc];
Nbnxm::GpuTimers* timers = nb->timers;
bool bNonLocalStreamDoneMarked = false;
//! atom data
- NBAtomData* atdat = nullptr;
+ NBAtomDataGpu* atdat = nullptr;
//! parameters required for the non-bonded calc.
NBParamGpu* nbparam = nullptr;
//! pair-list data structures (local and non-local)
void launchNbnxmKernel(NbnxmGpu* nb, const gmx::StepWorkload& stepWork, const InteractionLocality iloc)
{
- NBAtomData* adat = nb->atdat;
+ NBAtomDataGpu* adat = nb->atdat;
NBParamGpu* nbp = nb->nbparam;
gpu_plist* plist = nb->plist[iloc];
const bool doPruneNBL = (plist->haveFreshList && !nb->didPrune[iloc]);
const int part,
const int numSciInPart)
{
- NBAtomData* adat = nb->atdat;
+ NBAtomDataGpu* adat = nb->atdat;
NBParamGpu* nbp = nb->nbparam;
gpu_plist* plist = nb->plist[iloc];
const bool haveFreshList = plist->haveFreshList;
/*! \brief true indicates that the nonlocal_done event was marked */
bool bNonLocalStreamDoneMarked = false;
/*! \brief atom data */
- NBAtomData* atdat = nullptr;
+ NBAtomDataGpu* atdat = nullptr;
// Data for GPU-side coordinate conversion between integrator and NBNXM
/*! \brief array of atom indices */