#include "gromacs/utility/stringutil.h"
#if !GMX_GPU
-/*! \brief Set allocation functions used by the GPU host
- *
- * Since GPU support is not configured, there is no host memory to
- * allocate. */
-void gpu_set_host_malloc_and_free(bool /*unused*/,
- gmx_host_alloc_t **nb_alloc,
- gmx_host_free_t **nb_free)
-{
- *nb_alloc = nullptr;
- *nb_free = nullptr;
-}
-
int gpu_info_get_stat(const gmx_gpu_info_t & /*unused*/, int /*unused*/)
{
return egpuNonexistent;
return sizeof(gmx_device_info_t);
}
-void gpu_set_host_malloc_and_free(bool bUseGpuKernels,
- gmx_host_alloc_t **nb_alloc,
- gmx_host_free_t **nb_free)
-{
- if (bUseGpuKernels)
- {
- *nb_alloc = &pmalloc;
- *nb_free = &pfree;
- }
- else
- {
- *nb_alloc = nullptr;
- *nb_free = nullptr;
- }
-}
-
void startGpuProfiler(void)
{
/* The NVPROF_ID environment variable is set by nvprof and indicates that
GPU_FUNC_QUALIFIER
size_t sizeof_gpu_dev_info() GPU_FUNC_TERM_WITH_RETURN(0)
-/*! \brief Returns a pointer *ptr to page-locked memory of size nbytes.
- *
- * The allocated memory is suitable to be used for data transfers between host
- * and GPU.
- * Error handling should be done within this function.
- */
-typedef void gmx_host_alloc_t (void **ptr, size_t nbytes);
-
-/*! \brief Frees page-locked memory pointed to by *ptr.
- *
- * NULL should not be passed to this function.
- */
-typedef void gmx_host_free_t (void *ptr);
-
-/*! \brief Set page-locked memory allocation functions used by the GPU host. */
-void gpu_set_host_malloc_and_free(bool bUseGpuKernels,
- gmx_host_alloc_t **nb_alloc,
- gmx_host_free_t **nb_free);
-
//! Get status of device with specified index
int gpu_info_get_stat(const gmx_gpu_info_t &info, int index);
return sizeof(gmx_device_info_t);
}
-void gpu_set_host_malloc_and_free(bool bUseGpuKernels,
- gmx_host_alloc_t **nb_alloc,
- gmx_host_free_t **nb_free)
-{
- if (bUseGpuKernels)
- {
- *nb_alloc = &pmalloc;
- *nb_free = &pfree;
- }
- else
- {
- *nb_alloc = nullptr;
- *nb_free = nullptr;
- }
-}
-
int gpu_info_get_stat(const gmx_gpu_info_t &info, int index)
{
return info.gpu_dev[index].stat;