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

Similar to a PtrScalar, but with the added quirk that the type of the scalar is not known at compile-time. More...

#include <CudaScalar.hpp>

Public Member Functions

 CudaVariantScalar (const void *data, cudaDataType_t type)
 

Public Attributes

const void * data
 The pointer. More...
 
cudaDataType_t type
 Value representing the real type of the pointer. More...
 

Detailed Description

template<PtrLocation Location = PtrLocation::UNKNOWN>
struct sp::CudaVariantScalar< Location >

Similar to a PtrScalar, but with the added quirk that the type of the scalar is not known at compile-time.

This struct stores the scalar type as an enum value which can be resolved to the appropriate scalar type using VariantScalarSpecialiser. When doing so, it's important to use the filtering interface of Specialisable to avoid generating an unreasonably large number of specialisations.

Member Data Documentation

◆ data

template<PtrLocation Location = PtrLocation::UNKNOWN>
const void* sp::CudaVariantScalar< Location >::data

The pointer.

◆ type

template<PtrLocation Location = PtrLocation::UNKNOWN>
cudaDataType_t sp::CudaVariantScalar< Location >::type

Value representing the real type of the pointer.