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]. | |
hipError_t | hipMemAllocHost (void **ptr, size_t size) |
Allocate pinned host memory [Deprecated]. | |
hipError_t | hipHostAlloc (void **ptr, size_t size, unsigned int flags) |
Allocate device accessible page locked host memory [Deprecated]. | |
hipError_t | hipFreeHost (void *ptr) |
Free memory allocated by the hcc hip host memory allocation API [Deprecated]. | |
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. | |
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. | |
Detailed Description
This section describes the deprecated memory management functions of HIP runtime API.
Function Documentation
◆ hipFreeHost()
hipError_t hipFreeHost | ( | void * | ptr | ) |
Free memory allocated by the hcc hip host memory allocation API [Deprecated].
- Parameters
-
[in] ptr Pointer to memory to be freed
- Returns
- hipSuccess, hipErrorInvalidValue (if pointer is invalid, including device pointers allocated with hipMalloc)
- Warning
- This API is deprecated, use hipHostFree() instead
◆ hipHostAlloc()
hipError_t hipHostAlloc | ( | void ** | ptr, |
size_t | size, | ||
unsigned int | flags | ||
) |
Allocate device accessible page locked host memory [Deprecated].
- Parameters
-
[out] ptr Pointer to the allocated host pinned memory [in] size Requested memory size in bytes [in] flags Type of host memory allocation
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
◆ 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.
- 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.
- 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.