Skip to main content

cudaMemcpyFromArrayAsync

Function cudaMemcpyFromArrayAsync 

Source
pub unsafe extern "C" fn cudaMemcpyFromArrayAsync(
    dst: *mut c_void,
    src: cudaArray_const_t,
    wOffset: size_t,
    hOffset: size_t,
    count: size_t,
    kind: cudaMemcpyKind,
    stream: cudaStream_t,
) -> cudaError_t
๐Ÿ‘ŽDeprecated
Expand description

Copies data between host and device.

Copies count bytes from the CUDA array src starting at hOffset rows and wOffset bytes from the upper left corner to the memory area pointed to by dst, where kind specifies the direction of the copy, and must be one of cudaMemcpyKind::cudaMemcpyHostToHost, cudaMemcpyKind::cudaMemcpyHostToDevice, cudaMemcpyKind::cudaMemcpyDeviceToHost, cudaMemcpyKind::cudaMemcpyDeviceToDevice, or cudaMemcpyKind::cudaMemcpyDefault. Passing cudaMemcpyKind::cudaMemcpyDefault is recommended, in which case the type of transfer is inferred from the pointer values. However, cudaMemcpyKind::cudaMemcpyDefault is only allowed on systems that support unified virtual addressing.

cudaMemcpyFromArrayAsync is asynchronous with respect to the host, so the call may return before the copy is complete. The copy can optionally be associated to a stream by passing a non-zero stream argument. If kind is cudaMemcpyKind::cudaMemcpyHostToDevice or cudaMemcpyKind::cudaMemcpyDeviceToHost and stream is non-zero, the copy may overlap with operations in other streams.

ยงParameters

  • dst: Destination memory address.
  • src: Source memory address.
  • wOffset: Source starting X offset (columns in bytes).
  • hOffset: Source starting Y offset (rows).
  • count: Size in bytes to copy.
  • kind: Type of transfer.
  • stream: Stream identifier.