Nebula
Loading...
Searching...
No Matches
Jobs2 Namespace Reference

Classes

struct  Callable
 
struct  CallableStub
 
struct  JobContext
 
struct  JobNode
 
struct  Jobs2Context
 
struct  JobSystemInitInfo
 
class  JobThread
 
struct  Lambda
 

Typedefs

typedef volatile long CompletionCounter
 
using JobFunc = void(*)(SizeT totalJobs, SizeT groupSize, IndexT groupIndex, SizeT invocationOffset, void* ctx)
 

Functions

 __ImplementClass (Jobs2::JobThread, 'J2TH', Threading::Thread)
 
void JobSystemInit (const JobSystemInitInfo &info)
 Create a new job port.
 
void JobSystemUninit ()
 Destroy job port.
 
void JobNewFrame ()
 Progress to new buffer.
 
void * JobAlloc (SizeT bytes)
 Allocate memory.
 
void JobSequencePlaceholder (SizeT totalJobs, SizeT groupSize, IndexT groupIndex, SizeT invocationOffset, void *ctx)
 
void JobBeginSequence (const Util::FixedArray< const Threading::AtomicCounter * > &waitCounters=nullptr, Threading::AtomicCounter *doneCounter=nullptr, Threading::Event *signalEvent=nullptr)
 Begin a sequence of jobs.
 
void JobEndSequence (Threading::Event *signalEvent=nullptr)
 Flush queued jobs.
 
template<typename T >
T * JobAlloc (SizeT count)
 Allocate memory and progress memory iterator.
 
template<typename CTX >
void JobAppendSequence (const JobFunc &func, const SizeT numInvocations, const SizeT groupSize, const CTX &context)
 Append job to sequence with an automatic dependency on the previous job.
 
template<typename CTX >
void JobAppendSequence (const JobFunc &func, const SizeT numInvocations, const CTX &context)
 Append job to sequence with an automatic dependency on the previous job, to run on a single thread.
 
template<typename LAMBDA >
void JobDispatch (LAMBDA &&func, const SizeT numInvocations, const SizeT groupSize, const Util::FixedArray< const Threading::AtomicCounter * > &waitCounters=nullptr, Threading::AtomicCounter *doneCounter=nullptr, Threading::Event *signalEvent=nullptr)
 
template<typename LAMBDA >
void JobDispatch (LAMBDA &&func, const SizeT numInvocations, const Util::FixedArray< const Threading::AtomicCounter * > &waitCounters=nullptr, Threading::AtomicCounter *doneCounter=nullptr, Threading::Event *signalEvent=nullptr)
 
template<typename CTX >
void JobDispatch (const JobFunc &func, const SizeT numInvocations, const SizeT groupSize, const CTX &context, const Util::FixedArray< const Threading::AtomicCounter * > &waitCounters=nullptr, Threading::AtomicCounter *doneCounter=nullptr, Threading::Event *signalEvent=nullptr)
 
template<typename CTX >
void JobDispatch (const JobFunc &func, const SizeT numInvocations, const CTX &context, const Util::FixedArray< const Threading::AtomicCounter * > &waitCounters=nullptr, Threading::AtomicCounter *doneCounter=nullptr, Threading::Event *signalEvent=nullptr)
 

Variables

Jobs2Context ctx
 
Jobs2::JobNodesequenceNode = nullptr
 
Jobs2::JobNodesequenceTail = nullptr
 
const Threading::AtomicCounterprevDoneCounter = nullptr
 
Threading::ThreadId sequenceThread
 

Typedef Documentation

◆ CompletionCounter

typedef volatile long Jobs2::CompletionCounter

◆ JobFunc

using Jobs2::JobFunc = void(*)(SizeT totalJobs, SizeT groupSize, IndexT groupIndex, SizeT invocationOffset, void* ctx)

Function Documentation

◆ __ImplementClass()

Jobs2::__ImplementClass ( Jobs2::JobThread ,
'J2TH' ,
Threading::Thread  )

◆ JobAlloc() [1/2]

void * Jobs2::JobAlloc ( SizeT bytes)

Allocate memory.

◆ JobAlloc() [2/2]

template<typename T >
T * Jobs2::JobAlloc ( SizeT count)

Allocate memory and progress memory iterator.

◆ JobAppendSequence() [1/2]

template<typename CTX >
void Jobs2::JobAppendSequence ( const JobFunc & func,
const SizeT numInvocations,
const CTX & context )

Append job to sequence with an automatic dependency on the previous job, to run on a single thread.

◆ JobAppendSequence() [2/2]

template<typename CTX >
void Jobs2::JobAppendSequence ( const JobFunc & func,
const SizeT numInvocations,
const SizeT groupSize,
const CTX & context )

Append job to sequence with an automatic dependency on the previous job.

◆ JobBeginSequence()

void Jobs2::JobBeginSequence ( const Util::FixedArray< const Threading::AtomicCounter * > & waitCounters,
Threading::AtomicCounter * doneCounter,
Threading::Event * signalEvent )

Begin a sequence of jobs.

◆ JobDispatch() [1/4]

template<typename CTX >
void Jobs2::JobDispatch ( const JobFunc & func,
const SizeT numInvocations,
const CTX & context,
const Util::FixedArray< const Threading::AtomicCounter * > & waitCounters = nullptr,
Threading::AtomicCounter * doneCounter = nullptr,
Threading::Event * signalEvent = nullptr )

◆ JobDispatch() [2/4]

template<typename CTX >
void Jobs2::JobDispatch ( const JobFunc & func,
const SizeT numInvocations,
const SizeT groupSize,
const CTX & context,
const Util::FixedArray< const Threading::AtomicCounter * > & waitCounters = nullptr,
Threading::AtomicCounter * doneCounter = nullptr,
Threading::Event * signalEvent = nullptr )

◆ JobDispatch() [3/4]

template<typename LAMBDA >
void Jobs2::JobDispatch ( LAMBDA && func,
const SizeT numInvocations,
const SizeT groupSize,
const Util::FixedArray< const Threading::AtomicCounter * > & waitCounters = nullptr,
Threading::AtomicCounter * doneCounter = nullptr,
Threading::Event * signalEvent = nullptr )

◆ JobDispatch() [4/4]

template<typename LAMBDA >
void Jobs2::JobDispatch ( LAMBDA && func,
const SizeT numInvocations,
const Util::FixedArray< const Threading::AtomicCounter * > & waitCounters = nullptr,
Threading::AtomicCounter * doneCounter = nullptr,
Threading::Event * signalEvent = nullptr )

◆ JobEndSequence()

void Jobs2::JobEndSequence ( Threading::Event * signalEvent)

Flush queued jobs.

◆ JobNewFrame()

void Jobs2::JobNewFrame ( )

Progress to new buffer.

◆ JobSequencePlaceholder()

void Jobs2::JobSequencePlaceholder ( SizeT totalJobs,
SizeT groupSize,
IndexT groupIndex,
SizeT invocationOffset,
void * ctx )

◆ JobSystemInit()

void Jobs2::JobSystemInit ( const JobSystemInitInfo & info)

Create a new job port.

◆ JobSystemUninit()

void Jobs2::JobSystemUninit ( )

Destroy job port.

Variable Documentation

◆ ctx

Jobs2Context Jobs2::ctx

◆ prevDoneCounter

const Threading::AtomicCounter * Jobs2::prevDoneCounter = nullptr

◆ sequenceNode

JobNode * Jobs2::sequenceNode = nullptr

◆ sequenceTail

JobNode * Jobs2::sequenceTail = nullptr

◆ sequenceThread

Threading::ThreadId Jobs2::sequenceThread