client: Continue adding OpenCL support

svn path=/trunk/boinc/; revision=23260
This commit is contained in:
Charlie Fenton 2011-03-25 14:08:50 +00:00
parent b24bfbba3d
commit 99bbddf467
2 changed files with 24 additions and 11 deletions

View File

@ -206,23 +206,33 @@ void COPROCS::get_opencl(vector<string>&warnings) {
if (ciErrNum != CL_SUCCESS) return;
if (!strcmp(prop.vendor, "NVIDIA")) {
if (!nvidia.opencl_prop.name[0]) { // If not already merged
if (nvidia.matches(prop)) {
nvidia.opencl_prop = prop;
return;
if (nvidia.matches(prop)) {
nvidia.opencl_prop = prop;
nvidia.opencl_device_ids[nvidia.opencl_device_num++] = prop.device_id;
} else {
if (!nvidia.cuda_version) { // If CUDA did not find any previously
nvidia.opencl_prop = prop; // fill in what info we have
nvidia.opencl_device_ids[nvidia.opencl_device_num++] = prop.device_id;
strcpy(nvidia.prop.name, prop.name);
nvidia.prop.totalGlobalMem = prop.global_RAM;
nvidia.prop.clockRate = prop.max_clock_freq * 1000;
}
//TODO: Create a new entry if not already in CUDA list?
}
return;
}
if (!(strcmp(prop.vendor, "ATI") || strcmp(prop.vendor, "AMD"))) {
if (!ati.opencl_prop.name[0]) { // If not already merged
if (ati.matches(prop)) {
ati.opencl_prop = prop;
return;
if (ati.matches(prop)) {
ati.opencl_prop = prop;
ati.opencl_device_ids[ati.opencl_device_num++] = prop.device_id;
} else {
if (! (ati.atirt_detected || ati.amdrt_detected)) { // If ATI did not find any previously
ati.opencl_prop = prop; // fill in what info we have
ati.opencl_device_ids[ati.opencl_device_num++] = prop.device_id;
strcpy(ati.name, prop.name);
ati.attribs.localRAM = prop.local_RAM;
ati.attribs.engineClock = prop.max_clock_freq;
}
//TODO: Create a new entry if not already in ATI list due from CAL?
}
return;
}

View File

@ -153,8 +153,9 @@ struct COPROC {
// These are not sequential if we omit instances (see above)
//
int device_nums[MAX_COPROC_INSTANCES];
int open_device_ids[MAX_COPROC_INSTANCES];
int device_num; // temp used in scan process
cl_device_id opencl_device_ids[MAX_COPROC_INSTANCES];
int opencl_device_num;
bool running_graphics_app[MAX_COPROC_INSTANCES];
// is this GPU running a graphics app (NVIDIA only)
double available_ram[MAX_COPROC_INSTANCES];
@ -178,9 +179,11 @@ struct COPROC {
used = 0;
req_secs = 0;
req_instances = 0;
opencl_device_num = 0;
estimated_delay = 0;
for (int i=0; i<MAX_COPROC_INSTANCES; i++) {
device_nums[i] = 0;
opencl_device_ids[i] = 0;
running_graphics_app[i] = true;
available_ram[i] = 0;
available_ram_fake[i] = 0;