// // Copyright © 2017 Arm Ltd. All rights reserved. // SPDX-License-Identifier: MIT // #pragma once #include namespace armnn { enum class MemorySource { Undefined = 0, Malloc = 1, DmaBuf = 2, DmaBufProtected = 4 }; using MemorySourceFlags = unsigned int; template struct IsMemorySource { static const bool value = false; }; template<> struct IsMemorySource { static const bool value = true; }; template ::value>::type* = nullptr> MemorySourceFlags Combine(Arg sourceA, Arg sourceB) { return static_cast(sourceA) | static_cast(sourceB); } template ::value>::type* = nullptr> MemorySourceFlags Combine(Arg source, Args... rest) { return static_cast(source) | Combine(rest...); } inline bool CheckFlag(MemorySourceFlags flags, MemorySource source) { return (static_cast(source) & flags) != 0; } } //namespace armnn