File PlatformConfig.h

Parent directory (DlSystem)

Definition (DlSystem/PlatformConfig.h)

Includes

Full File Listing

Typedefs

typedef void *Snpe_UserGLConfig_Handle_t

A structure OpenGL configuration

Note

When certain OpenGL context and display are provided to UserGLConfig for using GPU buffer as input directly, the user MUST ensure the particular OpenGL context and display remain vaild throughout the execution of neural network models.

typedef void *Snpe_UserGpuConfig_Handle_t

A structure Gpu configuration

typedef void *Snpe_PlatformConfig_Handle_t

A typedef to indicate a SNPE PlatformConfig handle

Enums

enum Snpe_PlatformConfig_PlatformType_t

Values:

enumerator SNPE_PLATFORMCONFIG_PLATFORMTYPE_UNKNOWN = 0

Unknown platform type.

enumerator SNPE_PLATFORMCONFIG_PLATFORMTYPE_CPU = 1

Snapdragon CPU.

enumerator SNPE_PLATFORMCONFIG_PLATFORMTYPE_GPU = 2

Adreno GPU.

enumerator SNPE_PLATFORMCONFIG_PLATFORMTYPE_DSP = 3

Hexagon DSP.

Functions

Snpe_UserGLConfig_Handle_t Snpe_UserGLConfig_Create()

Creates a new userGLConfig

Snpe_ErrorCode_t Snpe_UserGLConfig_Delete(Snpe_UserGLConfig_Handle_t handle)

Destroys the userGLConfig.

Parameters

handle[in] : Handle to access the userGLConfig

Returns

Error code. Returns SNPE_SUCCESS if destruction successful

Snpe_ErrorCode_t Snpe_UserGLConfig_SetUserGLContext(Snpe_UserGLConfig_Handle_t handle, void *userGLContext)

Sets the EGL context.

Parameters
  • handle[in] : Handle to access userGLConfig

  • userGLContext[in] : void pointer

Snpe_ErrorCode_t Snpe_UserGLConfig_SetUserGLDisplay(Snpe_UserGLConfig_Handle_t handle, void *userGLDisplay)

Sets the EGL Display.

Parameters
  • handle[in] : Handle to access userGLConfig

  • userGLDisplay[in] : void pointer

void *Snpe_UserGLConfig_GetUserGLContext(Snpe_UserGLConfig_Handle_t handle)

Get EGL context.

Parameters

handle[in] : Handle to access userGLConfig

Returns

userGLContext of type void pointer

void *Snpe_UserGLConfig_GetUserGLDisplay(Snpe_UserGLConfig_Handle_t handle)

Get EGL Display.

Parameters

handle[in] : Handle to access userGLConfig

Returns

userGLDisplay of type void pointer

Snpe_UserGpuConfig_Handle_t Snpe_UserGpuConfig_Create()

Creates a new userGpuConfig

Snpe_ErrorCode_t Snpe_UserGpuConfig_Delete(Snpe_UserGpuConfig_Handle_t handle)

Destroys the userGpuConfig.

Parameters

handle[in] : Handle to access userGLConfig

Returns

Error code. Returns SNPE_SUCCESS if destruction successful

void Snpe_UserGpuConfig_Set(Snpe_UserGpuConfig_Handle_t handle, Snpe_UserGLConfig_Handle_t glHandle)

Set the userGpuConfig.

Parameters
  • handle[in] : Handle to access userGpuConfig

  • glHandle[in] : Handle needed to access userGlConfig

Returns

Error code. Returns SNPE_SUCCESS if destruction successful

Snpe_UserGLConfig_Handle_t Snpe_UserGpuConfig_Get_Ref(Snpe_UserGpuConfig_Handle_t handle)

Get the userGpuConfig.

Parameters

handle[in] : Handle to access userGpuConfig

Returns

Handle needed to access userGlConfig

Snpe_PlatformConfig_Handle_t Snpe_PlatformConfig_Create()

Creates a new PlatformConfig

Snpe_PlatformConfig_Handle_t Snpe_PlatformConfig_CreateCopy(Snpe_PlatformConfig_Handle_t otherHandle)

Copy-Construct a PlatformConfig from another PlatformConfig.

Parameters

otherHandle[in] Handle to the other PlatformConfig

Returns

Handle to the Copy-Constructed PlatformConfig

Snpe_ErrorCode_t Snpe_PlatformConfig_Delete(Snpe_PlatformConfig_Handle_t handle)

Destroys the PlatformConfig.

Parameters

handle[in] : Handle needed to access the platformConfig

Returns

Error code. Returns SNPE_SUCCESS if destruction successful

Snpe_PlatformConfig_PlatformType_t Snpe_PlatformConfig_GetPlatformType(Snpe_PlatformConfig_Handle_t handle)

Retrieves the platform type.

Parameters

handle[in] : Handle needed to access the platformConfig

Returns

Platform type

int Snpe_PlatformConfig_IsValid(Snpe_PlatformConfig_Handle_t handle)

Indicates whther the plaform configuration is valid.

Parameters

handle[in] : Handle needed to access the platformConfig

Returns

1 if the platform configuration is valid; 0 otherwise.

Snpe_UserGpuConfig_Handle_t Snpe_PlatformConfig_GetUserGpuConfig(Snpe_PlatformConfig_Handle_t handle)

Retrieves the Gpu configuration.

Parameters

handle[in] : Handle needed to access the platformConfig

Returns

userGpuConfig populated with the Gpu configuration.

int Snpe_PlatformConfig_SetUserGpuConfig(Snpe_PlatformConfig_Handle_t handle, Snpe_UserGpuConfig_Handle_t gpuHandle)

Sets the Gpu configuration.

Parameters
  • handle[in] : Handle needed to access the platformConfig

  • gpuHandle[in] : Gpu Configuration handle

Returns

1 if Gpu configuration was successfully set; 0 otherwise.

int Snpe_PlatformConfig_SetPlatformOptions(Snpe_PlatformConfig_Handle_t handle, const char *options)

Sets the platform options.

Parameters
  • handle[in] : Handle needed to access the platformConfig

  • options[in] : Options as a const char* in the form of “keyword:options”

Returns

1 if options are pass validation; otherwise 0. If false, the options are not updated.

int Snpe_PlatformConfig_IsOptionsValid(Snpe_PlatformConfig_Handle_t handle)

Indicates whther the plaform configuration is valid.

Parameters

handle[in] : Handle needed to access the platformConfig

Returns

1 if the platform configuration is valid; 0 otherwise.

const char *Snpe_PlatformConfig_GetPlatformOptions(Snpe_PlatformConfig_Handle_t handle)

Gets the platform options.

Parameters

handle[in] : Handle needed to access the platformConfig

Returns

Options as a const char*

int Snpe_PlatformConfig_SetPlatformOptionValue(Snpe_PlatformConfig_Handle_t handle, const char *optionName, const char *value)

Sets the platform options.

Parameters
  • handle[in] : Handle needed to access the platformConfig

  • optionName[in] : Name of platform options”

  • value[in] : Value of specified optionName

Returns

If 1, add “optionName:value” to platform options if optionName don’t exist, otherwise update the value of specified optionName. If 0, the platform options will not be changed.

Note

the returned string will be invalidated by subsequent calls to this function

int Snpe_PlatformConfig_RemovePlatformOptionValue(Snpe_PlatformConfig_Handle_t handle, const char *optionName, const char *value)

Removes the platform options.

Parameters
  • handle[in] : Handle needed to access the platformConfig

  • optionName[in] : Name of platform options”

  • value[in] : Value of specified optionName

Returns

If 1, removed “optionName:value” to platform options if optionName don’t exist, do nothing. If 0, the platform options will not be changed.

void Snpe_PlatformConfig_SetIsUserGLBuffer(int isUserGLBuffer)
int Snpe_PlatformConfig_GetIsUserGLBuffer()