17#include "GPUDefParametersLoad.inc"
51 nThreads = std::max(1, nThreads);
70 if (nThreadsAdjusted > 1) {
71 tbb::task_arena(nThreadsAdjusted).execute([&] {
72 tbb::parallel_for<uint32_t>(0, nThreads, lambda, tbb::simple_partitioner());
75 for (uint32_t
i = 0;
i < nThreads;
i++) {
94std::atomic_flag GPUReconstructionProcessing::mTimerFlag = ATOMIC_FLAG_INIT;
98 while (mTimerFlag.test_and_set()) {
118 timerMeta*
retVal =
nullptr;
119 while (mTimerFlag.test_and_set()) {
129uint32_t GPUReconstructionProcessing::getNextTimerId()
131 static std::atomic<uint32_t>
id{0};
132 return id.fetch_add(1);
137 return std::make_unique<gpu_reconstruction_kernels::threadContext>();
144#define GPUCA_KRNL(x_class, ...) GPUCA_M_STR(GPUCA_M_KRNL_NAME(x_class)),
145#include "GPUReconstructionKernelList.h"
149#define GPUCA_KRNL(x_class, x_attributes, x_arguments, x_forward, x_types, x_num) \
151 uint32_t GPUReconstructionProcessing::GetKernelNum<GPUCA_M_KRNL_TEMPLATE(x_class)>() \
156 const char* GPUReconstructionProcessing::GetKernelName<GPUCA_M_KRNL_TEMPLATE(x_class)>() \
158 return GPUCA_M_STR(GPUCA_M_KRNL_NAME(x_class)); \
160#include "GPUReconstructionKernelList.h"
virtual std::unique_ptr< gpu_reconstruction_kernels::threadContext > GetThreadContext() override
void runParallelOuterLoop(bool doGPU, uint32_t nThreads, std::function< void(uint32_t)> lambda)
int32_t mActiveHostKernelThreads
std::vector< std::unique_ptr< timerMeta > > mTimers
void SetNActiveThreads(int32_t n)
GPUDefParameters * mParCPU
int32_t getNKernelHostThreads(bool splitCores)
static const std::vector< std::string > mKernelNames
uint32_t mNActiveThreadsOuterLoop
GPUReconstructionProcessing(const GPUSettingsDeviceBackend &cfg)
GPUDefParameters * mParDevice
uint32_t SetAndGetNActiveThreadsOuterLoop(bool condition, uint32_t max)
~GPUReconstructionProcessing() override
GPUReconstruction * mMaster
GPUSettingsProcessing mProcessingSettings
static int32_t getHostThreadIndex()
std::shared_ptr< GPUReconstructionThreading > mThreading
GLuint const GLchar * name
GLint GLint GLsizei GLint GLenum GLenum type
std::string to_string(gsl::span< T, Size > span)