Expression Templates Library (ETL)
Functions | Variables
eval_selectors.hpp File Reference

Contains TMP selectors to select evaluation methods based on configuration. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

template<typename E , typename R >
constexpr vector_mode_t etl::detail::select_vector_mode ()
 Select a vector mode for the given assignment type. More...
 

Variables

template<vector_mode_t V, typename E , typename R >
constexpr bool etl::detail::are_vectorizable_select
 Traits to test if the given assignment is vectorizable with the given vector mode. More...
 
template<typename E , typename R >
constexpr bool etl::detail::are_vectorizable
 Integral constant indicating if vectorization is possible. More...
 
template<typename E , typename R >
constexpr bool etl::detail::fast_assign = all_dma<E, R>
 Integral constant indicating if a fast assign is possible. More...
 
template<typename E , typename R >
constexpr bool etl::detail::gpu_assign = all_homogeneous<E, R> && !fast_assign<E, R> && all_gpu_computable<E, R> && is_dma<R> && !is_scalar<E>
 Integral constant indicating if a GPU assign is possible.
 
template<typename E , typename R >
constexpr bool etl::detail::vectorized_assign = !fast_assign<E, R> && !gpu_assign<E, R> && are_vectorizable<E, R>
 Integral constant indicating if a vectorized assign is possible.
 
template<typename E , typename R >
constexpr bool etl::detail::direct_assign = !gpu_assign<E, R> && !are_vectorizable<E, R> && !is_dma<E> && is_dma<R>
 Integral constant indicating if a direct assign is possible.
 
template<typename E , typename R >
constexpr bool etl::detail::standard_assign = !is_dma<R>
 Integral constant indicating if a standard assign is necessary.
 
template<typename E , typename R >
constexpr bool etl::detail::gpu_compound = all_homogeneous<E, R>&& all_gpu_computable<E, R>&& is_dma<R>&& cublas_enabled&& egblas_enabled
 Integral constant indicating if a GPU compound assign is possible.
 
template<typename E , typename R >
constexpr bool etl::detail::vectorized_compound = !gpu_compound<E, R> && are_vectorizable<E, R>
 Integral constant indicating if a vectorized compound assign is possible.
 
template<typename E , typename R >
constexpr bool etl::detail::direct_compound = !gpu_compound<E, R> && !vectorized_compound<E, R> && is_dma<R>
 Integral constant indicating if a direct compound assign is possible.
 
template<typename E , typename R >
constexpr bool etl::detail::standard_compound = !gpu_compound<E, R> && !vectorized_compound<E, R> && !direct_compound<E, R>
 Integral constant indicating if a standard compound assign is necessary.
 
template<typename E , typename R >
constexpr bool etl::detail::gpu_compound_div = all_homogeneous<E, R>&& all_gpu_computable<E, R>&& is_dma<R>&& cublas_enabled&& egblas_enabled
 Integral constant indicating if a GPU compound assign is possible.
 
template<typename E , typename R >
constexpr bool etl::detail::vectorized_compound_div = !gpu_compound_div<E, R> && (is_floating_t<value_t<E>> || is_complex_t<value_t<E>>)&&are_vectorizable<E, R>
 Integral constant indicating if a vectorized compound div assign is possible.
 
template<typename E , typename R >
constexpr bool etl::detail::direct_compound_div = !gpu_compound_div<E, R> && !vectorized_compound_div<E, R> && is_dma<R>
 Integral constant indicating if a direct compound div assign is possible.
 
template<typename E , typename R >
constexpr bool etl::detail::standard_compound_div = !gpu_compound_div<E, R> && !vectorized_compound_div<E, R> && !direct_compound_div<E, R>
 Integral constant indicating if a standard compound div assign is necessary.
 
template<typename E , typename R >
constexpr bool etl::detail::fast_assign_no_gpu = all_dma<E, R>
 Integral constant indicating if a fast assign is possible. More...
 
template<typename E , typename R >
constexpr bool etl::detail::vectorized_assign_no_gpu = !fast_assign_no_gpu<E, R> && are_vectorizable<E, R>
 Integral constant indicating if a vectorized assign is possible.
 
template<typename E , typename R >
constexpr bool etl::detail::direct_assign_no_gpu = !are_vectorizable<E, R> && !is_dma<E> && is_dma<R>
 Integral constant indicating if a direct assign is possible.
 
template<typename E , typename R >
constexpr bool etl::detail::standard_assign_no_gpu = !is_dma<R>
 Integral constant indicating if a standard assign is necessary.
 
template<typename E , typename R >
constexpr bool etl::detail::vectorized_compound_no_gpu = are_vectorizable<E, R>
 Integral constant indicating if a vectorized compound assign is possible.
 
template<typename E , typename R >
constexpr bool etl::detail::direct_compound_no_gpu = !vectorized_compound_no_gpu<E, R> && is_dma<R>
 Integral constant indicating if a direct compound assign is possible.
 
template<typename E , typename R >
constexpr bool etl::detail::standard_compound_no_gpu = !vectorized_compound_no_gpu<E, R> && !direct_compound_no_gpu<E, R>
 Integral constant indicating if a standard compound assign is necessary.
 
template<typename E , typename R >
constexpr bool etl::detail::vectorized_compound_div_no_gpu = (is_floating_t<value_t<E>> || is_complex_t<value_t<E>>)&&are_vectorizable<E, R>
 Integral constant indicating if a vectorized compound div assign is possible.
 
template<typename E , typename R >
constexpr bool etl::detail::direct_compound_div_no_gpu = !vectorized_compound_div_no_gpu<E, R> && is_dma<R>
 Integral constant indicating if a direct compound div assign is possible.
 
template<typename E , typename R >
constexpr bool etl::detail::standard_compound_div_no_gpu = !vectorized_compound_div_no_gpu<E, R> && !direct_compound_div_no_gpu<E, R>
 Integral constant indicating if a standard compound div assign is necessary.
 

Detailed Description

Contains TMP selectors to select evaluation methods based on configuration.

Function Documentation

◆ select_vector_mode()

template<typename E , typename R >
constexpr vector_mode_t etl::detail::select_vector_mode ( )

Select a vector mode for the given assignment type.

Template Parameters
EThe Expression to assign to the result
RThe result type

Variable Documentation

◆ are_vectorizable

template<typename E , typename R >
constexpr bool etl::detail::are_vectorizable
Initial value:
= (avx512_enabled && are_vectorizable_select<vector_mode_t::AVX512, E, R>)
|| (avx_enabled && are_vectorizable_select<vector_mode_t::AVX, E, R>)
|| (sse3_enabled && are_vectorizable_select<vector_mode_t::SSE3, E, R>)
constexpr bool avx512_enabled
Indicates if AVX512 is available.
Definition: config.hpp:200
constexpr bool sse3_enabled
Indicates if SSE3 is available.
Definition: config.hpp:215

Integral constant indicating if vectorization is possible.

◆ are_vectorizable_select

template<vector_mode_t V, typename E , typename R >
constexpr bool etl::detail::are_vectorizable_select
Initial value:
&& decay_traits<R>::template vectorizable<V>
&& decay_traits<E>::template vectorizable<V>
&& decay_traits<E>::storage_order
== decay_traits<R>::storage_order
&& get_intrinsic_traits<V>::template type<value_t<R>>::vectorizable
&& get_intrinsic_traits<V>::template type<value_t<E>>::vectorizable
&& std::is_same_v<
typename get_intrinsic_traits<V>::template type<value_t<R>>::intrinsic_type,
typename get_intrinsic_traits<V>::template type<value_t<E>>::intrinsic_type>
constexpr bool vectorize_expr
Indicates if the expressions can be automatically vectorized by ETL.
Definition: config.hpp:26

Traits to test if the given assignment is vectorizable with the given vector mode.

Template Parameters
VThe vector mode to test
EThe Expression to assign to the result
RThe result type

◆ fast_assign

template<typename E , typename R >
constexpr bool etl::detail::fast_assign = all_dma<E, R>

Integral constant indicating if a fast assign is possible.

A fast assign is a simple memory copy from E into R.

◆ fast_assign_no_gpu

template<typename E , typename R >
constexpr bool etl::detail::fast_assign_no_gpu = all_dma<E, R>

Integral constant indicating if a fast assign is possible.

A fast assign is a simple memory copy from E into R.