client: write / parse OpenCL info in COPROC XML data

svn path=/trunk/boinc/; revision=24027
This commit is contained in:
Charlie Fenton 2011-08-23 12:45:07 +00:00
parent 2d23571541
commit 0c39d8e9d9
2 changed files with 19 additions and 9 deletions

View File

@ -308,13 +308,29 @@ void COPROC_NVIDIA::description(char* buf) {
#ifndef _USING_FCGI_
void COPROC_NVIDIA::write_xml(MIOFILE& f, bool include_request) {
unsigned long long test;
test = strtoull("0x123456789abc", NULL, 0);
f.printf(
"<coproc_cuda>\n"
" <count>%d</count>\n"
" <name>%s</name>\n"
" <have_cuda>%d</have_cuda>\n"
" <have_cal>%d</have_cal>\n"
" <have_opencl>%d</have_opencl>\n"
" <have_opencl>%d</have_opencl>\n",
count,
prop.name,
have_cuda ? 1 : 0,
have_cal ? 1 : 0,
have_opencl ? 1 : 0
);
if (include_request) {
write_request(f);
}
f.printf(
" <peak_flops>%f</peak_flops>\n"
" <cudaVersion>%d</cudaVersion>\n"
" <drvVersion>%d</drvVersion>\n"
@ -334,11 +350,6 @@ void COPROC_NVIDIA::write_xml(MIOFILE& f, bool include_request) {
" <textureAlignment>%u</textureAlignment>\n"
" <deviceOverlap>%d</deviceOverlap>\n"
" <multiProcessorCount>%d</multiProcessorCount>\n",
count,
prop.name,
have_cuda ? 1 : 0,
have_cal ? 1 : 0,
have_opencl ? 1 : 0,
peak_flops,
cuda_version,
display_driver_version,

View File

@ -84,13 +84,12 @@ inline unsigned long long strtoull(const char *s, char **, int) {
unsigned long long y;
strncpy(buf, s, sizeof(buf)-1);
strip_whitespace(buf);
p = buf;
p = strstr(buf, "0x");
if (!p) p = strstr(buf, "0X");
if (p) {
sscanf(p, "llx", &y);
sscanf(p, "%llx", &y);
} else {
sscanf(buf, "llu", &y);
sscanf(buf, "%llu", &y);
}
return y;
}