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.
- Parameters:
-
| devPtr | - Pointer to 2D device memory |
| pitch | - Pitch in bytes of 2D device memory |
| 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 |
- Returns:
- cudaSuccess, cudaErrorInvalidValue, cudaErrorInvalidDevicePointer
- Note:
- Note that this function may also return error codes from previous, asynchronous launches.
- See also:
- cudaMemset, cudaMemset2D, cudaMemset3D, cudaMemsetAsync, cudaMemset3DAsync