Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to create an o2 propagator instance uninitialized to be used with external matLut / gpuFieldMap #5320

Merged
merged 1 commit into from Jan 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions Detectors/Base/include/DetectorsBase/Propagator.h
Expand Up @@ -114,9 +114,9 @@ class Propagator
GPUd() void setBz(float bz) { mBz = bz; }

#ifndef GPUCA_GPUCODE
static Propagator* Instance()
static Propagator* Instance(bool uninitialized = false)
{
static Propagator instance;
static Propagator instance(uninitialized);
return &instance;
}

Expand All @@ -129,7 +129,7 @@ class Propagator

private:
#ifndef GPUCA_GPUCODE
Propagator();
Propagator(bool uninitialized = false);
~Propagator() = default;
#endif

Expand Down
7 changes: 5 additions & 2 deletions Detectors/Base/src/Propagator.cxx
Expand Up @@ -29,8 +29,11 @@ using namespace o2::gpu;
#include <FairRunAna.h> // eventually will get rid of it
#include <TGeoGlobalMagField.h>

Propagator::Propagator()
Propagator::Propagator(bool uninitialized)
{
if (uninitialized) {
return;
}
///< construct checking if needed components were initialized

// we need the geoemtry loaded
Expand Down Expand Up @@ -99,7 +102,7 @@ int Propagator::initFieldFromGRP(const o2::parameters::GRPObject* grp, bool verb
return 0;
}
#elif !defined(GPUCA_GPUCODE)
Propagator::Propagator()
Propagator::Propagator(bool uninitialized)
{
} // empty dummy constructor for standalone benchmark
#endif
Expand Down
2 changes: 1 addition & 1 deletion GPU/GPUTracking/Base/GPUParam.cxx
Expand Up @@ -257,7 +257,7 @@ o2::base::Propagator* GPUParam::GetDefaultO2Propagator(bool useGPUField) const
if (useGPUField == false) {
throw std::runtime_error("o2 propagator withouzt gpu field unsupported");
}
prop = o2::base::Propagator::Instance();
prop = o2::base::Propagator::Instance(useGPUField);
if (useGPUField) {
prop->setGPUField(&polynomialField);
prop->setBz(polynomialField.GetNominalBz());
Expand Down