# File SNPEBuilder.h

↰ [Parent directory](https://docs.qualcomm.com/doc/80-63442-10/topic/c_api-rst_dir_SNPE.html#dir-snpe) (`SNPE`)

Contents

- [Definition (`SNPE/SNPEBuilder.h`)](https://docs.qualcomm.com/doc/80-63442-10/topic/c_api-rst_file_SNPE_SNPEBuilder_h.html#definition-snpe-snpebuilder-h)
- [Includes](https://docs.qualcomm.com/doc/80-63442-10/topic/c_api-rst_file_SNPE_SNPEBuilder_h.html#includes)
- [Functions](https://docs.qualcomm.com/doc/80-63442-10/topic/c_api-rst_file_SNPE_SNPEBuilder_h.html#functions)
- [Typedefs](https://docs.qualcomm.com/doc/80-63442-10/topic/c_api-rst_file_SNPE_SNPEBuilder_h.html#typedefs)
- [Full File Listing](https://docs.qualcomm.com/doc/80-63442-10/topic/c_api-rst_file_SNPE_SNPEBuilder_h.html#full-file-listing)

## Definition (`SNPE/SNPEBuilder.h`)

## Includes

- `DlContainer/DlContainer.h` ([File DlContainer.h](https://docs.qualcomm.com/doc/80-63442-10/topic/c_api-rst_file_DlContainer_DlContainer_h.html#file-dlcontainer-dlcontainer-h))
- `DlSystem/DlEnums.h` ([File DlEnums.h](https://docs.qualcomm.com/doc/80-63442-10/topic/c_api-rst_file_DlSystem_DlEnums_h.html#file-dlsystem-dlenums-h))
- `DlSystem/DlError.h` ([File DlError.h](https://docs.qualcomm.com/doc/80-63442-10/topic/c_api-rst_file_DlSystem_DlError_h.html#file-dlsystem-dlerror-h))
- `DlSystem/IOBufferDataTypeMap.h` ([File IOBufferDataTypeMap.h](https://docs.qualcomm.com/doc/80-63442-10/topic/c_api-rst_file_DlSystem_IOBufferDataTypeMap_h.html#file-dlsystem-iobufferdatatypemap-h))
- `DlSystem/PlatformConfig.h` ([File PlatformConfig.h](https://docs.qualcomm.com/doc/80-63442-10/topic/c_api-rst_file_DlSystem_PlatformConfig_h.html#file-dlsystem-platformconfig-h))
- `DlSystem/RuntimeList.h` ([File RuntimeList.h](https://docs.qualcomm.com/doc/80-63442-10/topic/c_api-rst_file_DlSystem_RuntimeList_h.html#file-dlsystem-runtimelist-h))
- `DlSystem/TensorShapeMap.h` ([File TensorShapeMap.h](https://docs.qualcomm.com/doc/80-63442-10/topic/c_api-rst_file_DlSystem_TensorShapeMap_h.html#file-dlsystem-tensorshapemap-h))
- `SNPE/SNPE.h` ([File SNPE.h](https://docs.qualcomm.com/doc/80-63442-10/topic/c_api-rst_file_SNPE_SNPE_h.html#file-snpe-snpe-h))

## Functions

- [Function Snpe\_SNPEBuilder\_Build](https://docs.qualcomm.com/doc/80-63442-10/topic/function_SNPEBuilder_8h_1ac61ef58c0d5b4c50b2dec6c48cede397.html#exhale-function-snpebuilder-8h-1ac61ef58c0d5b4c50b2dec6c48cede397)
- [Function Snpe\_SNPEBuilder\_Create](https://docs.qualcomm.com/doc/80-63442-10/topic/function_SNPEBuilder_8h_1a01fbdaba9c2a1ec80846eaf7fb0ac95a.html#exhale-function-snpebuilder-8h-1a01fbdaba9c2a1ec80846eaf7fb0ac95a)
- [Function Snpe\_SNPEBuilder\_Delete](https://docs.qualcomm.com/doc/80-63442-10/topic/function_SNPEBuilder_8h_1adbe59b4f89f284d69a0df09f71e63b21.html#exhale-function-snpebuilder-8h-1adbe59b4f89f284d69a0df09f71e63b21)
- [Function Snpe\_SNPEBuilder\_NetworkInit](https://docs.qualcomm.com/doc/80-63442-10/topic/function_SNPEBuilder_8h_1a390a4c9d3dd745f539b6d81c3f00cd9a.html#exhale-function-snpebuilder-8h-1a390a4c9d3dd745f539b6d81c3f00cd9a)
- [Function Snpe\_SNPEBuilder\_RegisterMultiContext](https://docs.qualcomm.com/doc/80-63442-10/topic/function_SNPEBuilder_8h_1aa914b1c3c365e1e4b1392db9ec9faef0.html#exhale-function-snpebuilder-8h-1aa914b1c3c365e1e4b1392db9ec9faef0)
- [Function Snpe\_SNPEBuilder\_SetAcceleratedInit](https://docs.qualcomm.com/doc/80-63442-10/topic/function_SNPEBuilder_8h_1a4af8a74cd89bf654721ac54b11b0a9b5.html#exhale-function-snpebuilder-8h-1a4af8a74cd89bf654721ac54b11b0a9b5)
- [Function Snpe\_SNPEBuilder\_SetAsyncExecuteQueueDepth](https://docs.qualcomm.com/doc/80-63442-10/topic/function_SNPEBuilder_8h_1aedce28c3e028f4a993ab55c9df9fb7ab.html#exhale-function-snpebuilder-8h-1aedce28c3e028f4a993ab55c9df9fb7ab)
- [Function Snpe\_SNPEBuilder\_SetBufferDataType](https://docs.qualcomm.com/doc/80-63442-10/topic/function_SNPEBuilder_8h_1af54741960cca688c749268c1b5f2e5b7.html#exhale-function-snpebuilder-8h-1af54741960cca688c749268c1b5f2e5b7)
- [Function Snpe\_SNPEBuilder\_SetCacheCompatibilityMode](https://docs.qualcomm.com/doc/80-63442-10/topic/function_SNPEBuilder_8h_1a99fba442e066a703f1648a217b542bde.html#exhale-function-snpebuilder-8h-1a99fba442e066a703f1648a217b542bde)
- [Function Snpe\_SNPEBuilder\_SetCpuFixedPointMode](https://docs.qualcomm.com/doc/80-63442-10/topic/function_SNPEBuilder_8h_1a52d48c5197b97e1f222474467ef0f710.html#exhale-function-snpebuilder-8h-1a52d48c5197b97e1f222474467ef0f710)
- [Function Snpe\_SNPEBuilder\_SetCpuQmxMode](https://docs.qualcomm.com/doc/80-63442-10/topic/function_SNPEBuilder_8h_1a308503022fb027df360add058b6cdbbb.html#exhale-function-snpebuilder-8h-1a308503022fb027df360add058b6cdbbb)
- [Function Snpe\_SNPEBuilder\_SetCustomPerfProfile](https://docs.qualcomm.com/doc/80-63442-10/topic/function_SNPEBuilder_8h_1a62a6f0488fb2dbce0383a59d81063369.html#exhale-function-snpebuilder-8h-1a62a6f0488fb2dbce0383a59d81063369)
- [Function Snpe\_SNPEBuilder\_SetDebugMode](https://docs.qualcomm.com/doc/80-63442-10/topic/function_SNPEBuilder_8h_1ab9d175ec0d751f6159695157afe74f32.html#exhale-function-snpebuilder-8h-1ab9d175ec0d751f6159695157afe74f32)
- [Function Snpe\_SNPEBuilder\_SetDeferredInit](https://docs.qualcomm.com/doc/80-63442-10/topic/function_SNPEBuilder_8h_1a947058d07cfec463e01a9a52546340c6.html#exhale-function-snpebuilder-8h-1a947058d07cfec463e01a9a52546340c6)
- [Function Snpe\_SNPEBuilder\_SetDeferredRuntimeCleanup](https://docs.qualcomm.com/doc/80-63442-10/topic/function_SNPEBuilder_8h_1a9028621ad101d124e95c16bb85280945.html#exhale-function-snpebuilder-8h-1a9028621ad101d124e95c16bb85280945)
- [Function Snpe\_SNPEBuilder\_SetExecutionPriorityHint](https://docs.qualcomm.com/doc/80-63442-10/topic/function_SNPEBuilder_8h_1aa1d078c97ce5e85a585fefe37ee5b8c0.html#exhale-function-snpebuilder-8h-1aa1d078c97ce5e85a585fefe37ee5b8c0)
- [Function Snpe\_SNPEBuilder\_SetFileReadMemoryBudget](https://docs.qualcomm.com/doc/80-63442-10/topic/function_SNPEBuilder_8h_1ac9fe251d2835989066606e90b91d45d0.html#exhale-function-snpebuilder-8h-1ac9fe251d2835989066606e90b91d45d0)
- [Function Snpe\_SNPEBuilder\_SetInitCacheMode](https://docs.qualcomm.com/doc/80-63442-10/topic/function_SNPEBuilder_8h_1af5f87bad68a05cf1fc3c18e992600bd8.html#exhale-function-snpebuilder-8h-1af5f87bad68a05cf1fc3c18e992600bd8)
- [Function Snpe\_SNPEBuilder\_SetInputDimensions](https://docs.qualcomm.com/doc/80-63442-10/topic/function_SNPEBuilder_8h_1a7554ce9986adc92cf149a109bfa31b77.html#exhale-function-snpebuilder-8h-1a7554ce9986adc92cf149a109bfa31b77)
- [Function Snpe\_SNPEBuilder\_SetInputDimensionsForNetwork](https://docs.qualcomm.com/doc/80-63442-10/topic/function_SNPEBuilder_8h_1aee355f8a312537fe3c299dc2717f8bb2.html#exhale-function-snpebuilder-8h-1aee355f8a312537fe3c299dc2717f8bb2)
- [Function Snpe\_SNPEBuilder\_SetMemoryLimitHint](https://docs.qualcomm.com/doc/80-63442-10/topic/function_SNPEBuilder_8h_1ab40c37fcaab31ff8dd2312d878f186f3.html#exhale-function-snpebuilder-8h-1ab40c37fcaab31ff8dd2312d878f186f3)
- [Function Snpe\_SNPEBuilder\_SetModelName](https://docs.qualcomm.com/doc/80-63442-10/topic/function_SNPEBuilder_8h_1a3c16c31ebcfe0fc308da8723d2bb8253.html#exhale-function-snpebuilder-8h-1a3c16c31ebcfe0fc308da8723d2bb8253)
- [Function Snpe\_SNPEBuilder\_SetOutputLayers](https://docs.qualcomm.com/doc/80-63442-10/topic/function_SNPEBuilder_8h_1a16d1645f334c18f0f5e92fc6746fbb60.html#exhale-function-snpebuilder-8h-1a16d1645f334c18f0f5e92fc6746fbb60)
- [Function Snpe\_SNPEBuilder\_SetOutputLayersForNetwork](https://docs.qualcomm.com/doc/80-63442-10/topic/function_SNPEBuilder_8h_1afa0a2e49580aa0d27e5bf6778d2c676f.html#exhale-function-snpebuilder-8h-1afa0a2e49580aa0d27e5bf6778d2c676f)
- [Function Snpe\_SNPEBuilder\_SetOutputTensors](https://docs.qualcomm.com/doc/80-63442-10/topic/function_SNPEBuilder_8h_1a2c76fb68ad626ae02bf07e68f8bf0290.html#exhale-function-snpebuilder-8h-1a2c76fb68ad626ae02bf07e68f8bf0290)
- [Function Snpe\_SNPEBuilder\_SetOutputTensorsForNetwork](https://docs.qualcomm.com/doc/80-63442-10/topic/function_SNPEBuilder_8h_1a3aa68dc7e6d463e975472f397fbdfd8c.html#exhale-function-snpebuilder-8h-1a3aa68dc7e6d463e975472f397fbdfd8c)
- [Function Snpe\_SNPEBuilder\_SetPerformanceProfile](https://docs.qualcomm.com/doc/80-63442-10/topic/function_SNPEBuilder_8h_1aa946d8bf0bd9ad23acc69746a9fe8eac.html#exhale-function-snpebuilder-8h-1aa946d8bf0bd9ad23acc69746a9fe8eac)
- [Function Snpe\_SNPEBuilder\_SetPlatformConfig](https://docs.qualcomm.com/doc/80-63442-10/topic/function_SNPEBuilder_8h_1a340b427c7ca4f05764a73ec7b0f540ba.html#exhale-function-snpebuilder-8h-1a340b427c7ca4f05764a73ec7b0f540ba)
- [Function Snpe\_SNPEBuilder\_SetProfilingLevel](https://docs.qualcomm.com/doc/80-63442-10/topic/function_SNPEBuilder_8h_1aed06432b1ff5792f7a9c7db6c3c77c73.html#exhale-function-snpebuilder-8h-1aed06432b1ff5792f7a9c7db6c3c77c73)
- [Function Snpe\_SNPEBuilder\_SetRuntimeProcessorOrder](https://docs.qualcomm.com/doc/80-63442-10/topic/function_SNPEBuilder_8h_1adac2ed4af1f98049f03e38898aaab520.html#exhale-function-snpebuilder-8h-1adac2ed4af1f98049f03e38898aaab520)
- [Function Snpe\_SNPEBuilder\_SetSingleThreadedInit](https://docs.qualcomm.com/doc/80-63442-10/topic/function_SNPEBuilder_8h_1af315dec4c39c28b41914781e9b0e849d.html#exhale-function-snpebuilder-8h-1af315dec4c39c28b41914781e9b0e849d)
- [Function Snpe\_SNPEBuilder\_SetTimeOut](https://docs.qualcomm.com/doc/80-63442-10/topic/function_SNPEBuilder_8h_1a917f01727ed87dfe38a47d1a0d8d096d.html#exhale-function-snpebuilder-8h-1a917f01727ed87dfe38a47d1a0d8d096d)
- [Function Snpe\_SNPEBuilder\_SetUnconsumedTensorsAsOutputs](https://docs.qualcomm.com/doc/80-63442-10/topic/function_SNPEBuilder_8h_1a617b7706851055e3ad4256dbdd57baa1.html#exhale-function-snpebuilder-8h-1a617b7706851055e3ad4256dbdd57baa1)
- [Function Snpe\_SNPEBuilder\_SetUseUserSuppliedBuffers](https://docs.qualcomm.com/doc/80-63442-10/topic/function_SNPEBuilder_8h_1a542187dad3f5c861dc8862d0563be997.html#exhale-function-snpebuilder-8h-1a542187dad3f5c861dc8862d0563be997)
- [Function Snpe\_SNPEBuilder\_ValidateCache](https://docs.qualcomm.com/doc/80-63442-10/topic/function_SNPEBuilder_8h_1aebecad096a399b9033daae535594803f.html#exhale-function-snpebuilder-8h-1aebecad096a399b9033daae535594803f)

## Typedefs

- [Typedef Snpe\_SNPEBuilder\_Handle\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/typedef_SNPEBuilder_8h_1a5525f7c887b922195624658ef8f12478.html#exhale-typedef-snpebuilder-8h-1a5525f7c887b922195624658ef8f12478)

## Full File Listing

Typedefs

- typedef void \*Snpe\_SNPEBuilder\_Handle\_t

    - A typedef to indicate a SNPEBuilder handle

Functions

- [Snpe\_SNPEBuilder\_Handle\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/typedef_SNPEBuilder_8h_1a5525f7c887b922195624658ef8f12478.html#_CPPv425Snpe_SNPEBuilder_Handle_t) Snpe\_SNPEBuilder\_Create([Snpe\_DlContainer\_Handle\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/c_api-rst_file_DlContainer_DlContainer_h.html#_CPPv425Snpe_DlContainer_Handle_t) containerHandle)

    - Constructor of NeuralNetwork Builder ith a supplied model.

The builder class for creating SNPE objects. Not meant to be extended.

- Parameters

    - **containerHandle** – **[in]** A DlContainer holding the model.

- Returns

    - A new instance of a SNPEBuilder object that can be used to configure and build an instance of SNPE.

- [Snpe\_ErrorCode\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/enum_DlError_8h_1aa40d44ade537087ac80f867eb4e7d50f.html#_CPPv416Snpe_ErrorCode_t) Snpe\_SNPEBuilder\_Delete([Snpe\_SNPEBuilder\_Handle\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/typedef_SNPEBuilder_8h_1a5525f7c887b922195624658ef8f12478.html#_CPPv425Snpe_SNPEBuilder_Handle_t) snpeBuilderHandle)

    - Destroys/frees a SNPEBuilder object

- Parameters

    - **snpeBuilderHandle** – **[in]** Handle to access the SNPEBuilder object

- Returns

    - SNPE\_SUCCESS if Delete operation successful.

- [Snpe\_ErrorCode\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/enum_DlError_8h_1aa40d44ade537087ac80f867eb4e7d50f.html#_CPPv416Snpe_ErrorCode_t) Snpe\_SNPEBuilder\_SetPerformanceProfile([Snpe\_SNPEBuilder\_Handle\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/typedef_SNPEBuilder_8h_1a5525f7c887b922195624658ef8f12478.html#_CPPv425Snpe_SNPEBuilder_Handle_t) snpeBuilderHandle, [Snpe\_PerformanceProfile\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/enum_DlEnums_8h_1a2bbf863c52b6010323663938721ed29a.html#_CPPv425Snpe_PerformanceProfile_t) performanceProfile)

    - Requests a performance profile.

- Parameters

    - - **snpeBuilderHandle** – **[in]** Handle to access the SNPEBuilder object
- **performanceProfile** – **[in]** The target performance profile.

- [Snpe\_ErrorCode\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/enum_DlError_8h_1aa40d44ade537087ac80f867eb4e7d50f.html#_CPPv416Snpe_ErrorCode_t) Snpe\_SNPEBuilder\_SetProfilingLevel([Snpe\_SNPEBuilder\_Handle\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/typedef_SNPEBuilder_8h_1a5525f7c887b922195624658ef8f12478.html#_CPPv425Snpe_SNPEBuilder_Handle_t) snpeBuilderHandle, [Snpe\_ProfilingLevel\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/enum_DlEnums_8h_1a56dcaf62bd867a86649e4cab49a4aadd.html#_CPPv421Snpe_ProfilingLevel_t) profilingLevel)

    - Sets the profiling level. Default profiling level for SNPEBuilder is off. Off and basic only applies to DSP runtime.

- Parameters

    - - **snpeBuilderHandle** – **[in]** Handle to access the SNPEBuilder object
- **profilingLevel** – **[in]** The target profiling level.

- [Snpe\_ErrorCode\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/enum_DlError_8h_1aa40d44ade537087ac80f867eb4e7d50f.html#_CPPv416Snpe_ErrorCode_t) Snpe\_SNPEBuilder\_SetExecutionPriorityHint([Snpe\_SNPEBuilder\_Handle\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/typedef_SNPEBuilder_8h_1a5525f7c887b922195624658ef8f12478.html#_CPPv425Snpe_SNPEBuilder_Handle_t) snpeBuilderHandle, [Snpe\_ExecutionPriorityHint\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/enum_DlEnums_8h_1a5cdef49ab6a3d845d5da0089bda28fce.html#_CPPv428Snpe_ExecutionPriorityHint_t) priority)

    - Sets a preference for execution priority.

This allows the caller to give coarse hint to SNPE runtime about the priority of the network. SNPE runtime is free to use this information to co-ordinate between different workloads that may or may not extend beyond SNPE.

- Parameters

    - - **snpeBuilderHandle** – **[in]** Handle to access the SNPEBuilder object
- **priority** – **[in]** The target performance profile.

- [Snpe\_ErrorCode\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/enum_DlError_8h_1aa40d44ade537087ac80f867eb4e7d50f.html#_CPPv416Snpe_ErrorCode_t) Snpe\_SNPEBuilder\_NetworkInit([Snpe\_SNPEBuilder\_Handle\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/typedef_SNPEBuilder_8h_1a5525f7c887b922195624658ef8f12478.html#_CPPv425Snpe_SNPEBuilder_Handle_t) snpeBuilderHandle, [Snpe\_StringList\_Handle\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/typedef_StringList_8h_1a86a9e0d044299b1ed6b8a85280830503.html#_CPPv424Snpe_StringList_Handle_t) snpeNetworkNames)

    - Sets the graphs that will be initialized in a multi-graph DLC.

- Parameters

    - - **snpeBuilderHandle** – **[in]** Handle to access the SNPEBuilder object
- **snpeNetworkNames** – **[in]** List of network names to to be initialized.

Note

The networkName is specified in snpe-dlc-info and defaults to the name of the first graph in the DLC.

- [Snpe\_ErrorCode\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/enum_DlError_8h_1aa40d44ade537087ac80f867eb4e7d50f.html#_CPPv416Snpe_ErrorCode_t) Snpe\_SNPEBuilder\_SetOutputLayers([Snpe\_SNPEBuilder\_Handle\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/typedef_SNPEBuilder_8h_1a5525f7c887b922195624658ef8f12478.html#_CPPv425Snpe_SNPEBuilder_Handle_t) snpeBuilderHandle, [Snpe\_StringList\_Handle\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/typedef_StringList_8h_1a86a9e0d044299b1ed6b8a85280830503.html#_CPPv424Snpe_StringList_Handle_t) outputLayerNames)

    - Sets the layers that will generate output.

- Parameters

    - - **snpeBuilderHandle** – **[in]** Handle to access the SNPEBuilder object
- **outputLayerNames** – **[in]** List of layer names to output. An empty list will result in only the final layer of the model being the output layer. The list will be copied.

- [Snpe\_ErrorCode\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/enum_DlError_8h_1aa40d44ade537087ac80f867eb4e7d50f.html#_CPPv416Snpe_ErrorCode_t) Snpe\_SNPEBuilder\_SetOutputLayersForNetwork([Snpe\_SNPEBuilder\_Handle\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/typedef_SNPEBuilder_8h_1a5525f7c887b922195624658ef8f12478.html#_CPPv425Snpe_SNPEBuilder_Handle_t) snpeBuilderHandle, const char \*networkName, [Snpe\_StringList\_Handle\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/typedef_StringList_8h_1a86a9e0d044299b1ed6b8a85280830503.html#_CPPv424Snpe_StringList_Handle_t) outputLayerNames)

    - Sets the layers that will generate output.

- Parameters

    - - **snpeBuilderHandle** – **[in]** Handle to access the SNPEBuilder object
- **networkName** – **[in]** specifies network name on which the output layer names are to be set
- **outputLayerNames** – **[in]** List of layer names to output. An empty list will result in only the final layer of the model being the output layer. The list will be copied.

- [Snpe\_ErrorCode\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/enum_DlError_8h_1aa40d44ade537087ac80f867eb4e7d50f.html#_CPPv416Snpe_ErrorCode_t) Snpe\_SNPEBuilder\_SetOutputTensors([Snpe\_SNPEBuilder\_Handle\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/typedef_SNPEBuilder_8h_1a5525f7c887b922195624658ef8f12478.html#_CPPv425Snpe_SNPEBuilder_Handle_t) snpeBuilderHandle, [Snpe\_StringList\_Handle\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/typedef_StringList_8h_1a86a9e0d044299b1ed6b8a85280830503.html#_CPPv424Snpe_StringList_Handle_t) outputTensorNames)

    - Sets the output tensor names.

- Parameters

    - - **snpeBuilderHandle** – **[in]** Handle to access the SNPEBuilder object
- **outputTensorNames** – **[in]** List of tensor names to output. An empty list will result in producing output for the final output tensor of the model. The list will be copied.

- [Snpe\_ErrorCode\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/enum_DlError_8h_1aa40d44ade537087ac80f867eb4e7d50f.html#_CPPv416Snpe_ErrorCode_t) Snpe\_SNPEBuilder\_SetOutputTensorsForNetwork([Snpe\_SNPEBuilder\_Handle\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/typedef_SNPEBuilder_8h_1a5525f7c887b922195624658ef8f12478.html#_CPPv425Snpe_SNPEBuilder_Handle_t) snpeBuilderHandle, const char \*networkName, [Snpe\_StringList\_Handle\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/typedef_StringList_8h_1a86a9e0d044299b1ed6b8a85280830503.html#_CPPv424Snpe_StringList_Handle_t) outputTensorNames)

    - Sets the output tensor names.

- Parameters

    - - **snpeBuilderHandle** – **[in]** Handle to access the SNPEBuilder object
- **networkName** – **[in]** specifies network name on which the output tensor names are to be set
- **outputTensorNames** – **[in]** List of tensor names to output. An empty list will result in producing output for the final output tensor of the model. The list will be copied.

- [Snpe\_ErrorCode\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/enum_DlError_8h_1aa40d44ade537087ac80f867eb4e7d50f.html#_CPPv416Snpe_ErrorCode_t) Snpe\_SNPEBuilder\_SetUseUserSuppliedBuffers([Snpe\_SNPEBuilder\_Handle\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/typedef_SNPEBuilder_8h_1a5525f7c887b922195624658ef8f12478.html#_CPPv425Snpe_SNPEBuilder_Handle_t) snpeBuilderHandle, int bufferMode)

    - Sets whether this neural network will perform inference with input from user-supplied buffers, and write output to user-supplied buffers. Default behaviour is to use tensors created by ITensorFactory.

- Parameters

    - - **snpeBuilderHandle** – **[in]** Handle to access the SNPEBuilder object
- **bufferMode** – **[in]** Boolean whether to use user-supplied buffer or not.

- [Snpe\_ErrorCode\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/enum_DlError_8h_1aa40d44ade537087ac80f867eb4e7d50f.html#_CPPv416Snpe_ErrorCode_t) Snpe\_SNPEBuilder\_SetDebugMode([Snpe\_SNPEBuilder\_Handle\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/typedef_SNPEBuilder_8h_1a5525f7c887b922195624658ef8f12478.html#_CPPv425Snpe_SNPEBuilder_Handle_t) snpeBuilderHandle, int debugMode)

    - Sets the debug mode of the runtime.

- Parameters

    - - **snpeBuilderHandle** – **[in]** Handle to access the SNPEBuilder object
- **debugMode** – **[in]** This enables debug mode for the runtime. It does two things. For an empty outputLayerNames list, all layers will be output. It might also disable some internal runtime optimizations (e.g., some networks might be optimized by combining layers, etc.).

- [Snpe\_ErrorCode\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/enum_DlError_8h_1aa40d44ade537087ac80f867eb4e7d50f.html#_CPPv416Snpe_ErrorCode_t) Snpe\_SNPEBuilder\_SetInputDimensions([Snpe\_SNPEBuilder\_Handle\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/typedef_SNPEBuilder_8h_1a5525f7c887b922195624658ef8f12478.html#_CPPv425Snpe_SNPEBuilder_Handle_t) snpeBuilderHandle, [Snpe\_TensorShapeMap\_Handle\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/typedef_TensorShapeMap_8h_1ae8e826453db558bff10f2ac433681685.html#_CPPv428Snpe_TensorShapeMap_Handle_t) inputDimensionsMapHandle)

    - Sets network’s input dimensions to enable resizing of the spatial dimensions of each layer for fully convolutional networks, and the batch dimension for all networks.

- Parameters

    - **tensorShapeMapHandle** – **[in]** : Handle to the map of input names and their new dimensions. The new dimensions overwrite the input dimensions embedded in the model and then resize each layer of the model. If the model contains layers whose dimensions cannot be resized e.g FullyConnected, exception will be thrown when SNPE instance is actually built. In general the batch dimension is always resizable. After resizing of layers’ dimensions in model based on new input dimensions, the new model is revalidated against all runtime constraints, whose failures may result in cpu fallback situation.

- [Snpe\_ErrorCode\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/enum_DlError_8h_1aa40d44ade537087ac80f867eb4e7d50f.html#_CPPv416Snpe_ErrorCode_t) Snpe\_SNPEBuilder\_SetInputDimensionsForNetwork([Snpe\_SNPEBuilder\_Handle\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/typedef_SNPEBuilder_8h_1a5525f7c887b922195624658ef8f12478.html#_CPPv425Snpe_SNPEBuilder_Handle_t) snpeBuilderHandle, const char \*networkName, [Snpe\_TensorShapeMap\_Handle\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/typedef_TensorShapeMap_8h_1ae8e826453db558bff10f2ac433681685.html#_CPPv428Snpe_TensorShapeMap_Handle_t) inputDimensionsMapHandle)

    - Sets network’s input dimensions to enable resizing of the spatial dimensions of each layer for fully convolutional networks, and the batch dimension for all networks.

- Parameters

    - - **networkName** – **[in]** : specifies network name on which the input dims are to be set
- **tensorShapeMapHandle** – **[in]** : Handle to the map of input names and their new dimensions. The new dimensions overwrite the input dimensions embedded in the model and then resize each layer of the model. If the model contains layers whose dimensions cannot be resized e.g FullyConnected, exception will be thrown when SNPE instance is actually built. In general the batch dimension is always resizable. After resizing of layers’ dimensions in model based on new input dimensions, the new model is revalidated against all runtime constraints, whose failures may result in cpu fallback situation.

- [Snpe\_ErrorCode\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/enum_DlError_8h_1aa40d44ade537087ac80f867eb4e7d50f.html#_CPPv416Snpe_ErrorCode_t) Snpe\_SNPEBuilder\_SetInitCacheMode([Snpe\_SNPEBuilder\_Handle\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/typedef_SNPEBuilder_8h_1a5525f7c887b922195624658ef8f12478.html#_CPPv425Snpe_SNPEBuilder_Handle_t) snpeBuilderHandle, int cacheMode)

    - Sets the mode of init caching functionality.

- Parameters

    - - **snpeBuilderHandle** – **[in]** Handle to access the SNPEBuilder object
- **mode** – **[in]** Boolean. This flag enables/disables the functionality of init caching. When init caching functionality is enabled, a set of init caches will be created during network building/initialization process and will be added to DLC container. If such DLC container is saved by the user, in subsequent network building/initialization processes these init caches will be loaded from the DLC so as to reduce initialization time. In disable mode, no init caches will be added to DLC container.

- [Snpe\_SNPE\_Handle\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/typedef_SNPE_8h_1ac4d946a1db4097746e726714e145e08a.html#_CPPv418Snpe_SNPE_Handle_t) Snpe\_SNPEBuilder\_Build([Snpe\_SNPEBuilder\_Handle\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/typedef_SNPEBuilder_8h_1a5525f7c887b922195624658ef8f12478.html#_CPPv425Snpe_SNPEBuilder_Handle_t) snpeBuilderHandle)

    - Returns an instance of SNPE based on the current parameters.

- Parameters

    - **snpeBuilderHandle** – **[in]** Handle to access the SNPEBuilder object

- Returns

    - A new instance of a SNPE object that can be used to execute models or null if any errors occur.

- [Snpe\_ErrorCode\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/enum_DlError_8h_1aa40d44ade537087ac80f867eb4e7d50f.html#_CPPv416Snpe_ErrorCode_t) Snpe\_SNPEBuilder\_SetPlatformConfig([Snpe\_SNPEBuilder\_Handle\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/typedef_SNPEBuilder_8h_1a5525f7c887b922195624658ef8f12478.html#_CPPv425Snpe_SNPEBuilder_Handle_t) snpeBuilderHandle, [Snpe\_PlatformConfig\_Handle\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/c_api-rst_file_DlSystem_PlatformConfig_h.html#_CPPv428Snpe_PlatformConfig_Handle_t) platformConfigHandle)

    - Sets the platform configuration.

- Parameters

    - - **snpeBuilderHandle** – **[in]** Handle to access the SNPEBuilder object
- **platformConfig** – **[in]** The platform configuration.

- [Snpe\_ErrorCode\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/enum_DlError_8h_1aa40d44ade537087ac80f867eb4e7d50f.html#_CPPv416Snpe_ErrorCode_t) Snpe\_SNPEBuilder\_SetRuntimeProcessorOrder([Snpe\_SNPEBuilder\_Handle\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/typedef_SNPEBuilder_8h_1a5525f7c887b922195624658ef8f12478.html#_CPPv425Snpe_SNPEBuilder_Handle_t) snpeBuilderHandle, [Snpe\_RuntimeList\_Handle\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/typedef_RuntimeList_8h_1af5de4fb49e732ad0d0ffc094b6d8d94e.html#_CPPv425Snpe_RuntimeList_Handle_t) runtimeListHandle)

    - Sets network’s runtime order of precedence. Example: CPU\_FLOAT32, GPU\_FLOAT16, AIP\_FIXED8\_TF.

- Parameters

    - - **snpeBuilderHandle** – **[in]** Handle to access the SNPEBuilder object
- **runtimeListHandle** – **[in]** The list of runtime in order of precedence

- [Snpe\_ErrorCode\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/enum_DlError_8h_1aa40d44ade537087ac80f867eb4e7d50f.html#_CPPv416Snpe_ErrorCode_t) Snpe\_SNPEBuilder\_SetUnconsumedTensorsAsOutputs([Snpe\_SNPEBuilder\_Handle\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/typedef_SNPEBuilder_8h_1a5525f7c887b922195624658ef8f12478.html#_CPPv425Snpe_SNPEBuilder_Handle_t) snpeBuilderHandle, int setOutput)

    - Sets the unconsumed tensors as output.

- Parameters

    - - **snpeBuilderHandle** – **[in]** Handle to access the SNPEBuilder object
- **setOutput** – **[in]** Boolean. This enables unconsumed tensors (i.e) outputs which are not inputs to any layer (basically dead ends) to be marked for output

- [Snpe\_ErrorCode\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/enum_DlError_8h_1aa40d44ade537087ac80f867eb4e7d50f.html#_CPPv416Snpe_ErrorCode_t) Snpe\_SNPEBuilder\_SetTimeOut([Snpe\_SNPEBuilder\_Handle\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/typedef_SNPEBuilder_8h_1a5525f7c887b922195624658ef8f12478.html#_CPPv425Snpe_SNPEBuilder_Handle_t) snpeBuilderHandle, uint64\_t timeoutMicroSec)

    - Execution terminated when exceeding time limit. Only valid for dsp runtime currently.

- Parameters

    - - **snpeBuilderHandle** – **[in]** Handle to access the SNPEBuilder object
- **timeout** – **[in]** Time limit value in microseconds

- [Snpe\_ErrorCode\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/enum_DlError_8h_1aa40d44ade537087ac80f867eb4e7d50f.html#_CPPv416Snpe_ErrorCode_t) Snpe\_SNPEBuilder\_SetAsyncExecuteQueueDepth([Snpe\_SNPEBuilder\_Handle\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/typedef_SNPEBuilder_8h_1a5525f7c887b922195624658ef8f12478.html#_CPPv425Snpe_SNPEBuilder_Handle_t) snpeBuilderHandle, uint32\_t queueDepth)

    - Sets the async execution queue depth for QNN backends. A value of 0 (default) disables async execution.

- Parameters

    - - **snpeBuilderHandle** – **[in]** Handle to access the SNPEBuilder object
- **queueDepth** – **[in]** Maximum number of async execute calls that can be enqueued

- [Snpe\_ErrorCode\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/enum_DlError_8h_1aa40d44ade537087ac80f867eb4e7d50f.html#_CPPv416Snpe_ErrorCode_t) Snpe\_SNPEBuilder\_SetBufferDataType([Snpe\_SNPEBuilder\_Handle\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/typedef_SNPEBuilder_8h_1a5525f7c887b922195624658ef8f12478.html#_CPPv425Snpe_SNPEBuilder_Handle_t) snpeBuilderHandle, [Snpe\_IOBufferDataTypeMap\_Handle\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/c_api-rst_file_DlSystem_IOBufferDataTypeMap_h.html#_CPPv433Snpe_IOBufferDataTypeMap_Handle_t) dataTypeMapHandle)

    - Sets the datatype of the buffer. Only valid for dsp runtime currently.

- Parameters

    - - **snpeBuilderHandle** – **[in]** Handle to access the SNPEBuilder object
- **dataTypeMapHandle** – **[in]** Map of the buffer names and the datatype that needs to be set.

- [Snpe\_ErrorCode\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/enum_DlError_8h_1aa40d44ade537087ac80f867eb4e7d50f.html#_CPPv416Snpe_ErrorCode_t) Snpe\_SNPEBuilder\_SetSingleThreadedInit([Snpe\_SNPEBuilder\_Handle\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/typedef_SNPEBuilder_8h_1a5525f7c887b922195624658ef8f12478.html#_CPPv425Snpe_SNPEBuilder_Handle_t) snpeBuilderHandle, int singleThreadedInit)

    - Sets up the entire initialization callflow to happen on the user’s thread.

- Parameters

    - - **snpeBuilderHandle** – **[in]** Handle to access the SNPEBuilder object
- **singleThreadedInit** – **[in]** Flag indicating user’s intent to perform initialization callflow on caller’s thread. When set to 1, initialization will happen on the user’s thread When set to 0, initialization will happen on a new thread. This is the default behavior (analogous to not calling this API)

- [Snpe\_ErrorCode\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/enum_DlError_8h_1aa40d44ade537087ac80f867eb4e7d50f.html#_CPPv416Snpe_ErrorCode_t) Snpe\_SNPEBuilder\_SetCpuFixedPointMode([Snpe\_SNPEBuilder\_Handle\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/typedef_SNPEBuilder_8h_1a5525f7c887b922195624658ef8f12478.html#_CPPv425Snpe_SNPEBuilder_Handle_t) snpeBuilderHandle, bool cpuFxpMode)

    - Sets the fixed point execution mode for CPU runtime. If a floating point DLC is executed with this option set, the program will be terminated with an exception. If a quantized DLC is executed without this option set, the execution will be in floating point mode in CPU.

- Parameters

    - - **snpeBuilderHandle** – **[in]** Handle to access the SNPEBuilder object
- **cpuFxpMode** – **[in]** Boolean If set to true, enables the fixed point mode.

- [Snpe\_ErrorCode\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/enum_DlError_8h_1aa40d44ade537087ac80f867eb4e7d50f.html#_CPPv416Snpe_ErrorCode_t) Snpe\_SNPEBuilder\_SetCpuQmxMode([Snpe\_SNPEBuilder\_Handle\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/typedef_SNPEBuilder_8h_1a5525f7c887b922195624658ef8f12478.html#_CPPv425Snpe_SNPEBuilder_Handle_t) snpeBuilderHandle, bool cpuQmxMode)

    - Sets QMX mode for CPU runtime.

- Parameters

    - - **snpeBuilderHandle** – **[in]** Handle to access the SNPEBuilder object
- **cpuQmxMode** – **[in]** Boolean If set to true, enables Qmx mode.

- [Snpe\_ErrorCode\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/enum_DlError_8h_1aa40d44ade537087ac80f867eb4e7d50f.html#_CPPv416Snpe_ErrorCode_t) Snpe\_SNPEBuilder\_SetAcceleratedInit([Snpe\_SNPEBuilder\_Handle\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/typedef_SNPEBuilder_8h_1a5525f7c887b922195624658ef8f12478.html#_CPPv425Snpe_SNPEBuilder_Handle_t) snpeBuilderHandle, bool acceleratedInit)

    - Sets the accelerated init mode for HTP runtime for execution from an offline prepared cache. If DLC without HTP cache is called with this mode, the program terminates Init acceleration requires cache prepared with current SDK; older cache falls back to regular initialization. If an offline prepared model with an invalid cache is discovered, the program continues normal execution with a warning.

- Parameters

    - - **snpeBuilderHandle** – **[in]** Handle to access the SNPEBuilder object
- **acceleratedInit** – **[in]** Boolean If set to true, enables HTP Init accelerate.

Note

Init time is reduced by using more resources. This would cause execution to slow down if executes are done concurrently with initialization. This should only be used for an offline prepared DLC, for DSP (HTP) runtime. Default value is false.

- [Snpe\_ErrorCode\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/enum_DlError_8h_1aa40d44ade537087ac80f867eb4e7d50f.html#_CPPv416Snpe_ErrorCode_t) Snpe\_SNPEBuilder\_SetMemoryLimitHint([Snpe\_SNPEBuilder\_Handle\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/typedef_SNPEBuilder_8h_1a5525f7c887b922195624658ef8f12478.html#_CPPv425Snpe_SNPEBuilder_Handle_t) snpeBuilderHandle, uint64\_t memoryLimitHintInMb)

    - Sets memoryLimitHint for DSP Based on the memory limit provided graphs will be switched from cache blob when execute is invoked.

- Parameters

    - - **snpeBuilderHandle** – **[in]** Handle to access the SNPEBuilder object
- **memoryLimitHintInMb** – **[in]** Sets the peak memory limit hint of a cache in megabytes.

Note

Memory footprint is reduced at the cost of slower first execution after graph switching. Default is set to 0, set to any non zero value to enter low memory mode with multi graph init. User must first load the largest graph inside the cache to avoid undefined behaviors. User can strategically specify Snpe\_SNPEBuilder\_NetworkInit to ensure the first graph is the largest graph if it has not been serialized as the first graph in the cache. Currently any non zero value would enable graph switching.

- [Snpe\_ErrorCode\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/enum_DlError_8h_1aa40d44ade537087ac80f867eb4e7d50f.html#_CPPv416Snpe_ErrorCode_t) Snpe\_SNPEBuilder\_SetFileReadMemoryBudget([Snpe\_SNPEBuilder\_Handle\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/typedef_SNPEBuilder_8h_1a5525f7c887b922195624658ef8f12478.html#_CPPv425Snpe_SNPEBuilder_Handle_t) snpeBuilderHandle, uint64\_t fileReadMemoryBudgetInMb)

    - Sets the file read memory budget for the SNPE instance.

- Parameters

    - - **snpeBuilderHandle** – **[in]** Handle to access the SNPEBuilder object
- **fileReadMemoryBudgetInMb** – **[in]** The file read memory budget in MB.

- Returns

    - Error code. Returns SNPE\_SUCCESS if successful

- [Snpe\_ErrorCode\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/enum_DlError_8h_1aa40d44ade537087ac80f867eb4e7d50f.html#_CPPv416Snpe_ErrorCode_t) Snpe\_SNPEBuilder\_RegisterMultiContext([Snpe\_SNPEBuilder\_Handle\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/typedef_SNPEBuilder_8h_1a5525f7c887b922195624658ef8f12478.html#_CPPv425Snpe_SNPEBuilder_Handle_t) snpeBuilderHandle, uint64\_t groupId, uint64\_t maxSpillFillBuffer)

    - Registers multi-context spill-fill buffer sharing with the HTP backend. Both groupId and maxSpillFillBuffer must be provided together. Only applies to the DSP runtime; ignored otherwise.

- Parameters

    - - **snpeBuilderHandle** – **[in]** Handle to access the SNPEBuilder object
- **groupId** – **[in]** Group handle (as uint64\_t). Pass 0 to create a new group (this instance becomes the group leader). Pass the group id value of an existing group leader to join that group.
- **maxSpillFillBuffer** – **[in]** Maximum spill-fill buffer size in bytes shared across all contexts in the group.

- Returns

    - Error code. Returns SNPE\_SUCCESS if successful

- [Snpe\_ErrorCode\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/enum_DlError_8h_1aa40d44ade537087ac80f867eb4e7d50f.html#_CPPv416Snpe_ErrorCode_t) Snpe\_SNPEBuilder\_SetModelName([Snpe\_SNPEBuilder\_Handle\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/typedef_SNPEBuilder_8h_1a5525f7c887b922195624658ef8f12478.html#_CPPv425Snpe_SNPEBuilder_Handle_t) snpeBuilderHandle, const char \*modelName)

    - Sets model name for logging.

- Parameters

    - - **snpeBuilderHandle** – **[in]** Handle to access the SNPEBuilder object
- **modelName** – **[in]** String Model name for logging.

- [Snpe\_ErrorCode\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/enum_DlError_8h_1aa40d44ade537087ac80f867eb4e7d50f.html#_CPPv416Snpe_ErrorCode_t) Snpe\_SNPEBuilder\_SetCacheCompatibilityMode([Snpe\_SNPEBuilder\_Handle\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/typedef_SNPEBuilder_8h_1a5525f7c887b922195624658ef8f12478.html#_CPPv425Snpe_SNPEBuilder_Handle_t) snpeBuilderHandle, [Snpe\_CacheCompatibility\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/enum_DlEnums_8h_1a13ae607b488079df75f899a0cbabe0dd.html#_CPPv425Snpe_CacheCompatibility_t) mode)

    - Sets compatibility check mode.

- Parameters

    - - **snpeBuilderHandle** – **[in]** Handle to access the SNPEBuilder object
- **mode** – **[in]** Mode of checking compatibility

- [Snpe\_ErrorCode\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/enum_DlError_8h_1aa40d44ade537087ac80f867eb4e7d50f.html#_CPPv416Snpe_ErrorCode_t) Snpe\_SNPEBuilder\_ValidateCache([Snpe\_SNPEBuilder\_Handle\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/typedef_SNPEBuilder_8h_1a5525f7c887b922195624658ef8f12478.html#_CPPv425Snpe_SNPEBuilder_Handle_t) snpeBuilderHandle)

    - Validates the cache records available in the DLC for compatibility with the current hardware depending on the set cache compatibility mode.

- Parameters

    - **snpeBuilderHandle** – **[in]** Handle to access the SNPEBuilder object

- Returns

    - One of the following Snpe\_ErrorCode\_t SNPE\_SUCCESS: The DLC contains a valid and usable cache record SNPE\_ERRORCODE\_DLCACHING\_INCOMPATIBLE: None of the existing caches are compatible on the current hardware SNPE\_ERRORCODE\_DLCACHING\_SUBOPTIMAL\_CACHE: Compatibility mode is strict and the best available cache is suboptimal SNPE\_ERRORCODE\_DLCONTAINER\_MISSING\_RECORDS: The DLC contains no cache records SNPE\_ERRORCODE\_DLCONTAINER\_INVALID\_RECORD: Failed to read DLC records SNPE\_ERRORCODE\_CONFIG\_INVALID\_PARAM: An invalid builder configurations is set at the time of invocation SNPE\_ERRORCODE\_UNKNOWN\_EXCEPTION: Encountered an unexpected miscellaneous error

Note

The intended usage of this function is to validate the cache ahead of time to determine the need for setting the init cache option before calling the build function. It is expected to be called after all other builder options have been set and before the build function is invoked. In particular, this function is sensitive to the resized input dimensions, output op and tensor names, and cache compatibility mode settings

Note

Validation will always fail with SNPE\_ERRORCODE\_CONFIG\_INVALID\_PARAM if coupled with cache compatibility mode ALWAYS\_GENERATE\_NEW\_CACHE

- [Snpe\_ErrorCode\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/enum_DlError_8h_1aa40d44ade537087ac80f867eb4e7d50f.html#_CPPv416Snpe_ErrorCode_t) Snpe\_SNPEBuilder\_SetCustomPerfProfile([Snpe\_SNPEBuilder\_Handle\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/typedef_SNPEBuilder_8h_1a5525f7c887b922195624658ef8f12478.html#_CPPv425Snpe_SNPEBuilder_Handle_t) snpeBuilderHandle, [Snpe\_SNPEPerfProfile\_Handle\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/typedef_SNPEPerfProfile_8h_1a8e0c1fc1e4ff1e57296365e9fdc7759e.html#_CPPv429Snpe_SNPEPerfProfile_Handle_t) perfProfileHandle)

    - Set the custom performance profile.

- Parameters

    - - **snpeBuilderHandle** – **[in]** Handle to access the SNPEBuilder object
- **perfProfileHandle** – **[in]** Handle to access the perfprofile object

- Returns

    - SNPE\_SUCCESS when successfully applied

- [Snpe\_ErrorCode\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/enum_DlError_8h_1aa40d44ade537087ac80f867eb4e7d50f.html#_CPPv416Snpe_ErrorCode_t) Snpe\_SNPEBuilder\_SetDeferredInit([Snpe\_SNPEBuilder\_Handle\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/typedef_SNPEBuilder_8h_1a5525f7c887b922195624658ef8f12478.html#_CPPv425Snpe_SNPEBuilder_Handle_t) snpeBuilderHandle, bool deferredInit)

    - Sets deferred Init.

- Parameters

    - - **snpeBuilderHandle** – **[in]** Handle to access the SNPEBuilder object
- **deferredInit** – **[in]** bool value that indicates if deferred init is enabled or not

- Returns

    - SNPE\_SUCCESS on setting the option

- [Snpe\_ErrorCode\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/enum_DlError_8h_1aa40d44ade537087ac80f867eb4e7d50f.html#_CPPv416Snpe_ErrorCode_t) Snpe\_SNPEBuilder\_SetDeferredRuntimeCleanup([Snpe\_SNPEBuilder\_Handle\_t](https://docs.qualcomm.com/doc/80-63442-10/topic/typedef_SNPEBuilder_8h_1a5525f7c887b922195624658ef8f12478.html#_CPPv425Snpe_SNPEBuilder_Handle_t) snpeBuilderHandle, bool deferredCleanup)

    - Sets deferred runtime/backend cleanup.

- Parameters

    - - **snpeBuilderHandle** – **[in]** Handle to access the SNPEBuilder object
- **deferredCleanup** – **[in]** bool value that indicates if deferred backend cleanup is enabled or not

- Returns

    - SNPE\_SUCCESS on setting the option

Note

Deferred cleanup of backend resources. The default is false. When enabled, the backend resources (e.g., HTP/GPU/CPU) will not be released during de-init. Subsequent re-inits will also be faster. The user is responsible for cleaning up backend resources via calling [Snpe\_Util\_CleanupRuntime()](https://docs.qualcomm.com/doc/80-63442-10/topic/function_SNPEUtil_8h_1a30daf2baab87e003765ebe7e317c7443.html#SNPEUtil_8h_1a30daf2baab87e003765ebe7e317c7443)

Last Published: Jul 02, 2026