Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Detectors/Align/Workflow/src/BarrelAlignmentSpec.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
#include "CommonUtils/TreeStreamRedirector.h"
#include "TPCCalibration/VDriftHelper.h"
#include "TPCCalibration/CorrectionMapsLoader.h"
#include "GPUO2Interface.h"
#include "GPUO2ExternalUser.h"
#include "GPUO2InterfaceUtils.h"
#include "GPUParam.h"
#include "Headers/DataHeader.h"
Expand Down
2 changes: 1 addition & 1 deletion Detectors/Align/include/Align/Controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
#include <TTree.h>
#include <TFile.h>
#include "Align/Mille.h"
// #include "GPUO2Interface.h"
// #include "GPUO2ExternalUser.h"
// #include "DataFormatsTPC/WorkflowHelper.h"

namespace o2
Expand Down
2 changes: 1 addition & 1 deletion Detectors/Align/src/AlignableDetectorTPC.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include "DataFormatsTPC/WorkflowHelper.h"
#include <TMath.h>
#include <TGeoManager.h>
#include "GPUO2Interface.h"
#include "GPUO2ExternalUser.h"
#include "DataFormatsTPC/WorkflowHelper.h"
#include "GPUParam.inc"

Expand Down
2 changes: 1 addition & 1 deletion Detectors/Align/src/Controller.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
#include <TH1F.h>
#include <TList.h>
#include <cstdio>
#include "GPUO2Interface.h"
#include "GPUO2ExternalUser.h"
#include "DataFormatsTPC/WorkflowHelper.h"
#include <TGeoGlobalMagField.h>
#include "CommonUtils/NameConf.h"
Expand Down
2 changes: 1 addition & 1 deletion Detectors/GlobalTracking/src/MatchTPCITS.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.

#include "GPUO2Interface.h" // Needed for propper settings in GPUParam.h
#include "GPUO2ExternalUser.h" // Needed for propper settings in GPUParam.h
#include "GPUParam.h"
#include "GPUParam.inc"
#ifdef WITH_OPENMP
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
#include "TPCCalibration/VDriftHelper.h"
#include "TPCCalibration/CorrectionMapsLoader.h"
#include "GPUO2InterfaceRefit.h"
#include "GPUO2Interface.h" // Needed for propper settings in GPUParam.h
#include "GPUO2ExternalUser.h" // Needed for propper settings in GPUParam.h
#include "GPUParam.h"
#include "GPUParam.inc"
#include "GPUTPCGeometry.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include "DataFormatsCalibration/MeanVertexObject.h"

#include "GPUDataTypes.h"
#include "GPUO2Interface.h"
#include "GPUO2ExternalUser.h"
#include "GPUChainITS.h"

#include <oneapi/tbb/task_arena.h>
Expand Down
2 changes: 1 addition & 1 deletion Detectors/TPC/calibration/src/CalibPadGainTracks.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include "CorrectionMapsHelper.h"
#include "TPCReconstruction/TPCFastTransformHelperO2.h"
#include "GPUO2InterfaceRefit.h"
#include "GPUO2Interface.h"
#include "GPUO2ExternalUser.h"
#include "DataFormatsTPC/ClusterNative.h"
#include "DataFormatsTPC/VDriftCorrFact.h"
#include "DetectorsBase/Propagator.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include "DataFormatsTPC/Digit.h"
#include "DataFormatsTPC/ClusterNative.h"

#include "GPUO2Interface.h"
#include "GPUO2ExternalUser.h"
#include "GPUO2InterfaceConfiguration.h"
#include "TPCBase/Sector.h"
#include "Framework/Logger.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include "Framework/Task.h"
#include "TStopwatch.h"
#include "TRDBase/GeometryFlat.h"
#include "GPUO2Interface.h"
#include "GPUO2ExternalUser.h"
#include "GPUTRDTracker.h"
#include "ReconstructionDataFormats/GlobalTrackID.h"
#include "DataFormatsGlobalTracking/RecoContainer.h"
Expand Down
11 changes: 11 additions & 0 deletions GPU/GPUTracking/Base/GPUMemoryResource.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,15 @@
/// \author David Rohr

#include "GPUMemoryResource.h"
#include "GPUProcessor.h"
using namespace o2::gpu;

void* GPUMemoryResource::SetPointers(void* ptr) const
{
return (mProcessor->*mSetPointers)(ptr);
}

void* GPUMemoryResource::SetDevicePointers(void* ptr) const
{
return (mProcessor->mLinkedProcessor->*mSetPointers)(ptr);
}
16 changes: 8 additions & 8 deletions GPU/GPUTracking/Base/GPUMemoryResource.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,14 @@
#define GPUMEMORYRESOURCE_H

#include "GPUCommonDef.h"
#include "GPUProcessor.h"
#ifndef GPUCA_GPUCODE_DEVICE
#include <cstddef>
#endif

namespace o2::gpu
{

class GPUProcessor;
struct GPUMemoryReuse {
enum Type : int32_t {
NONE = 0,
Expand Down Expand Up @@ -80,13 +83,10 @@ class GPUMemoryResource
}
GPUMemoryResource(const GPUMemoryResource&) = default;

void* SetPointers(void* ptr)
{
return (mProcessor->*mSetPointers)(ptr);
}
void* SetDevicePointers(void* ptr) { return (mProcessor->mLinkedProcessor->*mSetPointers)(ptr); }
void* Ptr() { return mPtr; }
void* PtrDevice() { return mPtrDevice; }
void* SetPointers(void* ptr) const;
void* SetDevicePointers(void* ptr) const;
void* Ptr() const { return mPtr; }
void* PtrDevice() const { return mPtrDevice; }
size_t Size() const { return mSize; }
const char* Name() const { return mName; }
MemoryType Type() const { return mType; }
Expand Down
2 changes: 1 addition & 1 deletion GPU/GPUTracking/Base/GPUReconstruction.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ size_t GPUReconstruction::AllocateRegisteredPermanentMemory()
return total;
}

size_t GPUReconstruction::AllocateRegisteredMemoryHelper(GPUMemoryResource* res, void*& ptr, void*& memorypool, void* memorybase, size_t memorysize, void* (GPUMemoryResource::*setPtr)(void*), void*& memorypoolend, const char* device)
size_t GPUReconstruction::AllocateRegisteredMemoryHelper(GPUMemoryResource* res, void*& ptr, void*& memorypool, void* memorybase, size_t memorysize, void* (GPUMemoryResource::*setPtr)(void*) const, void*& memorypoolend, const char* device)
{
if (res->mReuse >= 0) {
ptr = (&ptr == &res->mPtrDevice) ? mMemoryResources[res->mReuse].mPtrDevice : mMemoryResources[res->mReuse].mPtr;
Expand Down
9 changes: 4 additions & 5 deletions GPU/GPUTracking/Base/GPUReconstruction.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,9 @@
#include "GPUDataTypes.h"
#include "GPUMemoryResource.h"
#include "GPUOutputControl.h"

/*#include "GPUParam.h"
#include "GPUSettings.h"
#include "GPULogging.h"*/
#include "GPUParam.h"
#include "GPUConstantMem.h"
#include "GPUDef.h"

namespace o2::its
{
Expand Down Expand Up @@ -280,7 +279,7 @@ class GPUReconstruction
static std::string getBackendVersions();

// Private helper functions for memory management
size_t AllocateRegisteredMemoryHelper(GPUMemoryResource* res, void*& ptr, void*& memorypool, void* memorybase, size_t memorysize, void* (GPUMemoryResource::*SetPointers)(void*), void*& memorypoolend, const char* device);
size_t AllocateRegisteredMemoryHelper(GPUMemoryResource* res, void*& ptr, void*& memorypool, void* memorybase, size_t memorysize, void* (GPUMemoryResource::*SetPointers)(void*) const, void*& memorypoolend, const char* device);
size_t AllocateRegisteredPermanentMemory();

// Private helper functions for reading / writing / allocating IO buffer from/to file
Expand Down
4 changes: 1 addition & 3 deletions GPU/GPUTracking/Definitions/GPUDefConstantsAndSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include "GPUCommonDef.h"

#if !defined(GPUCA_STANDALONE) && !defined(GPUCA_O2_LIB) && !defined(GPUCA_O2_INTERFACE)
#error You are using the CA GPU tracking without defining the build type (O2/Standalone). If you are running an O2 ROOT macro, please include GPUO2Interface.h first!
#error You are using the CA GPU tracking without defining the build type (O2/Standalone). If you are running an O2 ROOT macro, please include GPUO2ExternalUser.h first!
#endif

#if (defined(GPUCA_O2_LIB) && defined(GPUCA_STANDALONE))
Expand All @@ -35,8 +35,6 @@
#define GPUCA_MERGER_MAX_TRACK_CLUSTERS 1024 // Maximum number of clusters a track may have after merging

#define GPUCA_MAXN 40 // Maximum number of neighbor hits to consider in one row in neightbors finder
#define GPUCA_MIN_TRACK_PTB5_DEFAULT 0.010f // Default setting for minimum track Pt at some places (at B=0.5T)
#define GPUCA_MIN_TRACK_PTB5_REJECT_DEFAULT 0.050f // Default setting for Pt (at B=0.5T) where tracks are rejected

#define GPUCA_MAX_SIN_PHI_LOW 0.99f // Limits for maximum sin phi during fit
#define GPUCA_MAX_SIN_PHI 0.999f // Must be preprocessor define because c++ pre 11 cannot use static constexpr for initializes
Expand Down
6 changes: 3 additions & 3 deletions GPU/GPUTracking/Definitions/GPUSettingsList.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
// Create plain-C struct for GPU code.
// Create static constexpr with default values for GPU run time compilation

#include "GPUDefConstantsAndSettings.h"
#include "GPUCommonDef.h"
#ifndef GPUSETTINGS_H
#error Please include GPUSettings.h!
#endif
Expand All @@ -39,7 +39,7 @@ BeginNamespace(gpu)

// Reconstruction parameters for TPC, no bool in here !!!
BeginSubConfig(GPUSettingsRecTPC, tpc, configStandalone.rec, "RECTPC", 0, "Reconstruction settings", rec_tpc)
AddOptionRTC(rejectQPtB5, float, 1.f / GPUCA_MIN_TRACK_PTB5_REJECT_DEFAULT, "", 0, "QPt threshold to reject clusters of TPC tracks (Inverse Pt, scaled to B=0.5T!!!)")
AddOptionRTC(rejectQPtB5, float, 1.f / 0.050f, "", 0, "QPt threshold to reject clusters of TPC tracks (Inverse Pt, scaled to B=0.5T!!!)")
AddOptionRTC(hitPickUpFactor, float, 1.f, "", 0, "multiplier for the combined cluster+track error during track following")
AddOptionRTC(hitSearchArea2, float, 2.f, "", 0, "square of maximum search road of hits during seeding")
AddOptionRTC(neighboursSearchArea, float, 3.f, "", 0, "area in cm for the search of neighbours, for z only used if searchWindowDZDR = 0")
Expand Down Expand Up @@ -195,7 +195,7 @@ EndConfig()

// Global reconstruction parameters, no bool in here !!!
BeginSubConfig(GPUSettingsRec, rec, configStandalone, "REC", 0, "Reconstruction settings", rec)
AddOptionRTC(maxTrackQPtB5, float, 1.f / GPUCA_MIN_TRACK_PTB5_DEFAULT, "", 0, "required max Q/Pt (==min Pt) of tracks")
AddOptionRTC(maxTrackQPtB5, float, 1.f / 0.010f, "", 0, "required max Q/Pt (==min Pt) of tracks")
AddOptionRTC(fwdTPCDigitsAsClusters, uint8_t, 0, "", 0, "Forward TPC digits as clusters (if they pass the ZS threshold)")
AddOptionRTC(bz0Pt10MeV, uint8_t, 60, "", 0, "Nominal Pt to set when bz = 0 (in 10 MeV)")
AddOptionRTC(fitInProjections, int8_t, -1, "", 0, "Fit in projection, -1 to enable full fit for all but passes but the first one")
Expand Down
2 changes: 1 addition & 1 deletion GPU/GPUTracking/Interface/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ if(OPENGL_FOUND
endif()

string(REPLACE ".cxx" ".h" HDRS_TMP "${SRCS}")
set(HDRS ${HDRS_TMP})
set(HDRS ${HDRS_TMP} GPUO2ExternalUser.h)

o2_add_library(${MODULE}
SOURCES ${SRCS}
Expand Down
26 changes: 26 additions & 0 deletions GPU/GPUTracking/Interface/GPUO2ExternalUser.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.

/// \file GPUO2ExternalUser.h
/// \author David Rohr

#ifndef GPUO2EXTERNALUSER_H
#define GPUO2EXTERNALUSER_H

// Some defines denoting that we are compiling for O2
#ifndef GPUCA_TPC_GEOMETRY_O2
#define GPUCA_TPC_GEOMETRY_O2
#endif
#ifndef GPUCA_O2_INTERFACE
#define GPUCA_O2_INTERFACE
#endif

#endif
12 changes: 3 additions & 9 deletions GPU/GPUTracking/Interface/GPUO2Interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,13 @@
#ifndef GPUO2INTERFACE_H
#define GPUO2INTERFACE_H

// Some defines denoting that we are compiling for O2
#ifndef GPUCA_TPC_GEOMETRY_O2
#define GPUCA_TPC_GEOMETRY_O2
#endif
#ifndef GPUCA_O2_INTERFACE
#define GPUCA_O2_INTERFACE
#endif
#include "GPUO2ExternalUser.h"
#include "GPUCommonDef.h"
#include "GPUDataTypes.h"

#include <memory>
#include <array>
#include <vector>
#include "GPUCommonDef.h"
#include "GPUDataTypes.h"

namespace o2::base
{
Expand Down
8 changes: 2 additions & 6 deletions GPU/GPUTracking/Interface/GPUO2InterfaceConfigurableParam.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,8 @@
#ifndef GPUO2INTERFACECONFIGURABLEPARAM_H
#define GPUO2INTERFACECONFIGURABLEPARAM_H

// Some defines denoting that we are compiling for O2
#ifndef GPUCA_TPC_GEOMETRY_O2
#define GPUCA_TPC_GEOMETRY_O2
#endif
#ifndef GPUCA_O2_INTERFACE
#define GPUCA_O2_INTERFACE
#if !defined(GPUCA_STANDALONE) && !defined(GPUCA_O2_LIB)
#include "GPUO2ExternalUser.h"
#endif

#include "CommonUtils/ConfigurableParam.h"
Expand Down
18 changes: 6 additions & 12 deletions GPU/GPUTracking/Interface/GPUO2InterfaceConfiguration.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,17 @@
#ifndef GPUO2INTERFACECONFIGURATION_H
#define GPUO2INTERFACECONFIGURATION_H

#ifndef GPUCA_TPC_GEOMETRY_O2
#define GPUCA_TPC_GEOMETRY_O2
#endif
#ifndef GPUCA_O2_INTERFACE
#define GPUCA_O2_INTERFACE
#endif

#include <memory>
#include <array>
#include <vector>
#include <functional>
#include <gsl/gsl>
#include "GPUO2ExternalUser.h"
#include "GPUSettings.h"
#include "GPUDataTypes.h"
#include "GPUHostDataTypes.h"
#include "GPUOutputControl.h"
#include "DataFormatsTPC/Constants.h"
#include <memory>
#include <array>
#include <vector>
#include <functional>
#include <gsl/gsl> // TODO: Get rid of gsl

class TH1F;
class TH1D;
Expand Down
9 changes: 1 addition & 8 deletions GPU/GPUTracking/Interface/GPUO2InterfaceDisplay.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,7 @@
#ifndef GPUO2INTERFACEDisplay_H
#define GPUO2INTERFACEDisplay_H

// Some defines denoting that we are compiling for O2
#ifndef GPUCA_TPC_GEOMETRY_O2
#define GPUCA_TPC_GEOMETRY_O2
#endif
#ifndef GPUCA_O2_INTERFACE
#define GPUCA_O2_INTERFACE
#endif

#include "GPUO2ExternalUser.h"
#include <memory>
#include <vector>
#include "GPUDataTypes.h"
Expand Down
9 changes: 1 addition & 8 deletions GPU/GPUTracking/Interface/GPUO2InterfaceQA.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,7 @@
#ifndef GPUO2INTERFACEQA_H
#define GPUO2INTERFACEQA_H

// Some defines denoting that we are compiling for O2
#ifndef GPUCA_TPC_GEOMETRY_O2
#define GPUCA_TPC_GEOMETRY_O2
#endif
#ifndef GPUCA_O2_INTERFACE
#define GPUCA_O2_INTERFACE
#endif

#include "GPUO2ExternalUser.h"
#include <memory>
#include <vector>

Expand Down
9 changes: 1 addition & 8 deletions GPU/GPUTracking/Interface/GPUO2InterfaceRefit.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,7 @@
#ifndef GPUO2INTERFACEREFIT_H
#define GPUO2INTERFACEREFIT_H

// Some defines denoting that we are compiling for O2
#ifndef GPUCA_TPC_GEOMETRY_O2
#define GPUCA_TPC_GEOMETRY_O2
#endif
#ifndef GPUCA_O2_INTERFACE
#define GPUCA_O2_INTERFACE
#endif

#include "GPUO2ExternalUser.h"
#include <memory>
#include <vector>
#include <gsl/span>
Expand Down
1 change: 1 addition & 0 deletions GPU/GPUTracking/display/GPUDisplay.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "backend/GPUDisplayBackend.h"
#include "GPUDisplayInterface.h"
#include "GPUSettings.h"
#include "GPUDefConstantsAndSettings.h"

#include <array>
#include <mutex>
Expand Down
Loading