context.hpp 621 Bytes
Newer Older
Paul's avatar
Paul committed
1
2
#ifndef MIGRAPH_GUARD_CONTEXT_HPP
#define MIGRAPH_GUARD_CONTEXT_HPP
Paul's avatar
Paul committed
3

Paul's avatar
Paul committed
4
#include <cassert>
Paul's avatar
Paul committed
5
6
7
8
9
10
#include <string>
#include <functional>
#include <memory>
#include <type_traits>
#include <utility>

Paul's avatar
Paul committed
11
namespace migraph {
Paul's avatar
Paul committed
12

Paul's avatar
Paul committed
13
14
15
16
17
18
#ifdef DOXYGEN

/// A context is used to store internal data for a `target`. A context is
/// constructed by a target during compilation and passed to the operations
/// during `eval`.
struct context
Paul's avatar
Paul committed
19
{
Paul's avatar
Paul committed
20
21
    /// Wait for any tasks in the context to complete
    void finish() const;
Paul's avatar
Paul committed
22
};
Paul's avatar
Paul committed
23
24
25

#else

Paul's avatar
Paul committed
26
<%
Paul's avatar
Paul committed
27
28
29
interface('context',
    virtual('finish', returns='void', const=True)
)
Paul's avatar
Paul committed
30
31
%>

Paul's avatar
Paul committed
32
33
#endif

Paul's avatar
Paul committed
34
} // namespace migraph
Paul's avatar
Paul committed
35
36

#endif