HIP: Heterogenous-computing Interface for Portability
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
Memory Management

Functions

hipError_t hipMalloc (void **ptr, size_t size)
 
hipError_t hipMallocHost (void **ptr, size_t size)
 
hipError_t hipFree (void *ptr)
 
hipError_t hipFreeHost (void *ptr)
 
hipError_t hipMemcpy (void *dst, const void *src, size_t sizeBytes, hipMemcpyKind kind)
 
hipError_t hipMemcpyToSymbol (const char *symbolName, const void *src, size_t sizeBytes, size_t offset, hipMemcpyKind kind)
 
hipError_t hipMemcpyAsync (void *dst, const void *src, size_t sizeBytes, hipMemcpyKind kind, hipStream_t stream=0)
 
hipError_t hipMemset (void *dst, int value, size_t sizeBytes)
 
hipError_t hipMemsetAsync (void *dst, int value, size_t sizeBytes, hipStream_t=0)
 
hipError_t hipMemGetInfo (size_t *free, size_t *total)
 

Detailed Description

----------------------------------------------------------------------------------------------—

The following CUDA APIs are not currently supported:

Function Documentation

hipError_t hipFree ( void *  ptr)

Free memory allocated by the hcc hip memory allocation API. This API performs an implicit hipDeviceSynchronize() call.

Parameters
[in]ptrPointer to memory to be freed
Returns
Error code
hipError_t hipFreeHost ( void *  ptr)

Free memory allocated by the hcc hip host memory allocation API

Parameters
[in]ptrPointer to memory to be freed
Returns
Error code
hipError_t hipMalloc ( void **  ptr,
size_t  size 
)

Allocate memory on the default accelerator

Parameters
[out]ptrPointer to the allocated memory
[in]sizeRequested memory size
Returns
hipSuccess
hipError_t hipMallocHost ( void **  ptr,
size_t  size 
)

Allocate pinned host memory

Parameters
[in]ptrPointer to the allocated host pinned memory
[out]sizeRequested memory size
Returns
Error code
hipError_t hipMemcpy ( void *  dst,
const void *  src,
size_t  sizeBytes,
hipMemcpyKind  kind 
)

Copy data from src to dst. It supports memory from host to device, device to host, device to device and host to host The src and dst must not overlap. If the

This function is host-synchronous for most inputs. It uses the default NULL stream and will synchronize with other blocking streams on the same device.

Parameters
being copy to
[in]srcData being copy from
[in]sizeBytesData size in bytes
[in]copyTypeMemory copy type
Returns
Error code
hipError_t hipMemcpyAsync ( void *  dst,
const void *  src,
size_t  sizeBytes,
hipMemcpyKind  kind,
hipStream_t  stream = 0 
)

Copy data from src to dst asynchronously. It supports memory from host to device, device to host, device to device and host to host.

Parameters
[out]dstData being copy to
[in]srcData being copy from
[in]sizeBytesData size in bytes
[in]accelerator_viewAccelerator view which the copy is being enqueued
Returns
Error code