Function Snpe_SNPEBuilder_ValidateCache

Function Documentation

Snpe_ErrorCode_t Snpe_SNPEBuilder_ValidateCache(Snpe_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