14 Size granularity = 100;
20 granularity = newGranularity;
33 const Size granularity,
uint32_t Size
Integral type used to index arrays (by default).
#define NAMESPACE_SPH_END
Interface for executing tasks (potentially) asynchronously.
Interface that allows unified implementation of sequential and parallelized versions of algorithms.
Scheduler encapsulating OpenMP directives.
virtual SharedPtr< ITask > submit(const Function< void()> &task) override
Submits a task to be potentially executed asynchronously.
OmpScheduler(const Size numThreads=0)
virtual void parallelFor(const Size from, const Size to, const Size granularity, const Function< void(Size n1, Size n2)> &functor) override
Processes the given range concurrently.
virtual Size getRecommendedGranularity() const override
Returns a value of granularity that is expected to perform well with the current thread count.
static SharedPtr< OmpScheduler > getGlobalInstance()
virtual Optional< Size > getThreadIdx() const override
Returns the index of the calling thread.
virtual Size getThreadCnt() const override
Returns the number of threads used by this scheduler.
void setGranularity(const Size newGranularity)