1 // Copyright (C) 2018-2019 Intel Corporation
2 // SPDX-License-Identifier: Apache-2.0
5 #include <gtest/gtest.h>
6 #include <gmock/gmock.h>
7 #include "mkldnn_plugin/mkldnn_memory.h"
8 #include "mkldnn_plugin/mkldnn_graph.h"
11 using namespace MKLDNNPlugin;
12 using namespace mkldnn;
13 using namespace ::testing;
15 class MKLDNNPrimitiveTest : public ::testing::Test {
17 virtual void TearDown() override{
20 virtual void SetUp() override{
24 //class ChildConv : public MKLDNNConvolution {
26 // explicit ChildConv(const engine& eng) : MKLDNNConvolution(eng) {}
27 // // Add the following two lines to the mock class.
28 // MOCK_METHOD0(die, void());
29 // ~ChildConv () { die(); }
33 TEST_F(MKLDNNPrimitiveTest, DISABLED_canDeleteWeightInweitableLayer) {
34 //simulate how convlayer gets created
35 engine e(engine::cpu, 0);
36 //auto node = MKLDNNPlugin::MKLDNNNodePtr(MKLDNNPlugin::MKLDNNNode::CreateNode(MKLDNNPlugin::Generic, InferenceEngine::Precision::FP32, ""));
37 // ChildConv *conv = new ChildConv(e);
38 // EXPECT_CALL(*conv, die()).Times(1);
40 std::vector<float> weights = {1,2,3,4};
41 std::vector<void *> weightsData = {(void*)&*weights.begin()};
42 std::vector <size_t> weightsSize = {weights.size() * sizeof(float)};
45 dims[0] = weights.size();
47 // conv->CreateWeightsMemory(dims, memory::f32, memory::nchw);
48 // conv->SetWeights(weightsData, weightsSize);
49 FAIL() << "Should change the test";
50 // node->SetPrimitive(conv);
53 // Mock::VerifyAndClear(conv);