// // Copyright © 2017 Arm Ltd. All rights reserved. // See LICENSE file in the project root for full license information. // #pragma once #include #include #include namespace armnn { template bool IsSupportedForDataTypeGeneric(std::string* reasonIfUnsupported, DataType dataType, Float32Func floatFuncPtr, Uint8Func uint8FuncPtr, Params&&... params) { switch(dataType) { case DataType::Float32: return floatFuncPtr(reasonIfUnsupported, std::forward(params)...); case DataType::QuantisedAsymm8: return uint8FuncPtr(reasonIfUnsupported, std::forward(params)...); default: return false; } } template bool TrueFunc(std::string* reasonIfUnsupported, Params&&... params) { return true; } template bool FalseFunc(std::string* reasonIfUnsupported, Params&&... params) { return false; } template bool FalseFuncF32(std::string* reasonIfUnsupported, Params&&... params) { if (reasonIfUnsupported) { *reasonIfUnsupported = "Layer is not supported with float32 data type"; } return false; } template bool FalseFuncU8(std::string* reasonIfUnsupported, Params&&... params) { if (reasonIfUnsupported) { *reasonIfUnsupported = "Layer is not supported with 8-bit data type"; } return false; } }