forked from alibaba/MNN
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTestUtils.h
40 lines (35 loc) · 926 Bytes
/
TestUtils.h
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
39
40
//
// TestUtils.h
// MNN
//
// Created by MNN on 2019/01/15.
// Copyright © 2018, Alibaba Group Holding Limited
//
#ifndef TestUtils_h
#define TestUtils_h
#include <assert.h>
#include <stdio.h>
#include <functional>
#include <string>
#include "MNNForwardType.h"
#include "Session.hpp"
#include "Tensor.hpp"
/**
* @brief create session with net and backend
* @param net given net
* @param backend given backend
* @return created session
*/
MNN::Session* createSession(MNN::Interpreter* net, MNNForwardType backend);
/**
* @brief dispatch payload on all available backends
* @param payload test to perform
*/
void dispatch(std::function<void(MNNForwardType)> payload);
/**
* @brief dispatch payload on given backend
* @param payload test to perform
* @param backend given backend
*/
void dispatch(std::function<void(MNNForwardType)> payload, MNNForwardType backend);
#endif /* TestUtils_h */