"googlemock/vscode:/vscode.git/clone" did not exist on "4035d6ecc030defa3500f81576b4b83f316413db"
test_ppl_net.cpp 911 Bytes
Newer Older
limm's avatar
limm committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// Copyright (c) OpenMMLab. All rights reserved.

// clang-format off
#include "catch.hpp"
// clang-format on

#include "mmdeploy/core/model.h"
#include "mmdeploy/core/net.h"
#include "test_resource.h"

using namespace mmdeploy;
using namespace framework;

TEST_CASE("test pplnn net", "[.ppl_net][resource]") {
  auto& gResource = MMDeployTestResources::Get();
  auto model_list = gResource.LocateModelResources(fs::path{"mmcls"} / "pplnn");
  REQUIRE(!model_list.empty());

  Model model(model_list.front());
  REQUIRE(model);

  auto backend = "pplnn";
  auto creator = gRegistry<Net>().Get(backend);
  REQUIRE(creator);

  Device device{"cpu"};
  auto stream = Stream::GetDefault(device);
  // clang-format off
  Value net_config{
      {"context", {
          {"device", device},
          {"model", model},
          {"stream", stream}
        }
      },
      {"name", model.meta().models[0].name}
  };
}