Template Numerical Library: Segment Traversal Lambda Function Reference

Template Numerical Library version\ main:c7077e4fd

Loading...
Searching...
No Matches
Segment Traversal Lambda Function Reference

This page provides a comprehensive reference for all lambda function signatures used in segment traversal operations.

# Element Traversal Lambda Functions

These lambda functions are used when iterating over individual elements within segments.

## Full Form (With All Parameters)

auto f = [=] __cuda_callable__ ( IndexType segmentIdx, IndexType localIdx, IndexType globalIdx ) {...}
__cuda_callable__
#define __cuda_callable__
Definition Macros.h:49

Parameters:

- segmentIdx - The index of the segment to which the given element belongs
- localIdx - The rank (position) of the element within the segment
- globalIdx - The global index of the element within the range of all elements managed by the segments

## Brief Form (Without Local Index)

auto f = [=] __cuda_callable__ ( IndexType segmentIdx, IndexType globalIdx ) {...}

In case when the local index within the segment is not required, this brief form can be used. It may lead to better performance.

Parameters:

- segmentIdx - The index of the segment to which the given element belongs
- globalIdx - The global index of the element within the range of all elements managed by the segments

# Segment View Lambda Functions

These lambda functions are used when iterating over segments as a whole, operating on SegmentView objects.

## Segment View Lambda

auto f = [=] __cuda_callable__ ( const SegmentView& segment ) {...}

Parameters:

- segment - A view representing the given segment (see TNL::Algorithms::Segments::SegmentView). The segment view provides access to segment properties and its elements.

# Segment Condition Lambda Functions

These lambda functions are used to determine whether a segment should be processed (used in "If" variants).

## Condition Check

auto f = [=] __cuda_callable__ ( IndexType segmentIdx ) -> bool {...}

Parameters:

- segmentIdx - The index of the segment
- Returns: true if the segment (or its elements) should be processed, false otherwise

# Related Pages

- Overview of Segment Traversal Functions - Overview of segment traversal functions