MCPcopy Create free account
hub / github.com/NVIDIA/cuda-quantum / filterArgs

Function filterArgs

cudaq/lib/Optimizer/CodeGen/ConvertToQIRAPI.cpp:62–72  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

60constexpr std::array<std::string_view, 2> filterAdjointNames = {"s", "t"};
61
62static SmallVector<Value> filterArgs(Operation *op, ValueRange adaptedArgs) {
63 auto arrAttr = op->getAttrOfType<ArrayAttr>(InitialArgTypesAttrName);
64 if (!arrAttr)
65 return {};
66 SmallVector<Value> result;
67 assert(arrAttr.size() == adaptedArgs.size());
68 for (auto [tyAttr, argval] : llvm::zip(arrAttr, adaptedArgs))
69 if (cudaq::quake::isQuantumValueType(cast<TypeAttr>(tyAttr).getValue()))
70 result.push_back(argval);
71 return result;
72}
73
74template <typename OP>
75std::pair<std::string, bool> generateGateFunctionName(OP op) {

Callers 3

matchAndRewriteMethod · 0.85
matchAndRewriteMethod · 0.85
matchAndRewriteMethod · 0.85

Calls 4

isQuantumValueTypeFunction · 0.85
sizeMethod · 0.45
getValueMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected