pub unsafe extern "C" fn cudaGraphicsResourceSetMapFlags(
resource: cudaGraphicsResource_t,
flags: c_uint,
) -> cudaError_tExpand description
Set usage flags for mapping a graphics resource.
Set flags for mapping the graphics resource resource.
Changes to flags will take effect the next time resource is mapped. The flags argument may be any of the following:
- cudaGraphicsMapFlagsNone: Specifies no hints about how
resourcewill be used. It is therefore assumed that CUDA may read from or write toresource. - cudaGraphicsMapFlagsReadOnly: Specifies that CUDA will not write to
resource. - cudaGraphicsMapFlagsWriteDiscard: Specifies CUDA will not read from
resourceand will write over the entire contents ofresource, so none of the data previously stored inresourcewill be preserved.
If resource is presently mapped for access by CUDA then cudaError_t::CUDA_ERROR_UNKNOWN is returned. If flags is not one of the above values then cudaError_t::CUDA_ERROR_INVALID_VALUE is returned.
Note that this function may also return error codes from previous, asynchronous launches.
Note that this function may also return cudaError_t::CUDA_ERROR_NOT_INITIALIZED, cudaErrorInsufficientDriver or cudaError_t::CUDA_ERROR_NO_DEVICE if this call tries to initialize internal CUDA RT state.
Note that as specified by cudaStreamAddCallback no CUDA function may be called from callback. cudaError_t::CUDA_ERROR_NOT_PERMITTED may, but is not guaranteed to, be returned as a diagnostic in such case.
§Parameters
resource: Registered resource to set flags for.flags: Parameters for resource mapping.
§Return value
cudaError_t::CUDA_SUCCESScudaError_t::CUDA_ERROR_INVALID_VALUEcudaError_t::CUDA_ERROR_INVALID_HANDLEcudaError_t::CUDA_ERROR_UNKNOWN
See also: cudaGraphicsMapResources, cuGraphicsResourceSetMapFlags.