GPU_FUNC_QUALIFIER void pme_gpu_reinit_computation(const gmx_pme_t* GPU_FUNC_ARGUMENT(pme),
gmx_wallcycle* GPU_FUNC_ARGUMENT(wcycle)) GPU_FUNC_TERM;
-
-/*! \brief Get pointer to device copy of coordinate data.
- * \param[in] pme The PME data structure.
- * \returns Pointer to coordinate data
- */
-GPU_FUNC_QUALIFIER DeviceBuffer<float> pme_gpu_get_device_x(const gmx_pme_t* GPU_FUNC_ARGUMENT(pme))
- GPU_FUNC_TERM_WITH_RETURN(DeviceBuffer<float>{});
-
/*! \brief Set pointer to device copy of coordinate data.
* \param[in] pme The PME data structure.
* \param[in] d_x The pointer to the positions buffer to be set
wallcycle_stop(wcycle, ewcLAUNCH_GPU);
}
-DeviceBuffer<float> pme_gpu_get_device_x(const gmx_pme_t* pme)
-{
- GMX_ASSERT((pme && pme_gpu_active(pme)),
- "PME GPU coordinates buffer was requested from uninitialized PME module");
- return pme_gpu_get_kernelparam_coordinates(pme->gpu);
-}
-
void* pme_gpu_get_device_f(const gmx_pme_t* pme)
{
if (!pme || !pme_gpu_active(pme))
pmeGpu->settings.transferKind, nullptr);
}
-void pme_gpu_realloc_coordinates(PmeGpu* pmeGpu)
-{
- const size_t newCoordinatesSize = pmeGpu->nAtomsAlloc * DIM;
- GMX_ASSERT(newCoordinatesSize > 0, "Bad number of atoms in PME GPU");
- reallocateDeviceBuffer(&pmeGpu->kernelParams->atoms.d_coordinates, newCoordinatesSize,
- &pmeGpu->archSpecific->coordinatesSize,
- &pmeGpu->archSpecific->coordinatesSizeAlloc, pmeGpu->archSpecific->context);
- if (c_usePadding)
- {
- const size_t paddingIndex = DIM * pmeGpu->kernelParams->atoms.nAtoms;
- const size_t paddingCount = DIM * pmeGpu->nAtomsAlloc - paddingIndex;
- if (paddingCount > 0)
- {
- clearDeviceBufferAsync(&pmeGpu->kernelParams->atoms.d_coordinates, paddingIndex,
- paddingCount, pmeGpu->archSpecific->pmeStream);
- }
- }
-}
-
-void pme_gpu_free_coordinates(const PmeGpu* pmeGpu)
-{
- freeDeviceBuffer(&pmeGpu->kernelParams->atoms.d_coordinates);
-}
-
void pme_gpu_realloc_and_copy_input_coefficients(PmeGpu* pmeGpu, const float* h_coefficients)
{
GMX_ASSERT(h_coefficients, "Bad host-side charge buffer in PME GPU");
}
}
-DeviceBuffer<float> pme_gpu_get_kernelparam_coordinates(const PmeGpu* pmeGpu)
-{
- GMX_ASSERT(pmeGpu && pmeGpu->kernelParams,
- "PME GPU device buffer was requested in non-GPU build or before the GPU PME was "
- "initialized.");
-
- return pmeGpu->kernelParams->atoms.d_coordinates;
-}
-
void* pme_gpu_get_kernelparam_forces(const PmeGpu* pmeGpu)
{
if (pmeGpu && pmeGpu->kernelParams)
*/
bool pme_gpu_stream_query(const PmeGpu* pmeGpu);
-/*! \libinternal \brief
- * Reallocates the input coordinates buffer on the GPU (and clears the padded part if needed).
- *
- * \param[in] pmeGpu The PME GPU structure.
- *
- * Needs to be called on every DD step/in the beginning.
- */
-void pme_gpu_realloc_coordinates(PmeGpu* pmeGpu);
-
-/*! \libinternal \brief
- * Frees the coordinates on the GPU.
- *
- * \param[in] pmeGpu The PME GPU structure.
- */
-void pme_gpu_free_coordinates(const PmeGpu* pmeGpu);
-
/*! \libinternal \brief
* Reallocates the buffer on the GPU and copies the charges/coefficients from the CPU buffer.
* Clears the padded part if needed.
PmeForceOutputHandling GPU_FUNC_ARGUMENT(forceTreatment),
const float* GPU_FUNC_ARGUMENT(h_grid)) GPU_FUNC_TERM;
-/*! \brief Return pointer to device copy of coordinate data.
- * \param[in] pmeGpu The PME GPU structure.
- * \returns Pointer to coordinate data
- */
-GPU_FUNC_QUALIFIER DeviceBuffer<float> pme_gpu_get_kernelparam_coordinates(const PmeGpu* GPU_FUNC_ARGUMENT(pmeGpu))
- GPU_FUNC_TERM_WITH_RETURN(DeviceBuffer<float>{});
-
/*! \brief Sets the device pointer to coordinate data
* \param[in] pmeGpu The PME GPU structure.
* \param[in] d_x Pointer to coordinate data
// This rank will have its data accessed directly by PP rank, so needs to send the remote addresses.
pme_pp->pmeCoordinateReceiverGpu->sendCoordinateBufferAddressToPpRanks(
- pme_gpu_get_device_x(pme));
+ stateGpu->getCoordinates());
pme_pp->pmeForceSenderGpu->sendForceBufferAddressToPpRanks(
reinterpret_cast<rvec*>(pme_gpu_get_device_f(pme)));
}
if (useGpuXBufOps == BufferOpsUseGpu::True)
{
- // The condition here was (pme != nullptr && pme_gpu_get_device_x(fr->pmedata) != nullptr)
if (!useGpuPmeOnThisRank && !ddUsesGpuDirectCommunication)
{
stateGpu->copyCoordinatesToGpu(x.unpaddedArrayRef(), AtomLocality::NonLocal);