min_max#
Entry point to compute min and max values.
Description and Assumptions
The oneapi::math::stats::min_max function is used to compute min and max arrays (min and max values for each dataset’s dimension).
min_max supports the following precisions for data:
T
float
double
min_max (buffer version)#
Syntax
namespace oneapi::math::stats {
template<method Method = method::fast, typename Type, layout ObservationsLayout>
void min_max(sycl::queue& queue,
const dataset<ObservationsLayout, sycl::buffer<Type, 1>>& data,
sycl::buffer<Type, 1> min,
sycl::buffer<Type, 1> max);
}
Template Parameters
- Method
Method which is used for estimate computation. The specific values are as follows:
oneapi::math::stats::method::fast
- Type
Data precision.
- ObservationsLayout
Data layout. The specific values are described in dataset.
Input Parameters
- queue
The queue where the routine should be executed.
- data
Dataset which is used for computation.
Output Parameters
- min
sycl::buffer array of min values.
- max
sycl::buffer array of max values.
Throws
- oneapi::math::invalid_argument
Exception is thrown when min.get_count() == 0, or max.get_count() == 0, or dataset object is invalid
min_max (USM version)#
Syntax
namespace oneapi::math::stats {
template<method Method = method::fast, typename Type, layout ObservationsLayout>
sycl::event min_max(sycl::queue& queue,
const dataset<ObservationsLayout, Type*>& data,
Type* min,
Type* max,
const std::vector<sycl::event> &dependencies = {});
}
Template Parameters
- Method
Method which is used for estimate computation. The specific values are as follows:
oneapi::math::stats::method::fast
- Type
Data precision.
- ObservationsLayout
Data layout. The specific values are described in dataset.
Input Parameters
- queue
The queue where the routine should be executed.
- data
Dataset which is used for computation.
- dependencies
Optional parameter. List of events to wait for before starting computation, if any.
Output Parameters
- min
Pointer to the array of min values.
- max
Pointer to the array of max values.
Throws
- oneapi::math::invalid_argument
Exception is thrown when min == nullptr, or max == nullptr, or dataset object is invalid
Return Value
Output event to wait on to ensure computation is complete.
Parent topic: Summary Statistics Routines