Speclib  0.1.2
The library for writing better CUDA libraries
sp::PtrScalar< T, Location > Struct Template Reference

Represents a scalar value that has been passed as a pointer. More...

#include <CudaScalar.hpp>

Public Types

using ValueType = T
 

Public Member Functions

 PtrScalar (const T *data)
 

Public Attributes

const T * data
 The scalar value. More...
 

Detailed Description

template<typename T, PtrLocation Location = PtrLocation::UNKNOWN>
struct sp::PtrScalar< T, Location >

Represents a scalar value that has been passed as a pointer.

Some APIs require accepting input scalars as pointers which may reside in host or device memory. This object represents such inputs, and can be targeted by PtrScalarSpecialiser to transparently cope with the pointer being on the host or device (ultimately resolving to an sp::Scalar).

Template Parameters
TThe data type of the scalar.
LocationWhich device the scalar is stored on, if known.

Member Data Documentation

◆ data

template<typename T , PtrLocation Location = PtrLocation::UNKNOWN>
const T* sp::PtrScalar< T, Location >::data

The scalar value.