This page describes the lambda function signatures used in segment find operations.
Condition Lambda
The condition lambda determines whether an element within a segment satisfies the search condition. It has the following signature:
auto condition = [=]
__cuda_callable__ ( IndexType segmentIdx, IndexType localIdx, IndexType globalIdx ) ->
bool
{
return ...;
};
#define __cuda_callable__
This macro serves for annotating functions which are supposed to be called even from the GPU device.
Definition Macros.h:50
- segmentIdx is the index of the segment.
- localIdx is the rank of the element within the segment.
- globalIdx is the index of the element in the corresponding container.
The lambda should return true if the element satisfies the search condition.
Result Storer Lambda
The result storer lambda manages the results of the search operation. It has the following signature:
auto storer = [=]
__cuda_callable__ ( IndexType segmentIdx, IndexType localIdx,
bool found )
{
if( found ) {
}
};
- segmentIdx is the index of the segment.
- localIdx is the index of the element within the segment (valid only if found is true).
- found is a boolean indicating whether the element was found.
This lambda is called for each processed segment. If found is true, localIdx points at the position in the segment where the element was found.
Segment Condition Lambda
The segment condition lambda determines which segments should be searched. It has the following signature:
- segmentIdx is the index of the segment.
The lambda should return true if the segment should be searched.