FirstLocScalar

The FirstLocScalar is a class template that stores a location (index) of the first occurrence satisfying a condition as a single, convenient unit. It’s designed to hold the result of parallel_reduce() operations using a FirstLoc builtin reducer.

It is generally recommended to get this type by using the reducer’s ::value_type member (e.g., FirstLoc<Index,Space>::value_type) to ensure the correct template parameters are used.

Header File: <Kokkos_Core.hpp>

Usage

FirstLocScalar<Index>::value_type result;
parallel_reduce(N,Functor,FirstLocScalar<Index>(result));
I firstLoc = result.min_loc_true;

Interface

template<class Index>
struct FirstLocScalar
Template Parameters:

Index – The data type of the locations (indices) of the values.

Data members

Index min_loc_true

The location (iteration index) of the minimum value