Memory management (deprecated)#

hipError_t hipMallocHost(void **ptr, size_t size)#

Allocate pinned host memory [Deprecated].

If size is 0, no memory is allocated, *ptr returns nullptr, and hipSuccess is returned.

Warning

This API is deprecated, use hipHostMalloc() instead

Parameters:
  • ptr[out] Pointer to the allocated host pinned memory

  • size[in] Requested memory size

Returns:

hipSuccess, hipErrorOutOfMemory

hipError_t hipMemAllocHost(void **ptr, size_t size)#

Allocate pinned host memory [Deprecated].

If size is 0, no memory is allocated, *ptr returns nullptr, and hipSuccess is returned.

Warning

This API is deprecated, use hipHostMalloc() instead

Parameters:
  • ptr[out] Pointer to the allocated host pinned memory

  • size[in] Requested memory size

Returns:

hipSuccess, hipErrorOutOfMemory

hipError_t hipHostFree(void *ptr)#

Free memory allocated by the HIP-Clang hip host memory allocation API This API performs an implicit hipDeviceSynchronize() call. If pointer is NULL, the hip runtime is initialized and hipSuccess is returned.

Parameters:

ptr[in] Pointer to memory to be freed

Returns:

hipSuccess, hipErrorInvalidValue (if pointer is invalid, including device pointers allocated with hipMalloc)

hipError_t hipMemcpyToArray(hipArray_t dst, size_t wOffset, size_t hOffset, const void *src, size_t count, hipMemcpyKind kind)#

Copies data between host and device [Deprecated].

Warning

This API is deprecated.

Parameters:
  • dst[in] Destination memory address

  • wOffset[in] Destination starting X offset

  • hOffset[in] Destination starting Y offset

  • src[in] Source memory address

  • count[in] size in bytes to copy

  • kind[in] Type of transfer

Returns:

hipSuccess, hipErrorInvalidValue, hipErrorInvalidPitchValue, hipErrorInvalidDevicePointer, hipErrorInvalidMemcpyDirection

hipError_t hipMemcpyFromArray(void *dst, hipArray_const_t srcArray, size_t wOffset, size_t hOffset, size_t count, hipMemcpyKind kind)#

Copies data between host and device [Deprecated].

Warning

This API is deprecated.

Parameters:
  • dst[in] Destination memory address

  • srcArray[in] Source memory address

  • wOffset[in] Source starting X offset

  • hOffset[in] Source starting Y offset

  • count[in] Size in bytes to copy

  • kind[in] Type of transfer

Returns:

hipSuccess, hipErrorInvalidValue, hipErrorInvalidPitchValue, hipErrorInvalidDevicePointer, hipErrorInvalidMemcpyDirection