EVAx10_Video_analitics/tools/nnapi-devices.c

23 lines
922 B
C

#include <android/NeuralNetworks.h>
#include <stdio.h>
int main(void) {
uint32_t count = 0;
int result = ANeuralNetworks_getDeviceCount(&count);
printf("NNAPI getDeviceCount status=%d count=%u\n", result, count);
if (result != ANEURALNETWORKS_NO_ERROR) return 1;
for (uint32_t i = 0; i < count; i++) {
ANeuralNetworksDevice *device = NULL;
int32_t type = 0;
int64_t level = 0;
const char *name = NULL, *version = NULL;
if (ANeuralNetworks_getDevice(i, &device) != ANEURALNETWORKS_NO_ERROR) return 2;
ANeuralNetworksDevice_getName(device, &name);
ANeuralNetworksDevice_getVersion(device, &version);
ANeuralNetworksDevice_getType(device, &type);
ANeuralNetworksDevice_getFeatureLevel(device, &level);
printf("%u: name=%s version=%s type=%d feature=%lld\n", i, name, version, type, (long long) level);
}
return 0;
}