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

Function applySinglePattern

unittests/Optimizer/DecompositionPatternsTest.cpp:224–235  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

222}
223
224LogicalResult applySinglePattern(ModuleOp module, StringRef patternName,
225 ArrayRef<std::size_t> disabledControlCounts) {
226 auto patternType = instantiatePatternType(patternName);
227 if (!patternType)
228 return failure();
229
230 RewritePatternSet patterns(module->getContext());
231 patterns.add(
232 patternType->create(module->getContext(), 1, disabledControlCounts));
233 FrozenRewritePatternSet frozenPatterns(std::move(patterns));
234 return applyPatternsGreedily(module, frozenPatterns);
235}
236
237// Helper to collect all gate types in a module
238llvm::StringSet<> collectGateTypesInModule(ModuleOp module) {

Callers 1

TEST_FFunction · 0.85

Calls 4

instantiatePatternTypeFunction · 0.85
getContextMethod · 0.80
addMethod · 0.45
createMethod · 0.45

Tested by

no test coverage detected