Gromacs
5.1
|
#include "gmxpre.h"
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <memory.h>
#include "gromacs/gmxlib/gpu_utils/gpu_utils.h"
#include "gromacs/gmxlib/gpu_utils/ocl_compiler.h"
#include "gromacs/gmxlib/ocl_tools/oclutils.h"
#include "gromacs/legacyheaders/types/enums.h"
#include "gromacs/legacyheaders/types/hw_info.h"
#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/smalloc.h"
Define functions for detection and initialization for OpenCL devices.
Macros | |
#define | CALLOCLFUNC_LOGERROR(func, err_str, retval) |
Helper macro for error handling. More... | |
Functions | |
static bool | is_compatible_gpu (int stat) |
Helper function that checks whether a given GPU status indicates compatible GPU. More... | |
static bool | runningOnWorkingOSXVersionForAmd () |
Return true if executing on OS X earlier than 10.10.4. 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... | |
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... | |
int | detect_gpus (gmx_gpu_info_t *gpu_info, char *err_str) |
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. | |
void | pick_compatible_gpus (const gmx_gpu_info_t *gpu_info, gmx_gpu_opt_t *gpu_opt) |
This function is documented in the header file. | |
gmx_bool | check_selected_gpus (int *checkres, const gmx_gpu_info_t *gpu_info, gmx_gpu_opt_t *gpu_opt) |
This function is documented in the header file. | |
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. | |
gmx_bool | init_gpu (FILE *fplog, int mygpu, char *result_str, const gmx_gpu_info_t *gpu_info, const gmx_gpu_opt_t *gpu_opt) |
This function is documented in the header file. | |
int | get_gpu_device_id (const gmx_gpu_info_t *, const gmx_gpu_opt_t *gpu_opt, int idx) |
This function is documented in the header file. | |
char * | get_ocl_gpu_device_name (const gmx_gpu_info_t *gpu_info, const gmx_gpu_opt_t *gpu_opt, int idx) |
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... | |
cl_int | dbg_ocl_kernel_name (const cl_kernel kernel) |
Prints the name of a kernel function pointer. More... | |
cl_int | dbg_ocl_kernel_name_address (void *kernel) |
Prints the name of a kernel function pointer. 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... | |
#define CALLOCLFUNC_LOGERROR | ( | func, | |
err_str, | |||
retval | |||
) |
Helper macro for error handling.
cl_int dbg_ocl_kernel_name | ( | const cl_kernel | kernel | ) |
Prints the name of a kernel function pointer.
[in] | kernel | OpenCL kernel |
cl_int dbg_ocl_kernel_name_address | ( | void * | kernel | ) |
Prints the name of a kernel function pointer.
[in] | kernel | OpenCL kernel |
int detect_gpus | ( | gmx_gpu_info_t * | gpu_info, |
char * | err_str | ||
) |
This function is documented in the header file.
Detect all GPUs in the system.
char* get_ocl_gpu_device_name | ( | const gmx_gpu_info_t * | gpu_info, |
const gmx_gpu_opt_t * | gpu_opt, | ||
int | idx | ||
) |
This function is documented in the header file.
Returns the name for the OpenCL GPU with a given index into the array of used GPUs.
ocl_vendor_id_t get_vendor_id | ( | char * | vendor_name | ) |
Returns an ocl_vendor_id_t value corresponding to the input OpenCL vendor name.
[in] | vendor_name | String with OpenCL vendor name. |
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.
|
static |
Helper function that checks whether a given GPU status indicates compatible GPU.
[in] | stat | GPU status. |
|
static |
Returns true if the gpu characterized by the device properties is supported by the native gpu acceleration.
|
static |
Return true if executing on OS X earlier than 10.10.4.
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.