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 184 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 54 of file direction.hpp.

Function Documentation

◆ KernelArgumentsCompatible() [1/2]

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

Definition at line 166 of file direction.hpp.

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

◆ 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 157 of file direction.hpp.

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

◆ MakeKernelDirections()

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

Definition at line 200 of file direction.hpp.

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

◆ 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 95 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 153 of file direction.hpp.

◆ KernelArgumentsCompatibleV

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

Definition at line 180 of file direction.hpp.

◆ KernelArityV

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

Definition at line 51 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 79 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 188 of file direction.hpp.

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