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

Function test_simulation_state

runtime/test/test_argument_conversion.cpp:553–572  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

551}
552
553void test_simulation_state(mlir::MLIRContext *ctx) {
554 {
555 std::vector<std::complex<double>> data{M_SQRT1_2, M_SQRT1_2, 0., 0.,
556 0., 0., 0., 0.};
557 auto x = cudaq::state(new FakeDeviceState(data.size(), data.data()));
558 std::vector<void *> v = {static_cast<void *>(&x)};
559 doSimpleTest(ctx, "!cc.ptr<!quake.state>", v);
560 }
561
562 // clang-format off
563// CHECK: Source module:
564// CHECK: func.func private @callee(!cc.ptr<!quake.state>)
565// CHECK: Substitution module:
566
567// CHECK-LABEL: cc.arg_subst[0] {
568// CHECK: %[[VAL_1:.*]] = arith.constant {{.*}} : i64
569// CHECK: %[[VAL_2:.*]] = cc.cast %[[VAL_1]] : (i64) -> !cc.ptr<!quake.state>
570// CHECK: }
571 // clang-format on
572}
573
574void test_combinations(mlir::MLIRContext *ctx) {
575 {

Callers 1

mainFunction · 0.70

Calls 4

doSimpleTestFunction · 0.70
stateClass · 0.50
sizeMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected