Add hexagon_nn_version which can be used to query the libhexagon_nn_skel version to make sure of compatibility of on device library with the ops to execute.

PiperOrigin-RevId: 291460474
Change-Id: Id55fb72e33c99d0ee0b92ef2099acc5ac7ef1df3
This commit is contained in:
Karim Nosir 2020-01-24 15:55:32 -08:00 committed by TensorFlower Gardener
parent f851013e7c
commit 621fd03981
5 changed files with 7 additions and 0 deletions

View File

@ -76,6 +76,7 @@ cc_library(
":hexagon_implementation",
":utils",
"//tensorflow/lite:kernel_api",
"//tensorflow/lite:minimal_logging",
"//tensorflow/lite/c:common",
],
)

View File

@ -74,6 +74,7 @@ HexagonNN CreateNewHexagonInterface() {
LOAD_FUNCTION(libhexagon_interface, hexagon_nn_global_init, hexagon_nn);
LOAD_FUNCTION(libhexagon_interface, hexagon_nn_is_device_supported,
hexagon_nn);
LOAD_FUNCTION(libhexagon_interface, hexagon_nn_version, hexagon_nn);
hexagon_nn.interface_loaded = true;
return hexagon_nn;
}

View File

@ -126,6 +126,8 @@ struct HexagonNN {
// Otherwise.
hexagon_nn_is_device_supported_fn* hexagon_nn_is_device_supported;
hexagon_nn_version_fn* hexagon_nn_version = nullptr;
bool interface_loaded = false;
};

View File

@ -18,6 +18,7 @@ VERS_1.0 {
hexagon_nn_global_teardown;
hexagon_nn_global_init;
hexagon_nn_is_device_supported;
hexagon_nn_version;
# Hide everything else.
local:

View File

@ -54,4 +54,6 @@ using hexagon_nn_global_init_fn = decltype(hexagon_nn_global_init);
using hexagon_nn_is_device_supported_fn =
decltype(hexagon_nn_is_device_supported);
using hexagon_nn_version_fn = decltype(hexagon_nn_version);
#endif // TENSORFLOW_LITE_EXPERIMENTAL_DELEGATES_HEXAGON_HEXAGON_NN_INTERFACE_H_