RenderMan API
23.0
|
#include <RixInterfaces.h>
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 |
virtual void | ParallelFor (size_t start, size_t end, size_t step, const RixFunction< void(size_t)> &fn) const =0 |
Public Member Functions inherited from RixInterface | |
virtual int | GetVersion () const |
Protected Member Functions | |
RixThreadUtils () | |
Constructor is for internal use only. More... | |
Protected Member Functions inherited from RixInterface | |
RixInterface (int version) | |
Interfaces should not be constructed by users. More... | |
virtual | ~RixInterface () |
Interfaces should not be deleted by users. More... | |
Additional Inherited Members | |
Public Types inherited from RixInterface | |
enum | Type { k_Float, k_Integer, k_StringV, k_Color, k_Normal, k_Vector, k_Point, k_HPoint, k_MPoint, k_Matrix } |
Protected Attributes inherited from RixInterface | |
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
Definition at line 1465 of file RixInterfaces.h.
|
inlineprotected |
Constructor is for internal use only.
Definition at line 1504 of file RixInterfaces.h.
|
pure virtual |
Used to delete a RixMutex object.
|
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 |