|
| hipError_t | hipMalloc (void **ptr, size_t size) |
| | Allocate memory on the default accelerator. More...
|
| |
| hipError_t | hipMallocHost (void **ptr, size_t size) |
| | Allocate pinned host memory. More...
|
| |
| hipError_t | hipFree (void *ptr) |
| | Free memory allocated by the hcc hip memory allocation API. This API performs an implicit hipDeviceSynchronize() call. More...
|
| |
| hipError_t | hipFreeHost (void *ptr) |
| | Free memory allocated by the hcc hip host memory allocation API. More...
|
| |
| hipError_t | hipMemcpy (void *dst, const void *src, size_t sizeBytes, hipMemcpyKind kind) |
| | Copy data from src to dst. More...
|
| |
| hipError_t | hipMemcpyToSymbol (const char *symbolName, const void *src, size_t sizeBytes, size_t offset, hipMemcpyKind kind) |
| | Copies sizeBytes bytes from the memory area pointed to by src to the memory area pointed to by offset bytes from the start of symbol symbol. More...
|
| |
| hipError_t | hipMemcpyAsync (void *dst, const void *src, size_t sizeBytes, hipMemcpyKind kind, hipStream_t stream=0) |
| | Copy data from src to dst asynchronously. More...
|
| |
| hipError_t | hipMemset (void *dst, int value, size_t sizeBytes) |
| | Copy data from src to dst asynchronously. More...
|
| |
| hipError_t | hipMemsetAsync (void *dst, int value, size_t sizeBytes, hipStream_t=0) |
| | Fills the first sizeBytes bytes of the memory area pointed to by dev with the constant byte value value. More...
|
| |
|
hipError_t | hipMemGetInfo (size_t *free, size_t *total) |
| |
----------------------------------------------------------------------------------------------—
The following CUDA APIs are not currently supported:
- cudaMalloc3D
- cudaMalloc3DArray
- TODO - more 2D, 3D, array APIs here.
Free memory allocated by the hcc hip host memory allocation API.
- Parameters
-
| [in] | ptr | Pointer to memory to be freed |
- Returns
- hipSuccess, hipErrorMemoryFree
Allocate memory on the default accelerator.
- Parameters
-
| [out] | ptr | Pointer to the allocated memory |
| [in] | size | Requested memory size |
- Returns
- hipSuccess
| hipError_t hipMallocHost |
( |
void ** |
ptr, |
|
|
size_t |
size |
|
) |
| |
Allocate pinned host memory.
- Parameters
-
| [out] | ptr | Pointer to the allocated host pinned memory |
| [in] | size | Requested memory size |
- Returns
- Error code
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. TODO: cudaErrorInvalidMemcpyDirection error code is not supported right now, use hipErrorUnknown for now
- Parameters
-
| [out] | dst | Data being copy to |
| [in] | src | Data being copy from |
| [in] | sizeBytes | Data size in bytes |
| [in] | copyType | Memory copy type |
- Returns
- hipSuccess, hipErrorInvalidValue, hipErrorMemoryFree, hipErrorUnknown
Copy data from src to dst asynchronously.
TODO: cudaErrorInvalidMemcpyDirection error code is not supported right now, use hipErrorUnknown for now
- Parameters
-
| [out] | dst | Data being copy to |
| [in] | src | Data being copy from |
| [in] | sizeBytes | Data size in bytes |
| [in] | accelerator_view | Accelerator view which the copy is being enqueued |
- Returns
- hipSuccess, hipErrorInvalidValue, hipErrorMemoryFree, hipErrorUnknown
| hipError_t hipMemcpyToSymbol |
( |
const char * |
symbolName, |
|
|
const void * |
src, |
|
|
size_t |
sizeBytes, |
|
|
size_t |
offset, |
|
|
hipMemcpyKind |
kind |
|
) |
| |
Copies sizeBytes bytes from the memory area pointed to by src to the memory area pointed to by offset bytes from the start of symbol symbol.
The memory areas may not overlap. Symbol can either be a variable that resides in global or constant memory space, or it can be a character string, naming a variable that resides in global or constant memory space. Kind can be either hipMemcpyHostToDevice or hipMemcpyDeviceToDevice TODO: cudaErrorInvalidSymbol and cudaErrorInvalidMemcpyDirection is not supported, use hipErrorUnknown for now.
- Parameters
-
| [in] | symbolName | - Symbol destination on device |
| [in] | src | - Data being copy from |
| [in] | sizeBytes | - Data size in bytes |
| [in] | offset | - Offset from start of symbol in bytes |
| [in] | kind | - Type of transfer |
- Returns
- hipSuccess, hipErrorInvalidValue, hipErrorMemoryFree, hipErrorUnknown
| hipError_t hipMemset |
( |
void * |
dst, |
|
|
int |
value, |
|
|
size_t |
sizeBytes |
|
) |
| |
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] | dst | Data being copy to |
| [in] | src | Data being copy from |
| [in] | sizeBytes | Data size in bytes |
| [in] | accelerator_view | Accelerator view which the copy is being enqueued |
- Returns
- hipSuccess, hipErrorInvalidValue, hipErrorMemoryFree
Fills the first sizeBytes bytes of the memory area pointed to by dev with the constant byte value value.
hipMemsetAsync() is asynchronous with respect to the host, so the call may return before the memset is complete. The operation can optionally be associated to a stream by passing a non-zero stream argument. If stream is non-zero, the operation may overlap with operations in other streams.
- Parameters
-
| [out] | dst | Pointer to device memory |
| [in] | value | - Value to set for each byte of specified memory |
| [in] | sizeBytes | - Size in bytes to set |
| [in] | stream | - Stream identifier |
- Returns
- hipSuccess, hipErrorInvalidValue, hipErrorMemoryFree