#include "pbrt.h"
#include <pthread.h>
#include <semaphore.h>
#include "core/probes.h"
Go to the source code of this file.
Classes | |
class | Mutex |
struct | MutexLock |
class | RWMutex |
struct | RWMutexLock |
class | Semaphore |
class | ConditionVariable |
class | Task |
Typedefs | |
typedef volatile int32_t | AtomicInt32 |
Enumerations | |
enum | RWMutexLockType { READ, WRITE } |
Functions | |
int32_t | AtomicAdd (AtomicInt32 *v, int32_t delta) |
int32_t | AtomicCompareAndSwap (AtomicInt32 *v, int32_t newValue, int32_t oldValue) |
template<typename T > | |
T * | AtomicCompareAndSwapPointer (T **v, T *newValue, T *oldValue) |
float | AtomicAdd (volatile float *val, float delta) |
void | TasksInit () |
void | TasksCleanup () |
void | EnqueueTasks (const vector< Task * > &tasks) |
void | WaitForAllTasks () |
int | NumSystemCores () |
typedef volatile int32_t AtomicInt32 |
Definition at line 59 of file parallel.h.
enum RWMutexLockType |
Definition at line 265 of file parallel.h.
float AtomicAdd | ( | volatile float * | val, | |
float | delta | |||
) | [inline] |
Definition at line 180 of file parallel.h.
References AtomicCompareAndSwap().
int32_t AtomicAdd | ( | AtomicInt32 * | v, | |
int32_t | delta | |||
) | [inline] |
Definition at line 64 of file parallel.h.
Referenced by ImageFilm::AddSample(), Reference< Shape >::operator=(), Reference< Shape >::Reference(), MLTTask::Run(), ImageFilm::Splat(), and Reference< Shape >::~Reference().
int32_t AtomicCompareAndSwap | ( | AtomicInt32 * | v, | |
int32_t | newValue, | |||
int32_t | oldValue | |||
) | [inline] |
Definition at line 98 of file parallel.h.
Referenced by AtomicAdd().
T* AtomicCompareAndSwapPointer | ( | T ** | v, | |
T * | newValue, | |||
T * | oldValue | |||
) | [inline] |
Definition at line 116 of file parallel.h.
void EnqueueTasks | ( | const vector< Task * > & | tasks | ) |
Definition at line 789 of file parallel.cpp.
References ConditionVariable::Lock(), Options::nCores, numUnfinishedTasks, PbrtOptions, Semaphore::Post(), taskQueue, TasksInit(), threads, and ConditionVariable::Unlock().
Referenced by PhotonIntegrator::Preprocess(), IrradianceCacheIntegrator::Preprocess(), SurfacePointsRenderer::Render(), SamplerRenderer::Render(), MetropolisRenderer::Render(), and CreateRadianceProbes::Render().
int NumSystemCores | ( | ) |
Definition at line 867 of file parallel.cpp.
References Assert, Error(), Options::nCores, and PbrtOptions.
Referenced by main(), PhotonIntegrator::Preprocess(), SurfacePointsRenderer::Render(), SamplerRenderer::Render(), MetropolisRenderer::Render(), TasksCleanup(), and TasksInit().
void TasksCleanup | ( | ) |
Definition at line 742 of file parallel.cpp.
References Assert, Options::nCores, NumSystemCores(), PbrtOptions, Semaphore::Post(), Severe(), taskQueue, and threads.
Referenced by pbrtWorldEnd().
void TasksInit | ( | ) |
Definition at line 714 of file parallel.cpp.
References Options::nCores, NumSystemCores(), PbrtOptions, Severe(), taskEntry(), and threads.
Referenced by EnqueueTasks().
void WaitForAllTasks | ( | ) |
Definition at line 851 of file parallel.cpp.
References ConditionVariable::Lock(), Options::nCores, numUnfinishedTasks, PbrtOptions, ConditionVariable::Unlock(), and ConditionVariable::Wait().
Referenced by PhotonIntegrator::Preprocess(), IrradianceCacheIntegrator::Preprocess(), SurfacePointsRenderer::Render(), SamplerRenderer::Render(), MetropolisRenderer::Render(), and CreateRadianceProbes::Render().