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 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]ptrPointer 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]ptrPointer to the allocated host pinned memory
[in]sizeRequested memory size in bytes
[in]flagsType 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]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.

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.

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.