Function rcudnn::cudaGraphicsResourceSetMapFlags[][src]

pub unsafe extern "C" fn cudaGraphicsResourceSetMapFlags(
    resource: *mut cudaGraphicsResource,
    flags: u32
) -> cudaError
Expand description

\brief Set usage flags for mapping a graphics resource

Set \p flags for mapping the graphics resource \p resource.

Changes to \p flags will take effect the next time \p resource is mapped. The \p flags argument may be any of the following:

  • ::cudaGraphicsMapFlagsNone: Specifies no hints about how \p resource will be used. It is therefore assumed that CUDA may read from or write to \p resource.
  • ::cudaGraphicsMapFlagsReadOnly: Specifies that CUDA will not write to \p resource.
  • ::cudaGraphicsMapFlagsWriteDiscard: Specifies CUDA will not read from \p resource and will write over the entire contents of \p resource, so none of the data previously stored in \p resource will be preserved.

If \p resource is presently mapped for access by CUDA then ::cudaErrorUnknown is returned. If \p flags is not one of the above values then ::cudaErrorInvalidValue is returned.

\param resource - Registered resource to set flags for \param flags - Parameters for resource mapping

\return ::cudaSuccess, ::cudaErrorInvalidValue, ::cudaErrorInvalidResourceHandle, ::cudaErrorUnknown, \notefnerr \note_init_rt \note_callback

\sa ::cudaGraphicsMapResources, ::cuGraphicsResourceSetMapFlags