mirror of https://github.com/BOINC/boinc.git
- client: compile fixes
svn path=/trunk/boinc/; revision=25773
This commit is contained in:
parent
2ccefde745
commit
b050deecf7
|
@ -4405,3 +4405,13 @@ David 18 June 2012
|
|||
client/
|
||||
gpu_detect.cpp,h
|
||||
Makefile.am
|
||||
|
||||
David 18 June 2012
|
||||
- client: compile fixes
|
||||
|
||||
client/
|
||||
gpu_opencl.cpp
|
||||
gpu_amd.cpp
|
||||
gpu_nvidia.cpp
|
||||
lib/
|
||||
coproc.cpp,h
|
||||
|
|
|
@ -43,7 +43,7 @@ using std::string;
|
|||
#include "util.h"
|
||||
|
||||
#include "client_msgs.h"
|
||||
#include "gpu.h"
|
||||
#include "gpu_detect.h"
|
||||
|
||||
// criteria:
|
||||
//
|
||||
|
|
|
@ -39,7 +39,7 @@ using std::string;
|
|||
#include "util.h"
|
||||
|
||||
#include "client_msgs.h"
|
||||
#include "gpu.h"
|
||||
#include "gpu_detect.h"
|
||||
|
||||
// return 1/-1/0 if device 1 is more/less/same capable than device 2.
|
||||
// factors (decreasing priority):
|
||||
|
|
|
@ -39,7 +39,7 @@ using std::string;
|
|||
#include "util.h"
|
||||
|
||||
#include "client_msgs.h"
|
||||
#include "gpu.h"
|
||||
#include "gpu_detect.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
|
|
|
@ -70,8 +70,34 @@ int COPROC_REQ::parse(XML_PARSER& xp) {
|
|||
return ERR_XML_PARSE;
|
||||
}
|
||||
|
||||
int PCI_INFO::parse(XML_PARSER& xp) {
|
||||
present = false;
|
||||
bus_id = device_id = domain_id = 0;
|
||||
while (!xp.get_tag()) {
|
||||
if (xp.match_tag("/pci_info")) {
|
||||
return 0;
|
||||
}
|
||||
if (xp.parse_int("bus_id", bus_id)) continue;
|
||||
if (xp.parse_int("device_id", device_id)) continue;
|
||||
if (xp.parse_int("domain_id", domain_id)) continue;
|
||||
}
|
||||
return ERR_XML_PARSE;
|
||||
}
|
||||
|
||||
#ifndef _USING_FCGI_
|
||||
|
||||
void PCI_INFO::write(MIOFILE& f) {
|
||||
f.printf(
|
||||
"<pci_info>\n"
|
||||
" <bus_id>%d</bus_id>\n"
|
||||
" <device_id>%d</device_id>\n"
|
||||
" <domain_id>%d</domain_id>\n",
|
||||
bus_id,
|
||||
device_id,
|
||||
domain_id
|
||||
);
|
||||
}
|
||||
|
||||
void COPROC::write_xml(MIOFILE& f) {
|
||||
f.printf(
|
||||
"<coproc>\n"
|
||||
|
@ -332,15 +358,15 @@ int COPROCS::parse(XML_PARSER& xp) {
|
|||
return ERR_XML_PARSE;
|
||||
}
|
||||
|
||||
void COPROCS::write_xml(MIOFILE& mf, bool include_request) {
|
||||
void COPROCS::write_xml(MIOFILE& mf, bool scheduler_rpc) {
|
||||
#ifndef _USING_FCGI_
|
||||
//TODO: Write coprocs[0] through coprocs[n_rsc]
|
||||
mf.printf(" <coprocs>\n");
|
||||
if (nvidia.count) {
|
||||
nvidia.write_xml(mf, include_request);
|
||||
nvidia.write_xml(mf, scheduler_rpc);
|
||||
}
|
||||
if (ati.count) {
|
||||
ati.write_xml(mf, include_request);
|
||||
ati.write_xml(mf, scheduler_rpc);
|
||||
}
|
||||
mf.printf(" </coprocs>\n");
|
||||
#endif
|
||||
|
@ -376,7 +402,7 @@ void COPROC_NVIDIA::description(char* buf) {
|
|||
}
|
||||
|
||||
#ifndef _USING_FCGI_
|
||||
void COPROC_NVIDIA::write_xml(MIOFILE& f, bool include_request) {
|
||||
void COPROC_NVIDIA::write_xml(MIOFILE& f, bool scheduler_rpc) {
|
||||
f.printf(
|
||||
"<coproc_cuda>\n"
|
||||
" <count>%d</count>\n"
|
||||
|
@ -390,7 +416,7 @@ void COPROC_NVIDIA::write_xml(MIOFILE& f, bool include_request) {
|
|||
have_cuda ? 1 : 0,
|
||||
have_opencl ? 1 : 0
|
||||
);
|
||||
if (include_request) {
|
||||
if (scheduler_rpc) {
|
||||
write_request(f);
|
||||
}
|
||||
f.printf(
|
||||
|
@ -411,10 +437,7 @@ void COPROC_NVIDIA::write_xml(MIOFILE& f, bool include_request) {
|
|||
" <minor>%d</minor>\n"
|
||||
" <textureAlignment>%u</textureAlignment>\n"
|
||||
" <deviceOverlap>%d</deviceOverlap>\n"
|
||||
" <multiProcessorCount>%d</multiProcessorCount>\n"
|
||||
" <pciBusID>%d</pciBusID>\n"
|
||||
" <pciDeviceID>%d</pciDeviceID>\n"
|
||||
" <pciDomainID>%d</pciDomainID>\n",
|
||||
" <multiProcessorCount>%d</multiProcessorCount>\n",
|
||||
peak_flops,
|
||||
cuda_version,
|
||||
display_driver_version,
|
||||
|
@ -432,15 +455,18 @@ void COPROC_NVIDIA::write_xml(MIOFILE& f, bool include_request) {
|
|||
prop.minor,
|
||||
(unsigned int)prop.textureAlignment,
|
||||
prop.deviceOverlap,
|
||||
prop.multiProcessorCount,
|
||||
prop.pciBusID,
|
||||
prop.pciDeviceID,
|
||||
prop.pciDomainID
|
||||
prop.multiProcessorCount
|
||||
);
|
||||
|
||||
if (have_opencl) {
|
||||
opencl_prop.write_xml(f);
|
||||
}
|
||||
|
||||
if (!scheduler_rpc) {
|
||||
for (int i=0; i<count; i++) {
|
||||
pci_infos[i].write(f);
|
||||
}
|
||||
}
|
||||
|
||||
f.printf("</coproc_cuda>\n");
|
||||
}
|
||||
|
@ -473,14 +499,12 @@ void COPROC_NVIDIA::clear() {
|
|||
prop.textureAlignment = 0;
|
||||
prop.deviceOverlap = 0;
|
||||
prop.multiProcessorCount = 0;
|
||||
prop.pciBusID = 0;
|
||||
prop.pciDeviceID = 0;
|
||||
prop.pciDomainID = 0;
|
||||
}
|
||||
|
||||
int COPROC_NVIDIA::parse(XML_PARSER& xp) {
|
||||
char buf2[256];
|
||||
int retval;
|
||||
int ipci = 0;
|
||||
|
||||
clear();
|
||||
while (!xp.get_tag()) {
|
||||
|
@ -548,9 +572,13 @@ int COPROC_NVIDIA::parse(XML_PARSER& xp) {
|
|||
if (xp.parse_int("textureAlignment", (int&)prop.textureAlignment)) continue;
|
||||
if (xp.parse_int("deviceOverlap", prop.deviceOverlap)) continue;
|
||||
if (xp.parse_int("multiProcessorCount", prop.multiProcessorCount)) continue;
|
||||
if (xp.parse_int("pciBusID", prop.pciBusID)) continue;
|
||||
if (xp.parse_int("pciDeviceID", prop.pciDeviceID)) continue;
|
||||
if (xp.parse_int("pciDomainID", prop.pciDomainID)) continue;
|
||||
if (xp.match_tag("pci_info")) {
|
||||
PCI_INFO p;
|
||||
p.parse(xp);
|
||||
if (ipci < MAX_COPROC_INSTANCES) {
|
||||
pci_infos[ipci++] = p;
|
||||
}
|
||||
}
|
||||
if (xp.match_tag("coproc_opencl")) {
|
||||
retval = opencl_prop.parse(xp);
|
||||
if (retval) return retval;
|
||||
|
@ -637,7 +665,7 @@ void COPROC_NVIDIA::fake(
|
|||
////////////////// ATI STARTS HERE /////////////////
|
||||
|
||||
#ifndef _USING_FCGI_
|
||||
void COPROC_ATI::write_xml(MIOFILE& f, bool include_request) {
|
||||
void COPROC_ATI::write_xml(MIOFILE& f, bool scheduler_rpc) {
|
||||
f.printf(
|
||||
"<coproc_ati>\n"
|
||||
" <count>%d</count>\n"
|
||||
|
@ -651,7 +679,7 @@ void COPROC_ATI::write_xml(MIOFILE& f, bool include_request) {
|
|||
have_cal ? 1 : 0,
|
||||
have_opencl ? 1 : 0
|
||||
);
|
||||
if (include_request) {
|
||||
if (scheduler_rpc) {
|
||||
write_request(f);
|
||||
}
|
||||
f.printf(
|
||||
|
|
11
lib/coproc.h
11
lib/coproc.h
|
@ -105,9 +105,13 @@ struct COPROC_REQ {
|
|||
};
|
||||
|
||||
struct PCI_INFO {
|
||||
bool present;
|
||||
int bus_id;
|
||||
int device_id;
|
||||
int domain_id;
|
||||
|
||||
void write(MIOFILE&);
|
||||
int parse(XML_PARSER&);
|
||||
};
|
||||
|
||||
// there's some duplication between the values in
|
||||
|
@ -234,6 +238,7 @@ struct COPROC {
|
|||
running_graphics_app[i] = true;
|
||||
}
|
||||
memset(&opencl_prop, 0, sizeof(opencl_prop));
|
||||
memset(&pci_info, 0, sizeof(pci_info));
|
||||
}
|
||||
inline void clear_usage() {
|
||||
for (int i=0; i<count; i++) {
|
||||
|
@ -300,7 +305,7 @@ struct COPROC_NVIDIA : public COPROC {
|
|||
COPROC_USAGE is_used; // temp used in scan process
|
||||
|
||||
#ifndef _USING_FCGI_
|
||||
void write_xml(MIOFILE&, bool include_request);
|
||||
void write_xml(MIOFILE&, bool scheduler_rpc);
|
||||
#endif
|
||||
COPROC_NVIDIA(): COPROC(GPU_TYPE_NVIDIA){}
|
||||
void get(
|
||||
|
@ -337,7 +342,7 @@ struct COPROC_ATI : public COPROC {
|
|||
COPROC_USAGE is_used; // temp used in scan process
|
||||
|
||||
#ifndef _USING_FCGI_
|
||||
void write_xml(MIOFILE&, bool include_request);
|
||||
void write_xml(MIOFILE&, bool scheduler_rpc);
|
||||
#endif
|
||||
COPROC_ATI(): COPROC(GPU_TYPE_ATI){}
|
||||
void get(
|
||||
|
@ -359,7 +364,7 @@ struct COPROCS {
|
|||
COPROC_NVIDIA nvidia;
|
||||
COPROC_ATI ati;
|
||||
|
||||
void write_xml(MIOFILE& out, bool include_request);
|
||||
void write_xml(MIOFILE& out, bool scheduler_rpc);
|
||||
void get(
|
||||
bool use_all,
|
||||
std::vector<std::string> &descs,
|
||||
|
|
Loading…
Reference in New Issue