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

Function doSimpleTest

runtime/test/test_argument_conversion.cpp:153–174  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

151}
152
153void doSimpleTest(mlir::MLIRContext *ctx, const std::string &typeName,
154 std::vector<void *> args,
155 const std::string &additionalCode = "") {
156 std::string code = additionalCode + R"#(
157func.func private @callee(%0: )#" +
158 typeName + R"#()
159func.func @__nvqpp__mlirgen__testy(%0: )#" +
160 typeName + R"#() {
161 call @callee(%0) : ()#" +
162 typeName + R"#() -> ()
163 return
164})#";
165
166 // Create the Module
167 auto mod = mlir::parseSourceString<mlir::ModuleOp>(code, ctx);
168 llvm::outs() << "Source module:\n" << *mod << '\n';
169 ArgumentConverter ab{"testy", *mod};
170 // Create the argument conversions
171 ab.gen(args);
172 // Dump all conversions
173 dumpSubstitutionModules(ab);
174}
175
176void doTest(mlir::MLIRContext *ctx, std::vector<std::string> &typeNames,
177 std::vector<void *> args, std::size_t startingArgIdx = 0) {

Callers 5

test_scalarsFunction · 0.70
test_vectorsFunction · 0.70
test_aggregatesFunction · 0.70
test_recursiveFunction · 0.70
test_simulation_stateFunction · 0.70

Calls 2

genMethod · 0.80
dumpSubstitutionModulesFunction · 0.70

Tested by

no test coverage detected