cuda::experimental::stf::ctx_resource#

class ctx_resource#

Generic container for a resource that needs to be retained until a context has consumed them.

Subclassed by cuda::experimental::stf::reserved::host_callback_args_resource< WrapperType >

Public Functions

ctx_resource() = default#
virtual ~ctx_resource() = default#
ctx_resource(const ctx_resource&) = delete#
ctx_resource &operator=(const ctx_resource&) = delete#
inline virtual void release(cudaStream_t)#

Release asynchronously (only called if can_release_in_callback() returns false)

inline virtual bool can_release_in_callback() const#

Returns true if this resource can be released in a host callback without using the stream Resources that return true will be batched together into a single callback to avoid the overhead of creating individual host callbacks for each resource release.

inline virtual void release_in_callback()#

Release synchronously on the host (only called if can_release_in_callback() returns true) This will be called from within a batched host callback to minimize callback overhead.