Speclib  0.1.2
The library for writing better CUDA libraries
sp::PtrScalarSpecialiser< ForceLoc > Struct Template Reference

Specialiser for coping with scalar parameters that are provided as pointers: something APIs love to do. More...

#include <PtrScalar.hpp>

Inheritance diagram for sp::PtrScalarSpecialiser< ForceLoc >:
[legend]

Static Public Member Functions

template<typename T >
static constexpr bool test ()
 
template<typename VType , PtrLocation PtrLoc, typename... Stuff>
static auto run (const PtrScalar< VType, PtrLoc > &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

template<PtrLocation ForceLoc = PtrLocation::UNKNOWN>
struct sp::PtrScalarSpecialiser< ForceLoc >

Specialiser for coping with scalar parameters that are provided as pointers: something APIs love to do.

If you don't want to support all combinations of location (which may lead to a lot of uninteresting specialisations), you can expicitly specify an sp::PtrLocation tparam in the type of the scalar you pass here or to VariantScalarSpecialiser. Alternatively, you can set the tparam of this Specialiser to have it assume that all input scalars have a particular location.

See also
runWithSpecialisers For how to use a custom set of Specialisers for a specialising call.
Template Parameters
ForceLocIf set to something other than UNKNOWN, all PtrScalars are assumed to have that location. This suppresses the generation of mixed-location specialisations.