context.hpp 728 Bytes
Newer Older
Paul's avatar
Paul committed
1
2
#ifndef MIGRAPHX_GUARD_CONTEXT_HPP
#define MIGRAPHX_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
#include <string>
#include <functional>
#include <memory>
#include <type_traits>
#include <utility>
Paul's avatar
Paul committed
10
#include <migraphx/config.hpp>
Paul's avatar
Paul committed
11

Paul's avatar
Paul committed
12
namespace migraphx {
Paul's avatar
Paul committed
13
inline namespace MIGRAPHX_INLINE_NS {
Paul's avatar
Paul committed
14

Paul's avatar
Paul committed
15
16
17
18
19
20
#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
21
{
Paul's avatar
Paul committed
22
23
    /// Wait for any tasks in the context to complete
    void finish() const;
Paul's avatar
Paul committed
24
};
Paul's avatar
Paul committed
25
26
27

#else

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

Paul's avatar
Paul committed
34
35
#endif

Paul's avatar
Paul committed
36
} // namespace MIGRAPHX_INLINE_NS
Paul's avatar
Paul committed
37
} // namespace migraphx
Paul's avatar
Paul committed
38
39

#endif