|
| 1 | +/****************************************************************-*- C++ -*-**** |
| 2 | + * Copyright (c) 2022 - 2025 NVIDIA Corporation & Affiliates. * |
| 3 | + * All rights reserved. * |
| 4 | + * * |
| 5 | + * This source code and the accompanying materials are made available under * |
| 6 | + * the terms of the Apache License 2.0 which accompanies this distribution. * |
| 7 | + ******************************************************************************/ |
| 8 | + |
| 9 | +#pragma once |
| 10 | + |
| 11 | +#include "TargetConfig.h" |
| 12 | +#include "llvm/Support/YAMLTraits.h" |
| 13 | + |
| 14 | +// These structs can be used in a vector. |
| 15 | +LLVM_YAML_IS_SEQUENCE_VECTOR(cudaq::config::TargetFeatureFlag) |
| 16 | +LLVM_YAML_IS_SEQUENCE_VECTOR(cudaq::config::TargetArgument) |
| 17 | +LLVM_YAML_IS_SEQUENCE_VECTOR(cudaq::config::ConditionalBuildConfig) |
| 18 | +LLVM_YAML_IS_SEQUENCE_VECTOR(cudaq::config::BackendFeatureMap) |
| 19 | + |
| 20 | +namespace llvm { |
| 21 | +namespace yaml { |
| 22 | +// YML serialization declarations. |
| 23 | +template <> |
| 24 | +struct ScalarBitSetTraits<cudaq::config::TargetFeatureFlag> { |
| 25 | + static void bitset(IO &io, cudaq::config::TargetFeatureFlag &value); |
| 26 | +}; |
| 27 | + |
| 28 | +template <> |
| 29 | +struct ScalarEnumerationTraits<cudaq::config::ArgumentType> { |
| 30 | + static void enumeration(IO &io, cudaq::config::ArgumentType &value); |
| 31 | +}; |
| 32 | + |
| 33 | +template <> |
| 34 | +struct MappingTraits<cudaq::config::TargetArgument> { |
| 35 | + static void mapping(IO &io, cudaq::config::TargetArgument &info); |
| 36 | +}; |
| 37 | + |
| 38 | +template <> |
| 39 | +struct BlockScalarTraits<cudaq::config::SimulationBackendSetting> { |
| 40 | + static void output(const cudaq::config::SimulationBackendSetting &Value, |
| 41 | + void *Ctxt, llvm::raw_ostream &OS); |
| 42 | + static StringRef input(StringRef Scalar, void *Ctxt, |
| 43 | + cudaq::config::SimulationBackendSetting &Value); |
| 44 | +}; |
| 45 | +template <> |
| 46 | +struct MappingTraits<cudaq::config::ConditionalBuildConfig> { |
| 47 | + static void mapping(IO &io, cudaq::config::ConditionalBuildConfig &info); |
| 48 | +}; |
| 49 | + |
| 50 | +template <> |
| 51 | +struct MappingTraits<cudaq::config::BackendEndConfigEntry> { |
| 52 | + static void mapping(IO &io, cudaq::config::BackendEndConfigEntry &info); |
| 53 | +}; |
| 54 | +template <> |
| 55 | +struct MappingTraits<cudaq::config::BackendFeatureMap> { |
| 56 | + static void mapping(IO &io, cudaq::config::BackendFeatureMap &info); |
| 57 | +}; |
| 58 | + |
| 59 | +template <> |
| 60 | +struct MappingTraits<cudaq::config::TargetConfig> { |
| 61 | + static void mapping(IO &io, cudaq::config::TargetConfig &info); |
| 62 | +}; |
| 63 | + |
| 64 | +} // namespace yaml |
| 65 | +} // namespace llvm |
0 commit comments