mean#

Entry point to compute mean values.

Description and Assumptions

The oneapi::math::stats::mean function is used to compute a mean array (mean value for each dataset’s dimension).

mean supports the following precisions for data:

T

float

double

mean (buffer version)#

Syntax

namespace oneapi::math::stats {
template<method Method = method::fast, typename Type, layout ObservationsLayout>
    void mean(sycl::queue& queue,
    const dataset<ObservationsLayout, sycl::buffer<Type, 1>>& data,
    sycl::buffer<Type, 1> mean);
}

Template Parameters

Method

Method which is used for estimate computation. The specific values are as follows:

  • oneapi::math::stats::method::fast

  • oneapi::math::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.

Throws

oneapi::math::invalid_argument

Exception is thrown when mean.get_count() == 0, or dataset object is invalid

mean (USM version)#

Syntax

namespace oneapi::math::stats {
template<method Method = method::fast, typename Type, layout ObservationsLayout>
    sycl::event mean(sycl::queue& queue,
    const dataset<ObservationsLayout, Type*>& data,
    Type* mean,
    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

  • oneapi::math::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.

Throws

oneapi::math::invalid_argument

Exception is thrown when mean == nullptr, or dataset object is invalid

Return Value

Output event to wait on to ensure computation is complete.

Parent topic: Summary Statistics Routines