some more work towards DKS/GPU support of musrfit

This commit is contained in:
2016-03-10 15:52:48 +01:00
parent 7b292980e5
commit 5fb2ce777e
7 changed files with 170 additions and 20 deletions

View File

@ -6090,6 +6090,52 @@ std::string PMsrHandler::GetDKSTheoryString()
return result;
}
//--------------------------------------------------------------------------
// GetDKSTag (public)
//--------------------------------------------------------------------------
/**
* <p> Checks the COMMAND block for DKS related tags. Currently the following
* tags are allowed:
* (i) OpenMP: which means run on the CPU with OpenMP
* (ii) Cuda: which means run on the GPU using Cuda
* (iii) OpenCL-CPU: which means run on the CPU with OpenCL
* (iv) OpenCL-GPU: which means run on the GPU with OpenCL
*
* @return DKS tag
*/
UInt_t PMsrHandler::GetDKSTag()
{
UInt_t count=0;
UInt_t tag = DKS_CPU_OPENMP;
TString last("");
for (UInt_t i=0; i<fCommands.size(); i++) {
if (fCommands[i].fLine.Contains("OpenMP", TString::kIgnoreCase)) {
count++;
tag = DKS_CPU_OPENMP;
last = "OpenMP";
} else if (fCommands[i].fLine.Contains("Cuda", TString::kIgnoreCase)) {
count++;
tag = DKS_GPU_CUDA;
last = "Cuda";
} else if (fCommands[i].fLine.Contains("OpenCL-CPU", TString::kIgnoreCase)) {
count++;
tag = DKS_CPU_OPENCL;
last = "OpenCL-CPU";
} else if (fCommands[i].fLine.Contains("OpenCL-GPU", TString::kIgnoreCase)) {
count++;
tag = DKS_GPU_OPENCL;
last = "OpenCL-GPU";
}
}
if (count > 1) {
cerr << ">> PMsrHandler::GetDKSTag(): **WARNING** found multiple DKS tags, will use the last one found: '" << last.Data() << "'" << endl;
}
return tag;
}
//--------------------------------------------------------------------------
// HandleTheoryArguments (private)
//--------------------------------------------------------------------------