scheduler: fix bug that prevented Intel GPU work from being sent to anonymous platform clients

This commit is contained in:
David Anderson 2013-11-21 22:31:15 -08:00
parent 7125028c15
commit feb2f1971d
3 changed files with 16 additions and 8 deletions

View File

@ -905,4 +905,10 @@ const char* proc_type_name(int pt) {
return "unknown"; return "unknown";
} }
int coproc_type_name_to_num(const char* name) {
if (!strcmp(name, "CUDA")) return PROC_TYPE_NVIDIA_GPU;
if (!strcmp(name, "NVIDIA")) return PROC_TYPE_NVIDIA_GPU;
if (!strcmp(name, "ATI")) return PROC_TYPE_AMD_GPU;
if (!strcmp(name, "intel_gpu")) return PROC_TYPE_INTEL_GPU;
return 0;
}

View File

@ -98,6 +98,7 @@ extern const char* proc_type_name(int);
// user-readable name // user-readable name
extern const char* proc_type_name_xml(int); extern const char* proc_type_name_xml(int);
// name used in XML and COPROC::type // name used in XML and COPROC::type
extern int coproc_type_name_to_num(const char* name);
// deprecated, but keep for simplicity // deprecated, but keep for simplicity
#define GPU_TYPE_NVIDIA proc_type_name_xml(PROC_TYPE_NVIDIA_GPU) #define GPU_TYPE_NVIDIA proc_type_name_xml(PROC_TYPE_NVIDIA_GPU)

View File

@ -93,14 +93,15 @@ int CLIENT_APP_VERSION::parse(XML_PARSER& xp) {
COPROC_REQ coproc_req; COPROC_REQ coproc_req;
int retval = coproc_req.parse(xp); int retval = coproc_req.parse(xp);
if (!retval) { if (!retval) {
host_usage.gpu_usage = coproc_req.count; int rt = coproc_type_name_to_num(coproc_req.type);
if (!strcmp(coproc_req.type, "CUDA") || !strcmp(coproc_req.type, "NVIDIA")) { if (!rt) {
host_usage.proc_type = PROC_TYPE_NVIDIA_GPU; log_messages.printf(MSG_NORMAL,
} else if (!strcmp(coproc_req.type, "ATI")) { "UNKNOWN COPROC TYPE %s\n", coproc_req.type
host_usage.proc_type = PROC_TYPE_AMD_GPU; );
} else if (!strcmp(coproc_req.type, "INTEL")) { continue;
host_usage.proc_type = PROC_TYPE_INTEL_GPU;
} }
host_usage.proc_type = rt;
host_usage.gpu_usage = coproc_req.count;
} }
continue; continue;
} }