From 3bafc040d738354e5184d42943e10533339cbf32 Mon Sep 17 00:00:00 2001 From: Berk Hess Date: Fri, 4 Jan 2019 22:57:35 +0100 Subject: [PATCH] Remove now usused GPU alloc/free functions Change-Id: Ifbb424162dd642ecca662ac6a5cb476c24649f0f --- src/gromacs/gpu_utils/gpu_utils.cpp | 12 ------------ src/gromacs/gpu_utils/gpu_utils.cu | 16 ---------------- src/gromacs/gpu_utils/gpu_utils.h | 19 ------------------- src/gromacs/gpu_utils/gpu_utils_ocl.cpp | 16 ---------------- 4 files changed, 63 deletions(-) diff --git a/src/gromacs/gpu_utils/gpu_utils.cpp b/src/gromacs/gpu_utils/gpu_utils.cpp index 7105b498c2..81778c0111 100644 --- a/src/gromacs/gpu_utils/gpu_utils.cpp +++ b/src/gromacs/gpu_utils/gpu_utils.cpp @@ -51,18 +51,6 @@ #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; diff --git a/src/gromacs/gpu_utils/gpu_utils.cu b/src/gromacs/gpu_utils/gpu_utils.cu index 9fbde4f09a..17288e9bfb 100644 --- a/src/gromacs/gpu_utils/gpu_utils.cu +++ b/src/gromacs/gpu_utils/gpu_utils.cu @@ -498,22 +498,6 @@ size_t sizeof_gpu_dev_info(void) 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 diff --git a/src/gromacs/gpu_utils/gpu_utils.h b/src/gromacs/gpu_utils/gpu_utils.h index 6755f1c587..8869338e47 100644 --- a/src/gromacs/gpu_utils/gpu_utils.h +++ b/src/gromacs/gpu_utils/gpu_utils.h @@ -227,25 +227,6 @@ OPENCL_FUNC_TERM_WITH_RETURN(false) 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); diff --git a/src/gromacs/gpu_utils/gpu_utils_ocl.cpp b/src/gromacs/gpu_utils/gpu_utils_ocl.cpp index 83536a2571..d3ce8e0a88 100644 --- a/src/gromacs/gpu_utils/gpu_utils_ocl.cpp +++ b/src/gromacs/gpu_utils/gpu_utils_ocl.cpp @@ -600,22 +600,6 @@ size_t sizeof_gpu_dev_info() 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; -- 2.22.0