Function rcudnn::cudaUserObjectCreate[][src]

pub unsafe extern "C" fn cudaUserObjectCreate(
    object_out: *mut *mut CUuserObject_st,
    ptr: *mut c_void,
    destroy: Option<unsafe extern "C" fn(*mut c_void)>,
    initialRefcount: u32,
    flags: u32
) -> cudaError
Expand description

\brief Create a user object

Create a user object with the specified destructor callback and initial reference count. The initial references are owned by the caller.

Destructor callbacks cannot make CUDA API calls and should avoid blocking behavior, as they are executed by a shared internal thread. Another thread may be signaled to perform such actions, if it does not block forward progress of tasks scheduled through CUDA.

See CUDA User Objects in the CUDA C++ Programming Guide for more information on user objects.

\param object_out - Location to return the user object handle \param ptr - The pointer to pass to the destroy function \param destroy - Callback to free the user object when it is no longer in use \param initialRefcount - The initial refcount to create the object with, typically 1. The initial references are owned by the calling thread. \param flags - Currently it is required to pass ::cudaUserObjectNoDestructorSync, which is the only defined flag. This indicates that the destroy callback cannot be waited on by any CUDA API. Users requiring synchronization of the callback should signal its completion manually.

\return ::cudaSuccess, ::cudaErrorInvalidValue

\sa ::cudaUserObjectRetain, ::cudaUserObjectRelease, ::cudaGraphRetainUserObject, ::cudaGraphReleaseUserObject, ::cudaGraphCreate