|
Open Deep Learning API
|
Go to the source code of this file.
Enumerations | |
| enum | odla_memcpy_type { ODLA_MEMCPY_H2H , ODLA_MEMCPY_H2D , ODLA_MEMCPY_D2H , ODLA_MEMCPY_D2D } |
| memory copy types More... | |
Functions | |
| ODLA_API_EXPORT odla_status ODLA_API_CALL | odla_AllocateDeviceMemory (odla_void **dev_ptr, odla_size_t size) |
| Allocate device memory. More... | |
| ODLA_API_EXPORT odla_status ODLA_API_CALL | odla_FreeDeviceMemory (odla_void *ptr) |
| Free device memory. More... | |
| ODLA_API_EXPORT odla_status ODLA_API_CALL | odla_AllocateHostMemory (odla_void **host_ptr, odla_size_t size) |
| Allocate host memory. More... | |
| ODLA_API_EXPORT odla_status ODLA_API_CALL | odla_FreeHostMemory (odla_void *ptr) |
| Free host memory. More... | |
| ODLA_API_EXPORT odla_status ODLA_API_CALL | odla_CopyMemory (odla_void *dst, odla_void *src, odla_size_t size, odla_memcpy_type type) |
| Copy data between host and device. More... | |
This file defines the ODLA memory related APIs.
Definition in file odla_memory.h.
| enum odla_memcpy_type |
memory copy types
Definition at line 32 of file odla_memory.h.
| ODLA_API_EXPORT odla_status ODLA_API_CALL odla_AllocateDeviceMemory | ( | odla_void ** | dev_ptr, |
| odla_size_t | size | ||
| ) |
Allocate device memory.
| devPtr | the pointer to allocated device memory |
| size | the requested allocation size in bytes |
| ODLA_API_EXPORT odla_status ODLA_API_CALL odla_AllocateHostMemory | ( | odla_void ** | host_ptr, |
| odla_size_t | size | ||
| ) |
Allocate host memory.
| ptr | the pointer to allocated host memory |
| size | the requested allocation size in bytes |
| ODLA_API_EXPORT odla_status ODLA_API_CALL odla_CopyMemory | ( | odla_void * | dst, |
| odla_void * | src, | ||
| odla_size_t | size, | ||
| odla_memcpy_type | type | ||
| ) |
Copy data between host and device.
| dst | the destination memory address |
| src | the source memory address |
| size | the size in bytes to copy |
| type | the memory copy type |
| ODLA_API_EXPORT odla_status ODLA_API_CALL odla_FreeDeviceMemory | ( | odla_void * | ptr | ) |
Free device memory.
| devPtr | the device pointer to memory to free |
| ODLA_API_EXPORT odla_status ODLA_API_CALL odla_FreeHostMemory | ( | odla_void * | ptr | ) |
Free host memory.
| ptr | the host pointer to memory to free |