Gromacs
2018.7
|
#include "gmxpre.h"
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <memory.h>
#include "gromacs/gpu_utils/gpu_utils.h"
#include "gromacs/gpu_utils/ocl_compiler.h"
#include "gromacs/gpu_utils/oclutils.h"
#include "gromacs/hardware/hw_info.h"
#include "gromacs/mdtypes/md_enums.h"
#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/exceptions.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/smalloc.h"
#include "gromacs/utility/stringutil.h"
Define functions for detection and initialization for OpenCL devices.
Functions | |
static bool | runningOnCompatibleOSForAmd () |
Return true if executing on compatible OS for AMD OpenCL. More... | |
static int | is_gmx_supported_gpu_id (struct gmx_device_info_t *ocl_gpu_device) |
Returns true if the gpu characterized by the device properties is supported by the native gpu acceleration. More... | |
static ocl_vendor_id_t | get_vendor_id (char *vendor_name) |
Returns an ocl_vendor_id_t value corresponding to the input OpenCL vendor name. More... | |
bool | canDetectGpus (std::string *errorMessage) |
This function is documented in the header file. More... | |
void | findGpus (gmx_gpu_info_t *gpu_info) |
This function is documented in the header file. More... | |
void | free_gpu_info (const gmx_gpu_info_t *gpu_info) |
This function is documented in the header file. | |
std::vector< int > | getCompatibleGpus (const gmx_gpu_info_t &gpu_info) |
This function is documented in the header file. More... | |
const char * | getGpuCompatibilityDescription (const gmx_gpu_info_t &gpu_info, int index) |
This function is documented in the header file. More... | |
void | get_gpu_device_info_string (char *s, const gmx_gpu_info_t &gpu_info, int index) |
This function is documented in the header file. | |
void | init_gpu (const gmx::MDLogger &, gmx_device_info_t *deviceInfo) |
This function is documented in the header file. More... | |
gmx_device_info_t * | getDeviceInfo (const gmx_gpu_info_t &gpu_info, int deviceId) |
This function is documented in the header file. More... | |
size_t | sizeof_gpu_dev_info (void) |
This function is documented in the header file. More... | |
void | gpu_set_host_malloc_and_free (bool bUseGpuKernels, gmx_host_alloc_t **nb_alloc, gmx_host_free_t **nb_free) |
Set page-locked memory allocation functions used by the GPU host. More... | |
bool canDetectGpus | ( | std::string * | errorMessage | ) |
This function is documented in the header file.
Return whether GPUs can be detected.
void findGpus | ( | gmx_gpu_info_t * | gpu_info | ) |
This function is documented in the header file.
Find all GPUs in the system.
|
static |
Returns an ocl_vendor_id_t value corresponding to the input OpenCL vendor name.
[in] | vendor_name | String with OpenCL vendor name. |
std::vector<int> getCompatibleGpus | ( | const gmx_gpu_info_t & | gpu_info | ) |
This function is documented in the header file.
Return a container of the detected GPUs that are compatible.
gmx_device_info_t* getDeviceInfo | ( | const gmx_gpu_info_t & | gpu_info, |
int | deviceId | ||
) |
This function is documented in the header file.
Return a pointer to the device info for deviceId
.
const char* getGpuCompatibilityDescription | ( | const gmx_gpu_info_t & | gpu_info, |
int | index | ||
) |
This function is documented in the header file.
Return a string describing how compatible the GPU with given index
is.
void gpu_set_host_malloc_and_free | ( | bool | bUseGpuKernels, |
gmx_host_alloc_t ** | nb_alloc, | ||
gmx_host_free_t ** | nb_free | ||
) |
Set page-locked memory allocation functions used by the GPU host.
Set page-locked memory allocation functions used by the GPU host.
Since GPU support is not configured, there is no host memory to allocate.
void init_gpu | ( | const gmx::MDLogger & | , |
gmx_device_info_t * | deviceInfo | ||
) |
This function is documented in the header file.
Initializes the GPU described by deviceInfo
.
|
static |
Returns true if the gpu characterized by the device properties is supported by the native gpu acceleration.
|
static |
Return true if executing on compatible OS for AMD OpenCL.
This is assumed to be true for OS X version of at least 10.10.4 and all other OS flavors.
Uses the BSD sysctl() interfaces to extract the kernel version.
size_t sizeof_gpu_dev_info | ( | void | ) |
This function is documented in the header file.
Returns the size of the gpu_dev_info struct.