Cutlass CUDA Templates for Linear Algebra Subroutines and Solvers

Public Types | Public Member Functions | List of all members
cutlass::detail::ScalarOrPointer< Scalar_ > Class Template Reference

`#include <scalar_or_pointer.h>`

## Public Types
typedef Scalar_ | Scalar
| Underlying scalar type. More...

## Public Member Functions
CUTLASS_HOST_DEVICE | ScalarOrPointer ()
| Default ctor. More...
CUTLASS_HOST_DEVICE | ScalarOrPointer (Scalar const &val)
| Object behaves as a scalar. More...
CUTLASS_HOST_DEVICE | ScalarOrPointer (Scalar const *ptr_)
| Object behaves as a scalar. More...
CUTLASS_HOST_DEVICE bool | is_pointer () const
| Returns true if is pointer. More...
CUTLASS_HOST_DEVICE Scalar const * | get_ptr () const
| Gets the pointer value. More...
CUTLASS_HOST_DEVICE Scalar | get_scalar () const
| Gets the pointer value. More...
CUTLASS_HOST_DEVICE ScalarOrPointer & | operator= (Scalar const &scalar_)
| Assigns to a scalar and sets pointer to nullptr. More...
CUTLASS_HOST_DEVICE ScalarOrPointer & | operator= (Scalar const *ptr_)
| Assigns to a pointer value. More...
CUTLASS_HOST_DEVICE Scalar | get () const
| Access the element. More...
CUTLASS_HOST_DEVICE | operator Scalar () const
| Accesses the element. More...

## Detailed Description

### template<typename Scalar_>
class cutlass::detail::ScalarOrPointer< Scalar_ >

Helper class defines an object which operates as either a scalar or a pointer. If the pointer is non-null, it is dereferenced when the object is accessed.

## Member Typedef Documentation

## ◆ Scalar

template<typename Scalar_>

typedef Scalar_ cutlass::detail::ScalarOrPointer< Scalar_ >::Scalar

## Constructor & Destructor Documentation

## ◆ ScalarOrPointer() [1/3]

template<typename Scalar_>

CUTLASS_HOST_DEVICE cutlass::detail::ScalarOrPointer< Scalar_ >::ScalarOrPointer | ( |  | ) |
| inline

## ◆ ScalarOrPointer() [2/3]

template<typename Scalar_>

CUTLASS_HOST_DEVICE cutlass::detail::ScalarOrPointer< Scalar_ >::ScalarOrPointer | ( | Scalar const & | val | ) |
| inline

## ◆ ScalarOrPointer() [3/3]

template<typename Scalar_>

CUTLASS_HOST_DEVICE cutlass::detail::ScalarOrPointer< Scalar_ >::ScalarOrPointer | ( | Scalar const * | ptr_ | ) |
| inline

## Member Function Documentation

## ◆ get()

template<typename Scalar_>

CUTLASS_HOST_DEVICE Scalar cutlass::detail::ScalarOrPointer< Scalar_ >::get | ( |  | ) | const
| inline

## ◆ get_ptr()

template<typename Scalar_>

CUTLASS_HOST_DEVICE Scalar const* cutlass::detail::ScalarOrPointer< Scalar_ >::get_ptr | ( |  | ) | const
| inline

## ◆ get_scalar()

template<typename Scalar_>

CUTLASS_HOST_DEVICE Scalar cutlass::detail::ScalarOrPointer< Scalar_ >::get_scalar | ( |  | ) | const
| inline

## ◆ is_pointer()

template<typename Scalar_>

CUTLASS_HOST_DEVICE bool cutlass::detail::ScalarOrPointer< Scalar_ >::is_pointer | ( |  | ) | const
| inline

## ◆ operator Scalar()

template<typename Scalar_>

CUTLASS_HOST_DEVICE cutlass::detail::ScalarOrPointer< Scalar_ >::operator Scalar | ( |  | ) | const
| inline

## ◆ operator=() [1/2]

template<typename Scalar_>

CUTLASS_HOST_DEVICE ScalarOrPointer& cutlass::detail::ScalarOrPointer< Scalar_ >::operator= | ( | Scalar const & | scalar_ | ) |
| inline

## ◆ operator=() [2/2]

template<typename Scalar_>

CUTLASS_HOST_DEVICE ScalarOrPointer& cutlass::detail::ScalarOrPointer< Scalar_ >::operator= | ( | Scalar const * | ptr_ | ) |
| inline

The documentation for this class was generated from the following file:

- scalar_or_pointer.h