Skip to main content

cudaMemcpyToArray

Function cudaMemcpyToArray 

Source
pub unsafe extern "C" fn cudaMemcpyToArray(
    dst: cudaArray_t,
    wOffset: size_t,
    hOffset: size_t,
    src: *const c_void,
    count: size_t,
    kind: cudaMemcpyKind,
) -> cudaError_t
👎Deprecated
Expand description

Copies data between host and device.

Copies count bytes from the memory area pointed to by src to the CUDA array dst starting at hOffset rows and wOffset bytes from the upper left corner, 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.

Note that this function may also return error codes from previous, asynchronous launches.

Note: This function exhibits synchronous behavior for most use cases.

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

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

§Return value

See also: cudaMemcpy, cudaMemcpy2D, cudaMemcpy2DToArray, cudaMemcpyFromArray, cudaMemcpy2DFromArray, cudaMemcpyArrayToArray, cudaMemcpy2DArrayToArray, cudaMemcpyToSymbol, cudaMemcpyFromSymbol, cudaMemcpyAsync, cudaMemcpy2DAsync, cudaMemcpyToArrayAsync, cudaMemcpy2DToArrayAsync, cudaMemcpyFromArrayAsync, cudaMemcpy2DFromArrayAsync, cudaMemcpyToSymbolAsync, cudaMemcpyFromSymbolAsync, cuMemcpyHtoA, cuMemcpyDtoA.