mirror of https://github.com/BOINC/boinc.git
lib, client: revert recent changes to restore unsigned long long so we can determine cause of Linux build errors
svn path=/trunk/boinc/; revision=24035
This commit is contained in:
parent
6697484f84
commit
0e7909c97b
|
@ -5032,3 +5032,13 @@ Charlie 24 Aug 2011
|
|||
|
||||
client/
|
||||
coproc_detect.cpp
|
||||
|
||||
Charlie 24 Aug 2011
|
||||
- lib, client: revert recent changes to restore unsigned long long so
|
||||
we can determine cause of Linux build errors.
|
||||
|
||||
lib/
|
||||
parse.h
|
||||
coproc.cpp
|
||||
client/
|
||||
coproc_detect.cpp
|
||||
|
|
|
@ -304,12 +304,11 @@ void COPROCS::get_opencl(bool use_all, vector<string>&warnings,
|
|||
//TODO: Temporary code for testing
|
||||
if (log_flags.coproc_debug) {
|
||||
msg_printf(0, MSG_INFO,
|
||||
"[coproc_debug] COPROC_NVIDIA [no CUDA]: nvidia_opencls[%d].name = '%s'; nvidia_opencls[%d].device_id = %p, nvidia_opencls[%d].device_num = %d",
|
||||
i, nvidia_opencls[i].name, i, nvidia_opencls[i].device_id, i, nvidia_opencls[i].device_num);
|
||||
"[coproc_debug] COPROC_NVIDIA [no CUDA]: nvidia_opencls[%d].global_RAM = %llu; nvidia_opencls[%d].local_RAM = %llu",
|
||||
i, nvidia_opencls[i].global_RAM, i, nvidia_opencls[i].local_RAM);
|
||||
msg_printf(0, MSG_INFO,
|
||||
"[coproc_debug] COPROC_NVIDIA [no CUDA]: nvidia_opencls[%d].global_RAM = %lu; nvidia_opencls[%d].local_RAM = %lu",
|
||||
i, (unsigned long)nvidia_opencls[i].global_RAM,
|
||||
i, (unsigned long)nvidia_opencls[i].local_RAM);
|
||||
"[coproc_debug] COPROC_NVIDIA [no CUDA]: nvidia_opencls[%d].global_RAM = %llu; nvidia_opencls[%d].local_RAM = %llu",
|
||||
i, nvidia_opencls[i].global_RAM, i, nvidia_opencls[i].local_RAM);
|
||||
}
|
||||
if (in_vector(nvidia_opencls[i].device_num, ignore_nvidia_dev)) continue;
|
||||
bool is_best = false;
|
||||
|
@ -384,9 +383,8 @@ void COPROCS::get_opencl(bool use_all, vector<string>&warnings,
|
|||
"[coproc_debug] COPROC_ATI [no CAL]: ati_opencls[%d].name = '%s'; ati_opencls[%d].device_id = %p, ati_opencls[%d].device_num = %d",
|
||||
i, ati_opencls[i].name, i, ati_opencls[i].device_id, i, ati_opencls[i].device_num);
|
||||
msg_printf(0, MSG_INFO,
|
||||
"[coproc_debug] COPROC_ATI [no CAL]: ati_opencls[%d].global_RAM = %lu; ati_opencls[%d].local_RAM = %lu",
|
||||
i, (unsigned long)ati_opencls[i].global_RAM,
|
||||
i, (unsigned long)ati_opencls[i].local_RAM);
|
||||
"[coproc_debug] COPROC_ATI [no CAL]: ati_opencls[%d].global_RAM = %llu; ati_opencls[%d].local_RAM = %llu",
|
||||
i, ati_opencls[i].global_RAM, i, ati_opencls[i].local_RAM);
|
||||
}
|
||||
if (in_vector(ati_opencls[i].device_num, ignore_ati_dev)) continue;
|
||||
bool is_best = false;
|
||||
|
@ -1089,8 +1087,8 @@ bool COPROC_NVIDIA::matches(OPENCL_DEVICE_PROP& OpenCLprop) {
|
|||
"[coproc_debug] COPROC_NVIDIA [in matches()]: device_num = %d, prop.deviceHandle = %d; OpenCLprop.device_id = %p",
|
||||
device_num, prop.deviceHandle, OpenCLprop.device_id);
|
||||
msg_printf(0, MSG_INFO,
|
||||
"[coproc_debug] COPROC_NVIDIA [in matches()]: prop.totalGlobalMem = %u; OpenCLprop.global_RAM = %lu; OpenCLprop.local_RAM = %lu",
|
||||
prop.totalGlobalMem, (unsigned long)OpenCLprop.global_RAM, (unsigned long)OpenCLprop.local_RAM);
|
||||
"[coproc_debug] COPROC_NVIDIA [in matches()]: prop.totalGlobalMem = %u; OpenCLprop.global_RAM = %llu; OpenCLprop.local_RAM = %llu",
|
||||
prop.totalGlobalMem, OpenCLprop.global_RAM, OpenCLprop.local_RAM);
|
||||
|
||||
if (strcmp(prop.name, OpenCLprop.name)) {
|
||||
msg_printf(0, MSG_INFO,
|
||||
|
@ -1552,8 +1550,8 @@ bool COPROC_ATI::matches(OPENCL_DEVICE_PROP& OpenCLprop) {
|
|||
"[coproc_debug] COPROC_ATI [in matches()]: prop.name = '%s'; OpenCLprop.name = '%s'",
|
||||
name, OpenCLprop.name);
|
||||
msg_printf(0, MSG_INFO,
|
||||
"[coproc_debug] COPROC_ATI [in matches()]: attribs.localRAM = %u; OpenCLprop.global_RAM = %lu; OpenCLprop.local_RAM = %lu",
|
||||
attribs.localRAM, (unsigned long)OpenCLprop.global_RAM, (unsigned long)OpenCLprop.local_RAM);
|
||||
"[coproc_debug] COPROC_ATI [in matches()]: attribs.localRAM = %u; OpenCLprop.global_RAM = %llu; OpenCLprop.local_RAM = %llu",
|
||||
attribs.localRAM, OpenCLprop.global_RAM, OpenCLprop.local_RAM);
|
||||
}
|
||||
|
||||
#if 0//def _WIN32
|
||||
|
|
|
@ -86,7 +86,6 @@ void COPROC::write_request(MIOFILE& f) {
|
|||
void COPROC::opencl_write_xml(MIOFILE& f) {
|
||||
f.printf(
|
||||
" <coproc_opencl>\n"
|
||||
" <device_id>%p</device_id>\n"
|
||||
" <name>%s</name>\n"
|
||||
" <vendor>%s</vendor>\n"
|
||||
" <vendor_id>%lu</vendor_id>\n"
|
||||
|
@ -104,9 +103,7 @@ void COPROC::opencl_write_xml(MIOFILE& f) {
|
|||
" <openCL_platform_version>%s</openCL_platform_version>\n"
|
||||
" <openCL_device_version>%s</openCL_device_version>\n"
|
||||
" <openCL_driver_version>%s</openCL_driver_version>\n"
|
||||
" <device_num>%d</device_num>\n"
|
||||
" </coproc_opencl>\n",
|
||||
opencl_prop.device_id,
|
||||
opencl_prop.name,
|
||||
opencl_prop.vendor,
|
||||
opencl_prop.vendor_id,
|
||||
|
@ -123,8 +120,7 @@ void COPROC::opencl_write_xml(MIOFILE& f) {
|
|||
opencl_prop.max_cores,
|
||||
opencl_prop.openCL_platform_version,
|
||||
opencl_prop.openCL_device_version,
|
||||
opencl_prop.openCL_driver_version,
|
||||
opencl_prop.device_num
|
||||
opencl_prop.openCL_driver_version
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -173,21 +169,21 @@ int COPROC::parse_opencl(XML_PARSER& xp) {
|
|||
opencl_prop.available = n;
|
||||
continue;
|
||||
}
|
||||
if (parse_ulong(buf, "<hp_fp_config>", opencl_prop.hp_fp_config)) continue;
|
||||
if (parse_ulong(buf, "<sp_fp_config>", opencl_prop.sp_fp_config)) continue;
|
||||
if (parse_ulong(buf, "<dp_fp_config>", opencl_prop.dp_fp_config)) continue;
|
||||
if (parse_ulonglong(buf, "<hp_fp_config>", opencl_prop.hp_fp_config)) continue;
|
||||
if (parse_ulonglong(buf, "<sp_fp_config>", opencl_prop.sp_fp_config)) continue;
|
||||
if (parse_ulonglong(buf, "<dp_fp_config>", opencl_prop.dp_fp_config)) continue;
|
||||
if (parse_int(buf, "<little_endian>", n)) {
|
||||
opencl_prop.little_endian = n;
|
||||
continue;
|
||||
}
|
||||
if (parse_ulong(buf, "<exec_capabilities>", opencl_prop.exec_capab)) continue;
|
||||
if (parse_ulonglong(buf, "<exec_capabilities>", opencl_prop.exec_capab)) continue;
|
||||
if (parse_str(buf, "<extensions>",
|
||||
opencl_prop.extensions,
|
||||
sizeof(opencl_prop.extensions))) {
|
||||
continue;
|
||||
}
|
||||
if (parse_ulong(buf, "<global_RAM>", opencl_prop.global_RAM)) continue;
|
||||
if (parse_ulong(buf, "<local_RAM>", opencl_prop.local_RAM)) continue;
|
||||
if (parse_ulonglong(buf, "<global_RAM>", opencl_prop.global_RAM)) continue;
|
||||
if (parse_ulonglong(buf, "<local_RAM>", opencl_prop.local_RAM)) continue;
|
||||
if (parse_int(buf, "<max_clock_freq>", n)) {
|
||||
opencl_prop.max_clock_freq = n;
|
||||
continue;
|
||||
|
@ -211,7 +207,6 @@ int COPROC::parse_opencl(XML_PARSER& xp) {
|
|||
sizeof(opencl_prop.openCL_driver_version))) {
|
||||
continue;
|
||||
}
|
||||
if (parse_int(buf, "<device_num>", opencl_prop.device_num)) continue;
|
||||
}
|
||||
return ERR_XML_PARSE;
|
||||
}
|
||||
|
|
19
lib/parse.h
19
lib/parse.h
|
@ -133,16 +133,17 @@ inline bool parse_ulong(const char* buf, const char* tag, unsigned long& x) {
|
|||
return true;
|
||||
}
|
||||
|
||||
// Same as above, but parse unsigned long into an unsigned long long variable
|
||||
inline bool parse_ulong(const char* buf, const char* tag, unsigned long long& x) {
|
||||
const char* p = strstr(buf, tag);
|
||||
if (!p) return false;
|
||||
unsigned long y = strtoul(p+strlen(tag), NULL, 0); // this parses 0xabcd correctly
|
||||
if (errno == ERANGE) return false;
|
||||
// Same, for unsigned long long
|
||||
//
|
||||
inline bool parse_ulonglong(const char* buf, const char* tag, unsigned long long& x) {
|
||||
const char* p = strstr(buf, tag);
|
||||
if (!p) return false;
|
||||
unsigned long long y = strtoull(p+strlen(tag), NULL, 0); // this parses 0xabcd correctly
|
||||
if (errno == ERANGE) return false;
|
||||
x = y;
|
||||
return true;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
extern bool parse(char* , char* );
|
||||
extern bool parse_str(const char*, const char*, char*, int);
|
||||
extern bool parse_str(const char* buf, const char* tag, std::string& dest);
|
||||
|
|
Loading…
Reference in New Issue