RenderManAPI
24.0
|
NOTE: This interface is deprecated and will be removed in a future release This object is used to create a RixMutex object that can be used for locking access to shared global memory. More...
#include <RixInterfaces.h>
Inherits RixInterface.
Public Types | |
enum | Type { k_Float, k_Integer, k_StringV, k_Color, k_Normal, k_Vector, k_Point, k_HPoint, k_MPoint, k_Matrix } |
Public Member Functions | |
virtual RixMutex * | NewMutex () const =0 |
Get a new RixMutex object. NOTE: It must be deleted with DeleteMutex. More... | |
virtual void | DeleteMutex (RixMutex *mutex) const =0 |
Used to delete a RixMutex object. More... | |
virtual void | ParallelFor (size_t start, size_t end, const RixFunction< void(size_t)> &fn) const =0 |
Performs parallel iteration over a range of values using the RenderMan thread scheduler. More... | |
virtual void | ParallelFor (size_t start, size_t end, size_t step, const RixFunction< void(size_t)> &fn) const =0 |
virtual int | GetVersion () const |
Get the version number of this interface. More... | |
Protected Member Functions | |
RixThreadUtils () | |
Constructor is for internal use only. More... | |
Protected Attributes | |
int | m_version |
Version number of this interface. More... | |
NOTE: This interface is deprecated and will be removed in a future release This object is used to create a RixMutex object that can be used for locking access to shared global memory.
|
inherited |
|
inlineprotected |
Constructor is for internal use only.
|
pure virtual |
Used to delete a RixMutex object.
|
inlinevirtualinherited |
Get the version number of this interface.
Different interfaces might have different version numbers in a given release.
References RixInterface::m_version.
|
pure virtual |
Get a new RixMutex object. NOTE: It must be deleted with DeleteMutex.
|
pure virtual |
Performs parallel iteration over a range of values using the RenderMan thread scheduler.
Calls to ParallelFor can be nested to parallelize complex loops and perform automatic load balancing. The typical use of ParallelFor is in combination with C++11 lambdas:
RixThreadUtils* rtu = (RixThreadUtils*)ctx->GetRixInterface(k_RixThreadUtils);
// Simple parallel loop rtu->ParallelFor(0, 1000, [&](size_t i) { some_computation(i); });
// Nested parallel loop rtu->ParallelFor(0, 1000, [&](size_t i) { // Pay attention on how the nested lambda captures "i" by value. rtu->ParallelFor(0, 1000, [&, i](size_t j) { some_computation(i, j); } });
|
pure virtual |
|
protectedinherited |
Version number of this interface.
Referenced by RixInterface::GetVersion().