Memory Management [Deprecated]#
Memory Management [Deprecated]
  
Collaboration diagram for Memory Management [Deprecated]:
Functions | |
| hipError_t | hipMallocHost (void **ptr, size_t size) | 
| Allocate pinned host memory [Deprecated].  More... | |
| hipError_t | hipMemAllocHost (void **ptr, size_t size) | 
| Allocate pinned host memory [Deprecated].  More... | |
| 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.  More... | |
| 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].  More... | |
| 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].  More... | |
Detailed Description
This section describes the deprecated memory management functions of HIP runtime API.
Function Documentation
◆ hipHostFree()
| 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
 - 
  
[in] ptr Pointer to memory to be freed  
- Returns
 - hipSuccess, hipErrorInvalidValue (if pointer is invalid, including device pointers allocated with hipMalloc)
 
◆ hipMallocHost()
| hipError_t hipMallocHost | ( | void ** | ptr, | 
| size_t | size | ||
| ) | 
Allocate pinned host memory [Deprecated].
- Parameters
 - 
  
[out] ptr Pointer to the allocated host pinned memory [in] size Requested memory size  
If size is 0, no memory is allocated, *ptr returns nullptr, and hipSuccess is returned.
- Returns
 - hipSuccess, hipErrorOutOfMemory
 
- Warning
 - This API is deprecated, use hipHostMalloc() instead
 
◆ hipMemAllocHost()
| hipError_t hipMemAllocHost | ( | void ** | ptr, | 
| size_t | size | ||
| ) | 
Allocate pinned host memory [Deprecated].
- Parameters
 - 
  
[out] ptr Pointer to the allocated host pinned memory [in] size Requested memory size  
If size is 0, no memory is allocated, *ptr returns nullptr, and hipSuccess is returned.
- Returns
 - hipSuccess, hipErrorOutOfMemory
 
- Warning
 - This API is deprecated, use hipHostMalloc() instead
 
◆ hipMemcpyFromArray()
| 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].
- Parameters
 - 
  
[in] dst Destination memory address [in] srcArray Source memory address [in] wOffset Source starting X offset [in] hOffset Source starting Y offset [in] count Size in bytes to copy [in] kind Type of transfer  
- Returns
 - hipSuccess, hipErrorInvalidValue, hipErrorInvalidPitchValue, hipErrorInvalidDevicePointer, hipErrorInvalidMemcpyDirection
 
- See also
 - hipMemcpy, hipMemcpy2DToArray, hipMemcpy2D, hipMemcpyFromArray, hipMemcpyToSymbol, hipMemcpyAsync
 
- Warning
 - This API is deprecated.
 
◆ hipMemcpyToArray()
| 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].
- Parameters
 - 
  
[in] dst Destination memory address [in] wOffset Destination starting X offset [in] hOffset Destination starting Y offset [in] src Source memory address [in] count size in bytes to copy [in] kind Type of transfer  
- Returns
 - hipSuccess, hipErrorInvalidValue, hipErrorInvalidPitchValue, hipErrorInvalidDevicePointer, hipErrorInvalidMemcpyDirection
 
- See also
 - hipMemcpy, hipMemcpy2DToArray, hipMemcpy2D, hipMemcpyFromArray, hipMemcpyToSymbol, hipMemcpyAsync
 
- Warning
 - This API is deprecated.