mirror of https://github.com/BOINC/boinc.git
- code formatting
This commit is contained in:
parent
e693e2df09
commit
865d50623e
|
@ -49,8 +49,6 @@
|
||||||
// CUDA, so a device_num may not correspond to its opencl_device_index
|
// CUDA, so a device_num may not correspond to its opencl_device_index
|
||||||
// even if all GPUs are from NVIDIA.
|
// even if all GPUs are from NVIDIA.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
|
||||||
int get_vendor(cl_device_id device_id, char* vendor) {
|
int get_vendor(cl_device_id device_id, char* vendor) {
|
||||||
int retval = 0;
|
int retval = 0;
|
||||||
|
|
||||||
|
@ -77,7 +75,8 @@ int get_vendor(cl_device_id device_id, char* vendor) {
|
||||||
// returns an OpenCL error num or zero
|
// returns an OpenCL error num or zero
|
||||||
//
|
//
|
||||||
int boinc_get_opencl_ids_aux(
|
int boinc_get_opencl_ids_aux(
|
||||||
char* type, int opencl_device_index, int device_num, cl_device_id* device, cl_platform_id* platform
|
char* type, int opencl_device_index, int device_num,
|
||||||
|
cl_device_id* device, cl_platform_id* platform
|
||||||
) {
|
) {
|
||||||
cl_platform_id platforms[MAX_OPENCL_PLATFORMS];
|
cl_platform_id platforms[MAX_OPENCL_PLATFORMS];
|
||||||
cl_uint num_platforms, platform_index, num_devices;
|
cl_uint num_platforms, platform_index, num_devices;
|
||||||
|
@ -156,7 +155,10 @@ int boinc_get_opencl_ids_aux(
|
||||||
// - ERR_NOT_FOUND if unable to get opencl_device_index or gpu device_num
|
// - ERR_NOT_FOUND if unable to get opencl_device_index or gpu device_num
|
||||||
// - an OpenCL error number if OpenCL error
|
// - an OpenCL error number if OpenCL error
|
||||||
//
|
//
|
||||||
int boinc_get_opencl_ids(int argc, char** argv, char* type, cl_device_id* device, cl_platform_id* platform){
|
int boinc_get_opencl_ids(
|
||||||
|
int argc, char** argv, char* type,
|
||||||
|
cl_device_id* device, cl_platform_id* platform
|
||||||
|
){
|
||||||
int retval;
|
int retval;
|
||||||
APP_INIT_DATA aid;
|
APP_INIT_DATA aid;
|
||||||
char *gpu_type;
|
char *gpu_type;
|
||||||
|
@ -180,6 +182,7 @@ int boinc_get_opencl_ids(int argc, char** argv, char* type, cl_device_id* device
|
||||||
|
|
||||||
if (aid.gpu_opencl_dev_index < 0) {
|
if (aid.gpu_opencl_dev_index < 0) {
|
||||||
// Older versions of init_data.xml don't have gpu_opencl_dev_index field
|
// Older versions of init_data.xml don't have gpu_opencl_dev_index field
|
||||||
|
//
|
||||||
gpu_device_num = aid.gpu_device_num;
|
gpu_device_num = aid.gpu_device_num;
|
||||||
if (gpu_device_num < 0) {
|
if (gpu_device_num < 0) {
|
||||||
// Even older versions of init_data.xml don't have gpu_device_num field
|
// Even older versions of init_data.xml don't have gpu_device_num field
|
||||||
|
@ -197,7 +200,6 @@ int boinc_get_opencl_ids(int argc, char** argv, char* type, cl_device_id* device
|
||||||
return ERR_NOT_FOUND;
|
return ERR_NOT_FOUND;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
retval = boinc_get_opencl_ids_aux(
|
retval = boinc_get_opencl_ids_aux(
|
||||||
gpu_type, aid.gpu_opencl_dev_index, gpu_device_num, device, platform
|
gpu_type, aid.gpu_opencl_dev_index, gpu_device_num, device, platform
|
||||||
);
|
);
|
||||||
|
|
|
@ -25,4 +25,11 @@
|
||||||
|
|
||||||
#include "cl_boinc.h"
|
#include "cl_boinc.h"
|
||||||
|
|
||||||
int boinc_get_opencl_ids(int argc, char** argv, char *type, cl_device_id* device, cl_platform_id* platform);int boinc_get_opencl_ids(cl_device_id* device, cl_platform_id* platform);
|
int boinc_get_opencl_ids(
|
||||||
|
int argc, char** argv, char *type,
|
||||||
|
cl_device_id* device, cl_platform_id* platform
|
||||||
|
);
|
||||||
|
|
||||||
|
// doesn't work w/ pre-7 clients; use the above
|
||||||
|
//
|
||||||
|
int boinc_get_opencl_ids(cl_device_id* device, cl_platform_id* platform);
|
||||||
|
|
Loading…
Reference in New Issue