Skip to content

device

dnn

Device module.
More...


Data Structures

struct   morapi_DeviceCB
struct   morapi_Device
struct   morapi_DeviceBufCB
struct   morapi_DeviceBuf

Macros

#define  MORAPI_INSTALL_DEVICE(ENV, NAME, NUM, CB)
#define  MORAPI_INSTALL_DEVICE_BUF(ENV, NAME, CB)

Enumerations

enum   morapi_DeviceMemoryModel { MORAPI_DEVICE_MEMORY_MODEL_CPU, MORAPI_DEVICE_MEMORY_MODEL_DEDICATED }
enum   morapi_DeviceThreadModel { MORAPI_DEVICE_THREAD_MODEL_MULTI, MORAPI_DEVICE_THREAD_MODEL_SINGLE }


Detailed Description

Device module.


Macro Definition Documentation


MORAPI_INSTALL_DEVICE

#define MORAPI_INSTALL_DEVICE( ENV,
                               NAME,
                               NUM,
                               CB)

Install callback functions for the device and create them.

Parameters

  • ENV : environment.
  • NAME : device name ("cpu", "cuda", "opencl", ..).
  • NUM : the number of devices.
  • CB : callback structure (DeviceCpu, DeviceCuda, DeviceOpenCL, ..).


MORAPI_INSTALL_DEVICE_BUF

#define MORAPI_INSTALL_DEVICE_BUF( ENV,
                                   NAME,
                                   CB)

Install callback functions for the device buffer.

Parameters

  • ENV : environment.
  • NAME : device name ("cpu", "cuda", "opencl", ...).
  • CB : structure for callback functions (DeviceBufCpu, DeviceBufCuda, DeviceBufOpenCL, ...).

Enumeration Type Documentation


morapi_DeviceMemoryModel

enum morapi_DeviceMemoryModel

Device memory model.

Enumerator
MORAPI_DEVICE_MEMORY_MODEL_CPU 

uses CPU memory.

MORAPI_DEVICE_MEMORY_MODEL_DEDICATED 

has dedicated memory.


morapi_DeviceThreadModel

enum morapi_DeviceThreadModel

Device thread model.

Enumerator
MORAPI_DEVICE_THREAD_MODEL_MULTI 

multi-threads.

MORAPI_DEVICE_THREAD_MODEL_SINGLE 

signle thread.