// The types an operand can have.
// These values are the same as found in the NeuralNetworks.h and NeuralNetworksOEM.h files.
-enum OperandType : uint32_t {
+enum OperandType : int32_t {
FLOAT32 = 0,
INT32 = 1,
UINT32 = 2,
// NeuralNetworks.h and NeuralNetworksOEM.h files, these specify the data type they operate on.
// This is done to simplify the work of drivers.
// TODO: Currently they are the same. Add a conversion when finalizing the model.
-enum OperationType : uint32_t {
+enum OperationType : int32_t {
ADD = 0,
AVERAGE_POOL_2D = 1,
CONCATENATION = 2,
};
// How an operand is used.
-enum OperandLifeTime : uint32_t {
+enum OperandLifeTime : int32_t {
// The operand is internal to the model. It's created by an operation
// and consumed by other operations.
TEMPORARY_VARIABLE,
};
// Status of a device.
-enum DeviceStatus : uint32_t {
+enum DeviceStatus : int32_t {
AVAILABLE,
BUSY,
OFFLINE,
// The capabilities of a driver.
struct Capabilities {
vec<OperationTuple> supportedOperationTuples;
- // TODO Do the same for baseline model IDs
bool cachesCompilation;
// TODO revisit the data types and scales.
- float bootupTime; // in nanoseconds
- PerformanceInfo float16Performance;
PerformanceInfo float32Performance;
PerformanceInfo quantized8Performance;
};
vec<memory> pools;
};
-enum ErrorStatus : uint32_t {
+enum ErrorStatus : int32_t {
NONE,
DEVICE_UNAVAILABLE,
GENERAL_FAILURE,
EXPECT_NE(nullptr, capabilities.supportedOperationTuples.data());
EXPECT_NE(0ull, capabilities.supportedOperationTuples.size());
EXPECT_EQ(0u, static_cast<uint32_t>(capabilities.cachesCompilation) & ~0x1);
- EXPECT_LT(0.0f, capabilities.bootupTime);
- EXPECT_LT(0.0f, capabilities.float16Performance.execTime);
- EXPECT_LT(0.0f, capabilities.float16Performance.powerUsage);
EXPECT_LT(0.0f, capabilities.float32Performance.execTime);
EXPECT_LT(0.0f, capabilities.float32Performance.powerUsage);
EXPECT_LT(0.0f, capabilities.quantized8Performance.execTime);