|  | 
Copies a matrix (heightrows ofwidthbytes each) from the memory area pointed to bysrcto the memory area pointed to bydst, wherekindis one of cudaMemcpyHostToHost, cudaMemcpyHostToDevice, cudaMemcpyDeviceToHost, or cudaMemcpyDeviceToDevice, and specifies the direction of the copy.dpitchandspitchare the widths in memory in bytes of the 2D arrays pointed to bydstandsrc, including any padding added to the end of each row. The memory areas may not overlap.widthmust not exceed eitherdpitchorspitch. Calling cudaMemcpy2DAsync() withdstandsrcpointers that do not match the direction of the copy results in an undefined behavior. cudaMemcpy2DAsync() returns an error ifdpitchorspitchis greater than the maximum allowed. 
cudaMemcpy2DAsync() is asynchronous with respect to the host, so the call may return before the copy is complete. It only works on page-locked host memory and returns an error if a pointer to pageable memory is passed as input. The copy can optionally be associated to a stream by passing a non-zero streamargument. Ifkindis cudaMemcpyHostToDevice or cudaMemcpyDeviceToHost andstreamis non-zero, the copy may overlap with operations in other streams. 
 Parameters:
  
    |  | dst | - Destination memory address |  |  | dpitch | - Pitch of destination memory |  |  | src | - Source memory address |  |  | spitch | - Pitch of source memory |  |  | width | - Width of matrix transfer (columns in bytes) |  |  | height | - Height of matrix transfer (rows) |  |  | kind | - Type of transfer |  |  | stream | - Stream identifier | 
 Returns:cudaSuccess, cudaErrorInvalidValue, cudaErrorInvalidPitchValue, cudaErrorInvalidDevicePointer, cudaErrorInvalidMemcpyDirection 
 Note:Note that this function may also return error codes from previous, asynchronous launches.
 See also:cudaMemcpy, cudaMemcpy2D, cudaMemcpyToArray, cudaMemcpy2DToArray, cudaMemcpyFromArray, cudaMemcpy2DFromArray, cudaMemcpyArrayToArray, cudaMemcpy2DArrayToArray, cudaMemcpyToSymbol, cudaMemcpyFromSymbol, cudaMemcpyAsync, cudaMemcpyToArrayAsync, cudaMemcpy2DToArrayAsync, cudaMemcpyFromArrayAsync, cudaMemcpy2DFromArrayAsync, cudaMemcpyToSymbolAsync, cudaMemcpyFromSymbolAsync 
 
     |