xref: /aosp_15_r20/external/executorch/backends/vulkan/runtime/graph/containers/Types.h (revision 523fa7a60841cd1ecfb9cc4201f1ca8b03ed023a)
1 /*
2  * Copyright (c) Meta Platforms, Inc. and affiliates.
3  * All rights reserved.
4  *
5  * This source code is licensed under the BSD-style license found in the
6  * LICENSE file in the root directory of this source tree.
7  */
8 
9 #pragma once
10 
11 #include <ostream>
12 
13 namespace vkcompute {
14 
15 /*
16  * This class is modelled after c10::IValue; however, it
17  * is simplified and does not support as many types.
18  * However, the core design is the same; it is a tagged
19  * union over the types supported by the Vulkan Graph
20  * type.
21  */
22 enum class TypeTag : uint32_t {
23   NONE,
24   // Scalar types
25   INT,
26   DOUBLE,
27   BOOL,
28   // Tensor and tensor adjacent types
29   TENSOR,
30   STAGING,
31   TENSORREF,
32   // Scalar lists
33   INTLIST,
34   DOUBLELIST,
35   BOOLLIST,
36   // Special Type
37   VALUELIST,
38   STRING,
39   SYMINT,
40 };
41 
42 std::ostream& operator<<(std::ostream& out, const TypeTag& tag);
43 
44 } // namespace vkcompute
45