raw_moment¶
Entry point to compute raw moments up to the 4th order.
Description and Assumptions
The oneapi::mkl::stats::raw_moment function is used to compute array of raw moments up to the 4th order (raw moments for each dataset’s dimension).
raw_moment supports the following precisions for data:
T
float
double
oneapi::mkl::stats::raw_moment (buffer version)¶
Syntax
namespace oneapi::mkl::stats {
template<method Method = fast, typename Type, layout ObservationsLayout>
void raw_moment(sycl::queue& queue,
const dataset<ObservationsLayout, sycl::buffer<Type, 1>>& data,
sycl::buffer<Type, 1> mean,
sycl::buffer<Type, 1> raw_moment_2 = {0},
sycl::buffer<Type, 1> raw_moment_3 = {0},
sycl::buffer<Type, 1> raw_moment_4 = {0});
}
Template Parameters
- Method
Method which is used for estimate computation. The specific values are as follows:
oneapi::mkl::stats::method::fast
oneapi::mkl::stats::method::one_pass
- 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
- mean
sycl::buffer array of mean values.
- raw_moment_2
Optional parameter. sycl::buffer array of 2nd order raw moment values.
- raw_moment_3
Optional parameter. sycl::buffer array of 3rd order raw moment values.
- raw_moment_4
Optional parameter. sycl::buffer array of 4th order raw moment values.
Throws
- oneapi::mkl::invalid_argument
Exception is thrown when mean.get_count() == 0 & raw_moment_2.get_count() == 0 & raw_moment_3.get_count() == 0 & raw_moment_4.get_count() == 0, or dataset object is invalid
raw_moment (USM version)¶
Syntax
namespace oneapi::mkl::stats {
template<method Method = method::fast, typename Type, layout ObservationsLayout>
sycl::event raw_moment(
sycl::queue& queue,
const dataset<ObservationsLayout, Type*>& data,
Type* mean,
Type* raw_moment_2 = nullptr,
Type* raw_moment_3 = nullptr,
Type* raw_moment_4 = nullptr,
const std::vector<sycl::event> &dependencies = {});
}
Template Parameters
- Method
Method which is used for estimate computation. The specific values are as follows:
oneapi::mkl::stats::method::fast
oneapi::mkl::stats::method::one_pass
- 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
- mean
Pointer to the array of mean values.
- raw_moment_2
Optional parameter. Pointer to the array of the 2nd order raw moment values.
- raw_moment_3
Optional parameter. Pointer to the array of the 3rd order raw moment values.
- raw_moment_4
Optional parameter. Pointer to the array of the 2nd order raw moment values.
Throws
- oneapi::mkl::invalid_argument
Exception is thrown when mean == nullptr & raw_moment_2 == nullptr & raw_moment_3 == nullptr & raw_moment_4 == nullptr, or dataset object is invalid
Return Value
Output event to wait on to ensure computation is complete.
Parent topic: Summary Statistics Routines