pub unsafe extern "C" fn cudaMemset2DAsync(
devPtr: *mut c_void,
pitch: size_t,
value: c_int,
width: size_t,
height: size_t,
stream: cudaStream_t,
) -> cudaError_tExpand description
Initializes or sets device memory to a value.
Sets to the specified value value a matrix (height rows of width bytes each) pointed to by dstPtr. pitch is the width in bytes of the 2D array pointed to by dstPtr, including any padding added to the end of each row. This function performs fastest when the pitch is one that has been passed back by cudaMallocPitch.
cudaMemset2DAsync is asynchronous with respect to the host, so the call may return before the memset is complete. The operation can optionally be associated to a stream by passing a non-zero stream argument. If stream is non-zero, the operation may overlap with operations in other streams.
The device version of this function only handles device to device copies and cannot be given local or shared pointers.
Note that this function may also return error codes from previous, asynchronous launches.
Note: See also memset synchronization details.
Note: This function uses standard default stream semantics.
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
devPtr: Pointer to 2D device memory.pitch: Pitch in bytes of 2D device memory(Unused ifheightis 1).value: Value to set for each byte of specified memory.width: Width of matrix set (columns in bytes).height: Height of matrix set (rows).stream: Stream identifier.
§Return value
See also: cudaMemset, cudaMemset2D, cudaMemset3D, cudaMemsetAsync, cudaMemset3DAsync, cuMemsetD2D8Async, cuMemsetD2D16Async, cuMemsetD2D32Async.