PXL
pxl::detail Namespace Reference

Classes

struct  KernelFunctionTraits
 
struct  KernelFunctionTraits< R(*)(Args...)>
 
struct  KernelFunctionTraits< R(*)(Args...) noexcept >
 
struct  KernelParamDirection
 
struct  KernelParamDirection< T, std::void_t< typename T::element_type, typename T::kernel_buffer_direction > >
 
struct  IsDirectionalKernelParam
 
struct  IsDirectionalKernelParam< T, std::void_t< typename T::element_type, typename T::kernel_buffer_direction > >
 
struct  ActualKernelBuffer
 
struct  ActualKernelBuffer< T * >
 
struct  ActualKernelBuffer< pxl::NDArray< T > >
 
struct  KernelArgumentCompatible
 
struct  KernelArgumentCompatible< Param, Actual, true >
 
class  TaskCountConfigured
 Runnable builder that preserves the value category of settings. More...
 
class  TaskCountRequired
 Holds a launch request that still needs its task count. More...
 

Typedefs

template<auto Func, std::size_t Index>
using KernelParamT = std::tuple_element_t< Index, typename KernelFunctionTraits< decltype(Func)>::parameters >
 
template<auto Func, typename... Actual>
using EnableCompatibleKernelArguments = std::enable_if_t< KernelArgumentsCompatibleV< Func, Actual... >, int >
 

Functions

template<auto Func, typename ActualTuple , std::size_t... Indices>
constexpr bool KernelArgumentsCompatible (std::index_sequence< Indices... >)
 
template<auto Func, typename... Actual>
constexpr bool KernelArgumentsCompatible ()
 
template<auto Func>
ArgDirections MakeKernelDirections ()
 
bool tryEnableProfiling (const xpti::ProfileConfig &cfg)
 

Variables

template<auto Func>
constexpr std::size_t KernelArityV = KernelFunctionTraits<decltype(Func)>::arity
 
template<typename T >
constexpr ArgDir KernelParamDirectionV
 
template<typename T >
constexpr bool IsDirectionalKernelParamV
 
template<typename Param , typename Actual >
constexpr bool KernelArgumentCompatibleV
 
template<auto Func, typename... Actual>
constexpr bool KernelArgumentsCompatibleV
 
template<auto Func, std::size_t... Indices>
ArgDirections MakeKernelDirections (std::index_sequence< Indices... >)
 

Typedef Documentation

◆ EnableCompatibleKernelArguments

template<auto Func, typename... Actual>
using pxl::detail::EnableCompatibleKernelArguments = typedef std::enable_if_t<KernelArgumentsCompatibleV<Func, Actual...>, int>

Definition at line 183 of file direction.hpp.

◆ KernelParamT

template<auto Func, std::size_t Index>
using pxl::detail::KernelParamT = typedef std::tuple_element_t<Index, typename KernelFunctionTraits<decltype(Func)>::parameters>

Definition at line 53 of file direction.hpp.

Function Documentation

◆ KernelArgumentsCompatible() [1/2]

template<auto Func, typename... Actual>
constexpr bool pxl::detail::KernelArgumentsCompatible ( )
constexpr

Definition at line 165 of file direction.hpp.

166 {
167  if constexpr (sizeof...(Actual) != KernelArityV<Func>)
168  {
169  return false;
170  }
171  else
172  {
173  return KernelArgumentsCompatible<Func, std::tuple<Actual...>>(
174  std::make_index_sequence<KernelArityV<Func>>{});
175  }
176 }
constexpr bool KernelArgumentsCompatible()
Definition: direction.hpp:165

◆ KernelArgumentsCompatible() [2/2]

template<auto Func, typename ActualTuple , std::size_t... Indices>
constexpr bool pxl::detail::KernelArgumentsCompatible ( std::index_sequence< Indices... >  )
constexpr

Definition at line 156 of file direction.hpp.

157 {
159  KernelParamT<Func, Indices>,
160  std::tuple_element_t<Indices, ActualTuple>> &&
161  ...);
162 }
constexpr bool KernelArgumentCompatibleV
Definition: direction.hpp:152

◆ MakeKernelDirections()

template<auto Func>
ArgDirections pxl::detail::MakeKernelDirections ( )

Definition at line 199 of file direction.hpp.

200 {
201  return MakeKernelDirections<Func>(std::make_index_sequence<KernelArityV<Func>>{});
202 }

◆ tryEnableProfiling()

bool pxl::detail::tryEnableProfiling ( const xpti::ProfileConfig &  cfg)

Variable Documentation

◆ IsDirectionalKernelParamV

template<typename T >
constexpr bool pxl::detail::IsDirectionalKernelParamV
inlineconstexpr
Initial value:
=
IsDirectionalKernelParam<std::remove_cv_t<std::remove_reference_t<T>>>::value

Definition at line 94 of file direction.hpp.

◆ KernelArgumentCompatibleV

template<typename Param , typename Actual >
constexpr bool pxl::detail::KernelArgumentCompatibleV
inlineconstexpr
Initial value:
=
KernelArgumentCompatible<Param, Actual>::value

Definition at line 152 of file direction.hpp.

◆ KernelArgumentsCompatibleV

template<auto Func, typename... Actual>
constexpr bool pxl::detail::KernelArgumentsCompatibleV
inlineconstexpr
Initial value:
=
KernelArgumentsCompatible<Func, Actual...>()

Definition at line 179 of file direction.hpp.

◆ KernelArityV

template<auto Func>
constexpr std::size_t pxl::detail::KernelArityV = KernelFunctionTraits<decltype(Func)>::arity
inlineconstexpr

Definition at line 50 of file direction.hpp.

◆ KernelParamDirectionV

template<typename T >
constexpr ArgDir pxl::detail::KernelParamDirectionV
inlineconstexpr
Initial value:
=
KernelParamDirection<std::remove_cv_t<std::remove_reference_t<T>>>::value

Definition at line 78 of file direction.hpp.

◆ MakeKernelDirections

template<auto Func, std::size_t... Indices>
ArgDirections pxl::detail::MakeKernelDirections(std::index_sequence< Indices... >) ( std::index_sequence< Indices... >  )

Definition at line 187 of file direction.hpp.

188 {
189  ArgDirections directions;
190  if constexpr (((KernelParamDirectionV<KernelParamT<Func, Indices>> == ArgDir::InOut) && ...))
191  {
192  return directions;
193  }
194  directions.args = {KernelParamDirectionV<KernelParamT<Func, Indices>>...};
195  return directions;
196 }
constexpr ArgDir KernelParamDirectionV
Definition: direction.hpp:78