Speclib  0.1.2
The library for writing better CUDA libraries
Collapsible Scalars

Represents a scalar value which may or may not be a compile-time constant. More...

Classes

struct  sp::Scalar< T >
 A scalar (as a rank-zero tensor). More...
 
struct  sp::ScalarBroadcast< T, Rank >
 Broadcasts the same scalar to every element of a logical tensor. More...
 
struct  sp::IsScalarTensorOpImpl< typename >
 Type-trait for detecting Scalar-ness. More...
 

Variables

template<typename T >
constexpr bool sp::IsScalarTensorOp = IsScalarTensorOpImpl<T>::value
 

Detailed Description

Represents a scalar value which may or may not be a compile-time constant.

A system for specifying scalar function template parameters that can be conditionally optimised out.

This makes it straightforward to generate degenerate cases of your functions for situations like when an input parameter is zero.

See also
sp::ScalarSpecialiser