cuda::experimental::stf::to_tuple
Defined in include/cuda/experimental/__stf/utility/traits.cuh
-
template<typename Array>
auto cuda::experimental::stf::to_tuple(Array &&array) Converts an array-like object (such as an
std::array
) to anstd::tuple
.This function template takes an array-like object and returns a tuple containing the same elements. If the input array has a size of zero, an empty tuple is returned.
Example usage:
std::array<int, 3> arr = {1, 2, 3}; auto t = to_tuple(arr); // t is a std::tuple<int, int, int>
- Template Parameters
Array – Type of the array-like object. Must have
std::tuple_size_v<Array>
specialization.- Parameters
array – The array-like object to be converted to a tuple.
- Returns
A tuple containing the elements of the input array.