46 Module DocumentationSee also:cudaMemcpy, cudaMemcpy2D, cudaMemcpyToArray, cudaMemcpy2DToArray, cudaMemcpyFromArray, cudaMemcpy2DFromArray,cudaMemcpyArrayToArray, cudaMemcpy2DArrayToArray, cudaMemcpyToSymbol,cudaMemcpyFromSymbol, cudaMemcpyAsync, cudaMemcpy2DAsync, cudaMemcpyToArrayAsync, cudaMemcpy2DToArrayAsync,cudaMemcpyFromArrayAsync, cudaMemcpy2DFromArrayAsync, cudaMemcpy-ToSymbolAsync3.8.2.30 cudaError_t cudaMemcpyToArray (struct cudaArray ∗ dst, size_t wOffset, size_t hOffset, constvoid ∗ src, size_t count, enum cudaMemcpyKind kind)Copies count bytes from the memory area pointed to by src to the <strong>CUDA</strong> array dst starting at the upper left corner(wOffset, hOffset), where kind is one of cudaMemcpyHostToHost, cudaMemcpyHostToDevice, cudaMemcpy-DeviceToHost, or cudaMemcpyDeviceToDevice, and specifies the direction of the copy.Parameters:dst - Destination memory addresswOffset - Destination starting X offsethOffset - Destination starting Y offsetsrc - Source memory addresscount - Size in bytes to copykind - Type of transferReturns:Note:See also:cudaSuccess, cudaErrorInvalidValue, cudaErrorInvalidDevicePointer, cudaErrorInvalidMemcpyDirectionNote that this function may also return error codes from previous, asynchronous launches.cudaMemcpy, cudaMemcpy2D, cudaMemcpy2DToArray, cudaMemcpyFromArray, cudaMemcpy2DFromArray,cudaMemcpyArrayToArray, cudaMemcpy2DArrayToArray, cudaMemcpyToSymbol,cudaMemcpyFromSymbol, cudaMemcpyAsync, cudaMemcpy2DAsync, cudaMemcpyToArrayAsync, cudaMemcpy2DToArrayAsync,cudaMemcpyFromArrayAsync, cudaMemcpy2DFromArrayAsync, cudaMemcpy-ToSymbolAsync, cudaMemcpyFromSymbolAsync3.8.2.31 cudaError_t cudaMemcpyToArrayAsync (struct cudaArray ∗ dst, size_t wOffset, size_t hOffset,const void ∗ src, size_t count, enum cudaMemcpyKind kind, cudaStream_t stream)Copies count bytes from the memory area pointed to by src to the <strong>CUDA</strong> array dst starting at the upper left corner(wOffset, hOffset), where kind is one of cudaMemcpyHostToHost, cudaMemcpyHostToDevice, cudaMemcpy-DeviceToHost, or cudaMemcpyDeviceToDevice, and specifies the direction of the copy.cudaMemcpyToArrayAsync() is asynchronous with respect to the host, so the call may return before the copy iscomplete. It only works on page-locked host memory and returns an error if a pointer to pageable memory is passedas input. The copy can optionally be associated to a stream by passing a non-zero stream argument. If kindis cudaMemcpyHostToDevice or cudaMemcpyDeviceToHost and stream is non-zero, the copy may overlap withoperations in other streams.IMPORTANT NOTE: Copies with kind == cudaMemcpyDeviceToDevice are asynchronous with respect to thehost, but never overlap with kernel execution.Generated on Wed Apr 1 16:11:42 2009 for <strong>NVIDIA</strong> <strong>CUDA</strong> Library by Doxygen
3.8 Memory Management 47Parameters:dst - Destination memory addresswOffset - Destination starting X offsethOffset - Destination starting Y offsetsrc - Source memory addresscount - Size in bytes to copykind - Type of transferstream - Stream identifierReturns:Note:See also:cudaSuccess, cudaErrorInvalidValue, cudaErrorInvalidDevicePointer, cudaErrorInvalidMemcpyDirectionNote that this function may also return error codes from previous, asynchronous launches.cudaMemcpy, cudaMemcpy2D, cudaMemcpyToArray, cudaMemcpy2DToArray, cudaMemcpyFromArray, cudaMemcpy2DFromArray,cudaMemcpyArrayToArray, cudaMemcpy2DArrayToArray, cudaMemcpyToSymbol,cudaMemcpyFromSymbol, cudaMemcpyAsync, cudaMemcpy2DAsync, cudaMemcpy2DToArrayAsync,cudaMemcpyFromArrayAsync, cudaMemcpy2DFromArrayAsync, cudaMemcpyToSymbolAsync, cudaMemcpyFromSymbolAsync3.8.2.32 cudaError_t cudaMemcpyToSymbol (const char ∗ symbol, const void ∗ src, size_t count, size_toffset, enum cudaMemcpyKind kind)Copies count bytes from the memory area pointed to by src to the memory area pointed to by offset bytes fromthe start of symbol symbol. The memory areas may not overlap. symbol can either be a variable that resides inglobal or constant memory space, or it can be a character string, naming a variable that resides in global or constantmemory space. kind can be either cudaMemcpyHostToDevice or cudaMemcpyDeviceToDevice.Parameters:symbol - Symbol destination on devicesrc - Source memory addresscount - Size in bytes to copyoffset - Offset from start of symbol in byteskind - Type of transferReturns:Note:cudaSuccess, cudaErrorInvalidValue, cudaErrorInvalidSymbol, cudaErrorInvalidDevicePointer, cudaErrorInvalidMemcpyDirectionNote that this function may also return error codes from previous, asynchronous launches.Generated on Wed Apr 1 16:11:42 2009 for <strong>NVIDIA</strong> <strong>CUDA</strong> Library by Doxygen