- client: debug coprocessor code

svn path=/trunk/boinc/; revision=14981
This commit is contained in:
David Anderson 2008-03-28 21:22:48 +00:00
parent ca516450e4
commit 61663b48f9
5 changed files with 46 additions and 36 deletions

View File

@ -2577,11 +2577,11 @@ Charlie Mar 20 2008
buildWxMac.sh
David Mar 20 2008
- updated GeoIP stuff
- updated GeoIP stuff
html/inc/
GeoIP.dat
geoip.inc
html/inc/
GeoIP.dat
geoip.inc
Charlie Mar 20 2008
- Mac: Update sandbox security for symlinks replacing xml soft links.
@ -2797,3 +2797,12 @@ David Mar 28 2008
client_state.C
lib/
coproc.C,h
David Mar 28 2008
- client: debug coprocessor code
client/
client_state.C
cs_scheduler.C
lib/
coproc.C,h

View File

@ -243,8 +243,8 @@ int CLIENT_STATE::init() {
fake_cuda(coprocs);
#endif
for (i=0; i<coprocs.coprocs.size(); i++) {
COPROC& c = coprocs.coprocs[i];
msg_printf(NULL, MSG_INFO, "Coprocessor: %s (%d)", c.name, c.count);
COPROC* c = coprocs.coprocs[i];
msg_printf(NULL, MSG_INFO, "Coprocessor: %s (%d)", c->name, c->count);
}
// Check to see if we can write the state file.

View File

@ -223,8 +223,8 @@ int CLIENT_STATE::make_scheduler_request(PROJECT* p) {
if (coprocs.coprocs.size()) {
fprintf(f, " <coprocs>\n");
for (i=0; i<coprocs.coprocs.size(); i++) {
COPROC& c = coprocs.coprocs[i];
c.write_xml(f);
COPROC* c = coprocs.coprocs[i];
c->write_xml(f);
}
fprintf(f, " </coprocs>\n");
}

View File

@ -45,8 +45,8 @@ int COPROCS::parse(FILE* fin) {
while (fgets(buf, sizeof(buf), fin)) {
if (strstr(buf, "</coprocs>")) return 0;
if (strstr(buf, "<coproc_cuda>")) {
COPROC_CUDA cc;
int retval = cc.parse(fin);
COPROC_CUDA* cc = new COPROC_CUDA;
int retval = cc->parse(fin);
if (!retval) {
coprocs.push_back(cc);
}
@ -82,10 +82,10 @@ void COPROC_CUDA::get(COPROCS& coprocs) {
if (count < 1) return;
for (int i=0; i<count; i++) {
COPROC_CUDA cc;
(*__cudaGetDeviceProperties)(&cc.prop, i);
cc.count = 1;
strcpy(cc.name, cc.prop.name);
COPROC_CUDA* cc = new COPROC_CUDA;
(*__cudaGetDeviceProperties)(&cc->prop, i);
cc->count = 1;
strcpy(cc->name, "CUDA");
coprocs.coprocs.push_back(cc);
}
}
@ -93,26 +93,27 @@ void COPROC_CUDA::get(COPROCS& coprocs) {
// add a non-existent CUDA coproc (for debugging)
//
void fake_cuda(COPROCS& coprocs) {
COPROC_CUDA cc;
strcpy(cc.name, "cuda 0");
cc.count = 1;
cc.prop.totalGlobalMem = 1000;
cc.prop.sharedMemPerBlock = 100;
cc.prop.regsPerBlock = 8;
cc.prop.warpSize = 10;
cc.prop.memPitch = 10;
cc.prop.maxThreadsPerBlock = 20;
cc.prop.maxThreadsDim[0] = 2;
cc.prop.maxThreadsDim[1] = 2;
cc.prop.maxThreadsDim[2] = 2;
cc.prop.maxGridSize[0] = 10;
cc.prop.maxGridSize[1] = 10;
cc.prop.maxGridSize[2] = 10;
cc.prop.totalConstMem = 10;
cc.prop.major = 1;
cc.prop.minor = 1;
cc.prop.clockRate = 10000;
cc.prop.textureAlignment = 1000;
COPROC_CUDA* cc = new COPROC_CUDA;
strcpy(cc->name, "CUDA");
cc->count = 1;
strcpy(cc->prop.name, cc->name);
cc->prop.totalGlobalMem = 1000;
cc->prop.sharedMemPerBlock = 100;
cc->prop.regsPerBlock = 8;
cc->prop.warpSize = 10;
cc->prop.memPitch = 10;
cc->prop.maxThreadsPerBlock = 20;
cc->prop.maxThreadsDim[0] = 2;
cc->prop.maxThreadsDim[1] = 2;
cc->prop.maxThreadsDim[2] = 2;
cc->prop.maxGridSize[0] = 10;
cc->prop.maxGridSize[1] = 10;
cc->prop.maxGridSize[2] = 10;
cc->prop.totalConstMem = 10;
cc->prop.major = 1;
cc->prop.minor = 1;
cc->prop.clockRate = 10000;
cc->prop.textureAlignment = 1000;
coprocs.coprocs.push_back(cc);
}
@ -136,7 +137,7 @@ void COPROC_CUDA::write_xml(FILE* f) {
" <textureAlignment>%u</textureAlignment>\n"
"</coproc_cuda>\n",
count,
prop.name,
name,
(unsigned int)prop.totalGlobalMem,
(unsigned int)prop.sharedMemPerBlock,
prop.regsPerBlock,

View File

@ -31,7 +31,7 @@ struct COPROC {
};
struct COPROCS {
std::vector<COPROC> coprocs;
std::vector<COPROC*> coprocs;
COPROCS(){}
void get();