Memory Management [Deprecated]

Memory Management [Deprecated]#

HIP Runtime API Reference: 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 hipFreeHost (void *ptr)
 Frees page-locked memory This API performs an implicit hipDeviceSynchronize() call. If pointer is NULL, the hip runtime is initialized and hipSuccess is returned.
 
hipError_t hipHostFree (void *ptr)
 Free memory allocated by the hcc 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.
 
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].
 
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].
 

Detailed Description



This section describes the deprecated memory management functions of HIP runtime API.

Function Documentation

◆ hipFreeHost()

hipError_t hipFreeHost ( void *  ptr)

Frees page-locked memory This API performs an implicit hipDeviceSynchronize() call. If pointer is NULL, the hip runtime is initialized and hipSuccess is returned.

Parameters
[in]ptrPointer to memory to be freed
Returns
hipSuccess, hipErrorInvalidValue (if pointer is invalid, including device pointers allocated with hipMalloc)

◆ hipHostFree()

hipError_t hipHostFree ( void *  ptr)

Free memory allocated by the hcc 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]ptrPointer to memory to be freed
Returns
hipSuccess, hipErrorInvalidValue (if pointer is invalid, including device pointers allocated with hipMalloc)
See also
hipMalloc, hipMallocPitch, hipFree, hipMallocArray, hipFreeArray, hipMalloc3D, hipMalloc3DArray, hipHostMalloc

◆ hipMallocHost()

hipError_t hipMallocHost ( void **  ptr,
size_t  size 
)

Allocate pinned host memory [Deprecated].

Parameters
[out]ptrPointer to the allocated host pinned memory
[in]sizeRequested 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]ptrPointer to the allocated host pinned memory
[in]sizeRequested 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]dstDestination memory address
[in]srcArraySource memory address
[in]wOffsetSource starting X offset
[in]hOffsetSource starting Y offset
[in]countSize in bytes to copy
[in]kindType 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]dstDestination memory address
[in]wOffsetDestination starting X offset
[in]hOffsetDestination starting Y offset
[in]srcSource memory address
[in]countsize in bytes to copy
[in]kindType of transfer
Returns
hipSuccess, hipErrorInvalidValue, hipErrorInvalidPitchValue, hipErrorInvalidDevicePointer, hipErrorInvalidMemcpyDirection
See also
hipMemcpy, hipMemcpy2DToArray, hipMemcpy2D, hipMemcpyFromArray, hipMemcpyToSymbol, hipMemcpyAsync
Warning
This API is deprecated.