some more work towards DKS/GPU support of musrfit
This commit is contained in:
@ -120,22 +120,31 @@ PFitter::PFitter(PMsrHandler *runInfo, PRunListCollection *runListCollection, Bo
|
||||
return;
|
||||
}
|
||||
|
||||
// get the DKS tag from the commands block
|
||||
UInt_t dksTag = fRunInfo->GetDKSTag();
|
||||
|
||||
// check if the theory function can already run on the GPU
|
||||
string theo = fRunInfo->GetDKSTheoryString();
|
||||
if (!theo.compare("??")) { // theory not yet DKS ready
|
||||
cout << endl << ">> PFitter::PFitter(): **INFO** theory not yet DKS/GPU ready. Will run on the CPU." << endl;
|
||||
} else {
|
||||
fDKSReady = true;
|
||||
cout << endl << ">> PFitter::PFitter(): **INFO** theory DKS/GPU ready. Will run on the GPU." << endl;
|
||||
if (dksTag != DKS_CPU_OPENMP) {
|
||||
if (!theo.compare("??")) { // theory not yet DKS ready
|
||||
cout << endl << ">> PFitter::PFitter(): **INFO** theory not yet DKS/GPU ready. Will run on the CPU." << endl;
|
||||
} else {
|
||||
fDKSReady = true;
|
||||
cout << endl << ">> PFitter::PFitter(): **INFO** theory DKS/GPU ready. Will run on the GPU." << endl;
|
||||
}
|
||||
}
|
||||
|
||||
// create fit function object depending whether DKS/GPU can be used or not
|
||||
if (fDKSReady) { // run on the GPU
|
||||
fFitterFcnDKS = new PFitterFcnDKS(runListCollection, fUseChi2);
|
||||
if (fDKSReady && (dksTag != DKS_CPU_OPENMP)) { // run on the GPU
|
||||
fFitterFcnDKS = new PFitterFcnDKS(runListCollection, fUseChi2, dksTag, theo);
|
||||
if (!fFitterFcnDKS) {
|
||||
fIsValid = false;
|
||||
}
|
||||
if (!fFitterFcnDKS->IsValid()) {
|
||||
fIsValid = false;
|
||||
}
|
||||
} else { // run on the CPU
|
||||
fDKSReady = false; // needed in case dksTag == DKS_CPU_OPENMP
|
||||
fFitterFcn = new PFitterFcn(runListCollection, fUseChi2);
|
||||
if (!fFitterFcn) {
|
||||
fIsValid = false;
|
||||
@ -388,6 +397,14 @@ Bool_t PFitter::CheckCommands()
|
||||
cmdLineNo++;
|
||||
if (it->fLine.Contains("COMMANDS", TString::kIgnoreCase)) {
|
||||
continue;
|
||||
} else if (it->fLine.Contains("OpenMP", TString::kIgnoreCase)) { // run on CPU using OpenMP
|
||||
continue;
|
||||
} else if (it->fLine.Contains("CUDA", TString::kIgnoreCase)) { // try to run DKS/GPU CUDA
|
||||
continue;
|
||||
} else if (it->fLine.Contains("OpenCL-GPU", TString::kIgnoreCase)) { // try to run DKS/GPU OpenCL
|
||||
continue;
|
||||
} else if (it->fLine.Contains("OpenCL-CPU", TString::kIgnoreCase)) { // try to run DKS/CPU OpenCL
|
||||
continue;
|
||||
} else if (it->fLine.Contains("SET BATCH", TString::kIgnoreCase)) { // needed for backward compatibility
|
||||
continue;
|
||||
} else if (it->fLine.Contains("END RETURN", TString::kIgnoreCase)) { // needed for backward compatibility
|
||||
|
Reference in New Issue
Block a user