HDK
|
#include "GA_API.h"
#include "GA_Iterator.h"
#include "GA_Range.h"
#include "GA_SplittableRange.h"
#include "GA_Types.h"
#include <UT/UT_ThreadedAlgorithm.h>
#include <stddef.h>
Go to the source code of this file.
Classes | |
class | GA_PageIterator |
Macros | |
#define | GA_FOR_INFORANGE(info, full_range, IT_NAME) |
#define | GA_FOR_INFORANGE_BOSS(info, full_range, IT_NAME, boss) |
#define | GA_FOR_INFO_ALLPOINTS(gdp, info, IT_NAME) |
Iterate over all points for the given info. More... | |
#define | GA_FOR_INFO_ALLPOINTS_BOSS(gdp, info, IT_NAME, boss) |
Iterate over all points for the given info with a UT_Interrupt. More... | |
#define | GA_FOR_INFO_GROUP_POINTS_BOSS(gdp, pointgrp, info, IT_NAME, boss) |
Iterate over all points for the given info with a UT_Interrupt. More... | |
Functions | |
template<typename Body > | |
**void | GAforEachPageBlock (GA_PageIterator &page_iterator, const Body &body) |
* | GAforEachPageBlock (pit, [&](GA_Offset start, GA_Offset end)*{*pagehandle.setPage(start);*for(GA_Offset off=start;off< end;off++)*{}*}) |
template<typename Body > | |
re build pagehandles inside this loop For non *trivial loops binding may be safer *void | GAparallelForEachPage (const GA_Range &range, bool shouldthread, const Body &body) |
Variables | |
*UT_IntArray | scratchpad |
*GA_ROPageHandleF | pagehandle |
*** | NOTE |
#define GA_FOR_INFO_ALLPOINTS | ( | gdp, | |
info, | |||
IT_NAME | |||
) |
Iterate over all points for the given info.
Definition at line 222 of file GA_PageIterator.h.
#define GA_FOR_INFO_ALLPOINTS_BOSS | ( | gdp, | |
info, | |||
IT_NAME, | |||
boss | |||
) |
Iterate over all points for the given info with a UT_Interrupt.
Definition at line 229 of file GA_PageIterator.h.
#define GA_FOR_INFO_GROUP_POINTS_BOSS | ( | gdp, | |
pointgrp, | |||
info, | |||
IT_NAME, | |||
boss | |||
) |
Iterate over all points for the given info with a UT_Interrupt.
Definition at line 237 of file GA_PageIterator.h.
#define GA_FOR_INFORANGE | ( | info, | |
full_range, | |||
IT_NAME | |||
) |
Define macros roughly equivalent to FOR_INFOTASKS (in UT_ThreadedAlgorithm). This will break up the full range into a load balanced iteration over pages. For example: GA_FOR_INFOTASKS(info, gdp->getPointRange(), it) { doSomething(it.getOrder()); // Use point number doSomething(it.getOffset()); // Use point offset }
Definition at line 207 of file GA_PageIterator.h.
#define GA_FOR_INFORANGE_BOSS | ( | info, | |
full_range, | |||
IT_NAME, | |||
boss | |||
) |
Like FOR_INFOTASKS_BOSS, iterate with an optional opInterrupt for every block completed.
Definition at line 215 of file GA_PageIterator.h.
* * void GAforEachPageBlock | ( | GA_PageIterator & | page_iterator, |
const Body & | body | ||
) |
Invokes a body across each block within a page iterator, avoiding the double loop you normally needed. Usage: GA_PageIterator pit(...); GAforEachPageBlock(pit, [&](GA_Offset start, GA_Offset end) { for (GA_Offset off = start; off < end; off++) { /* work with off
Definition at line 117 of file GA_PageIterator.h.
* GAforEachPageBlock | ( | pit | , |
[&] (GA_Offset start, GA_Offset end)*{*pagehandle.setPage(start);*for(GA_Offset off=start;off< end;off++)*{}*} | |||
) |
|
explicit |
Definition at line 159 of file GA_PageIterator.h.
* * * NOTE |
Definition at line 151 of file GA_PageIterator.h.
* GA_ROPageHandleF pagehandle |
Definition at line 144 of file GA_PageIterator.h.
* UT_IntArray scratchpad |
Invokes the body approximately once per worker thread with a shared atomic int to provide load-balanced iteration over the pages in the range. shouldthread allows you to easily disable threading, for example if you know some cases are not threadsafe or you have a larger grain size. Body Signature: void body(GA_PageIterator page_iterator) Usage: GAparallelForEachPage(range, shouldthread, [&](GA_PageIterator pit) { /* Thread local data structures / scratchpads
Definition at line 143 of file GA_PageIterator.h.