Speclib  0.1.2
The library for writing better CUDA libraries
sp::VariantScalarSpecialiser Struct Reference

Specialise CUDA API variant scalars into proper scalars. More...

#include <VariantScalar.hpp>

Inheritance diagram for sp::VariantScalarSpecialiser:
[legend]

Static Public Member Functions

template<typename T >
static constexpr bool test ()
 
template<typename TargetType , typename Tensors , typename... Scalars>
constexpr static bool checkScalarTypes (sp::TypeList< Scalars... > &&)
 
template<typename... O, typename ScalarType , sp::PtrLocation Loc, typename Fn , typename... Stuff>
static auto runWithType (const sp::PtrScalar< ScalarType, Loc > &thisArg, Fn &f, std::tuple< O &&... >, Stuff &&... stuff)
 
template<sp::PtrLocation Loc, typename... Stuff>
static auto run (const CudaVariantScalar< Loc > &thisArg, Stuff &&... stuff)
 
- Static Public Member Functions inherited from sp::Specialiser
template<typename T >
static constexpr bool test ()
 Return true iff the specialiser is able to specialise arguments of type T. More...
 
template<typename... O, typename ArgType , typename... Stuff>
static auto run (const ArgType &thisArg, Stuff &&... stuff)
 Specialise an argument. More...
 

Detailed Description

Specialise CUDA API variant scalars into proper scalars.

Some APIs pass scalars as a void* and a cudaDataType_t enumerant. This Specialiser converts those (encapsulated as CudaVariantScalars) into proper Scalars, which are then sent to PtrScalarSpecialiser for further refinement.

Since this Specialiser is inferring the type of arguments, it has a hook which calls the validScalarTypes predicate on the target functor type, giving the functor an opportunity to prune invalid specialisation branches.

See also
Specialisable.hpp