CbmRoot
Loading...
Searching...
No Matches
cbm::algo::kf::utils::simd Namespace Reference

Functions

template<typename DataT , typename DataOut >
DataOut Cast (const DataT &val)
 Converts a value of type DataT to type DataOut.
 
template<>
float Cast (const fvec &val)
 Converts a value of type DataT to type DataOut.
 
template<>
double Cast (const fvec &val)
 Converts a value of type DataT to type DataOut.
 
template<typename DataT , typename DataOut >
DataOut Cast (const DataT &val, size_t)
 Converts a value of type DataT at a specific index to type DataOut.
 
template<typename DataT , typename DataOut , size_t N>
std::array< DataOut, N > Cast (const std::array< DataT, N > &arr, size_t i)
 
template<typename DataT , typename DataOut , size_t N>
std::array< DataOut, N > Cast (const std::array< DataT, N > &arr)
 
template<>
float Cast (const fvec &val, size_t i)
 Converts a value of type DataT at a specific index to type DataOut.
 
template<>
double Cast (const fvec &val, size_t i)
 Converts a value of type DataT at a specific index to type DataOut.
 
template<typename DataT >
size_t Size ()
 Returns the number of elements available for a given data type.
 
template<>
size_t Size< fvec > ()
 Returns the number of elements available for a given data type.
 
template<typename DataT >
DataT One ()
 Returns a value of the data type set to one.
 
template<>
fvec One< fvec > ()
 Returns a value of the data type set to one.
 
template<typename DataT , typename DataIn >
void SetEntry (DataT &out, DataIn in, size_t)
 Sets a value at a specific index in the output data.
 
template<typename DataIn >
void SetEntry (fvec &out, DataIn in, size_t i)
 Sets a value at a specific index in the output data.
 

Detailed Description

Namespace contains compile-time constants definition for SIMD operations in the CA tracking algorithm

Function Documentation

◆ Cast() [1/8]

template<typename DataT , typename DataOut >
DataOut cbm::algo::kf::utils::simd::Cast ( const DataT & val)
inline

Converts a value of type DataT to type DataOut.

This function is a generic template that provides a flexible way for fvec/float/double conversions

Template Parameters
DataTInput value data type
DataOutConverted value data type
Parameters
valInput value of type DataT to be converted
Returns
Return val as DataOut

Definition at line 212 of file KfUtils.h.

Referenced by Cast(), Cast(), cbm::algo::kf::FieldSlice< T >::ToString(), and cbm::algo::kf::Target< T >::ToString().

◆ Cast() [2/8]

template<typename DataT , typename DataOut >
DataOut cbm::algo::kf::utils::simd::Cast ( const DataT & val,
size_t  )
inline

Converts a value of type DataT at a specific index to type DataOut.

This function is a generic template that provides a flexible way for fvec/float/double conversions

Template Parameters
DataTInput value data type
DataOutConverted value data type
Parameters
valInput value of type DataT to be converted
iThe index indicating which element to convert, ignored for non-SIMD DataT
Returns
Return val as DataOut

Definition at line 245 of file KfUtils.h.

◆ Cast() [3/8]

template<>
float cbm::algo::kf::utils::simd::Cast ( const fvec & val)
inline

Converts a value of type DataT to type DataOut.

This specialization extracts the first element of the input SIMD float vector (fvec) and returns it as a float

Parameters
valInput value of type fvec to be converted
Returns
Return val[0] as float

Definition at line 222 of file KfUtils.h.

◆ Cast() [4/8]

template<>
double cbm::algo::kf::utils::simd::Cast ( const fvec & val)
inline

Converts a value of type DataT to type DataOut.

This specialization extracts the first element of the input SIMD float vector (fvec) and returns it as a double

Parameters
valInput value of type fvec to be converted
Returns
Return val[0] as double

Definition at line 232 of file KfUtils.h.

◆ Cast() [5/8]

template<>
float cbm::algo::kf::utils::simd::Cast ( const fvec & val,
size_t i )
inline

Converts a value of type DataT at a specific index to type DataOut.

This specialization extracts the element at the specified index of the input SIMD float vector (fvec) and returns it as a float

Parameters
valInput value of type fvec to be converted
iThe index indicating which element to convert
Returns
Return val[i] as float

Definition at line 276 of file KfUtils.h.

◆ Cast() [6/8]

template<>
double cbm::algo::kf::utils::simd::Cast ( const fvec & val,
size_t i )
inline

Converts a value of type DataT at a specific index to type DataOut.

This specialization extracts the element at the specified index of the input SIMD float vector (fvec) and returns it as a double

Parameters
valInput value of type fvec to be converted
iThe index indicating which element to convert.
Returns
Return val[i] as double

Definition at line 287 of file KfUtils.h.

◆ Cast() [7/8]

template<typename DataT , typename DataOut , size_t N>
std::array< DataOut, N > cbm::algo::kf::utils::simd::Cast ( const std::array< DataT, N > & arr)
inline

Definition at line 261 of file KfUtils.h.

References Cast().

◆ Cast() [8/8]

template<typename DataT , typename DataOut , size_t N>
std::array< DataOut, N > cbm::algo::kf::utils::simd::Cast ( const std::array< DataT, N > & arr,
size_t i )
inline

Definition at line 251 of file KfUtils.h.

References Cast().

◆ One()

template<typename DataT >
DataT cbm::algo::kf::utils::simd::One ( )
inline

Returns a value of the data type set to one.

This function is a template that provides a default implementation returning 1

Template Parameters
DataTThe data type for which the value is generated
Returns
Return 1 as DataT

Definition at line 316 of file KfUtils.h.

◆ One< fvec >()

template<>
fvec cbm::algo::kf::utils::simd::One< fvec > ( )
inline

Returns a value of the data type set to one.

This specialization returns a SIMD float vector (fvec) with all elements set to one using its static member function One()

Returns
Return SIMD vector of 1

Definition at line 325 of file KfUtils.h.

◆ SetEntry() [1/2]

template<typename DataT , typename DataIn >
void cbm::algo::kf::utils::simd::SetEntry ( DataT & out,
DataIn in,
size_t  )
inline

Sets a value at a specific index in the output data.

This function is a template that provides a default implementation for setting a value at a specific index in the output data

Template Parameters
DataTThe data type of the output data
DataInThe data type of the input data
Parameters
outReference to the output data where the value is to be set
inThe input data from which the value is obtained
iThe index at which the value is set, ignored for non-SIMD DataT or if both DataT and DataIn are fvec

Definition at line 338 of file KfUtils.h.

◆ SetEntry() [2/2]

template<typename DataIn >
void cbm::algo::kf::utils::simd::SetEntry ( fvec & out,
DataIn in,
size_t i )
inline

Sets a value at a specific index in the output data.

This specialization sets a value at the specified index in the output SIMD float vector (fvec) using the input float value

Parameters
outReference to the output float vector (fvec) where the value is to be set
inThe input non-SIMD value from which the value is obtained
iThe index at which the value is set

Definition at line 349 of file KfUtils.h.

◆ Size()

template<typename DataT >
size_t cbm::algo::kf::utils::simd::Size ( )
inline

Returns the number of elements available for a given data type.

This function is a template that provides a default implementation returning 1

Template Parameters
DataTThe data type for which the size is determined
Returns
Return 1

Definition at line 297 of file KfUtils.h.

◆ Size< fvec >()

template<>
size_t cbm::algo::kf::utils::simd::Size< fvec > ( )
inline

Returns the number of elements available for a given data type.

This specialization returns the size of the SIMD float vector (fvec) using its static member function size()

Returns
Return number of elements in the SIMD

Definition at line 306 of file KfUtils.h.