Public Member Functions | List of all members
kvikio::detail::AnyCallable Class Reference

Non-templated class to hold any callable that returns CUresult. More...

#include <cuda.hpp>

Public Member Functions

template<typename Callable >
void set (Callable &&c)
 Assign a callable to the object. More...
 
void reset ()
 Destroy the contained callable.
 
template<typename... Args>
CUresult operator() (Args... args)
 Invoke the container callable. More...
 
 operator bool () const
 Check if the object holds a callable.
 

Detailed Description

Non-templated class to hold any callable that returns CUresult.

Definition at line 31 of file cuda.hpp.

Member Function Documentation

◆ operator()()

template<typename... Args>
CUresult kvikio::detail::AnyCallable::operator() ( Args...  args)
inline

Invoke the container callable.

Template Parameters
ArgsTypes of the argument. Must exactly match the parameter types of the contained callable. For example, if the parameter is std::size_t*, an argument of nullptr must be explicitly cast to std::size_t*.
Parameters
argsArguments to be passed
Returns
CUDA driver API error code
Exceptions
std::bad_any_castif any argument type does not exactly match the parameter type of the contained callable.

Definition at line 65 of file cuda.hpp.

◆ set()

template<typename Callable >
void kvikio::detail::AnyCallable::set ( Callable &&  c)
inline

Assign a callable to the object.

Template Parameters
CallableA callable that must return CUresult
Parameters
cThe callable object

Definition at line 43 of file cuda.hpp.


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