| 1 | #ifndef __TMTO__IMPLEMENTATION__HPP |
|---|
| 2 | #define __TMTO__IMPLEMENTATION__HPP |
|---|
| 3 | |
|---|
| 4 | #include <tmto/condition/condition.hpp> |
|---|
| 5 | #include <tmto/round_function/round_function.hpp> |
|---|
| 6 | |
|---|
| 7 | #include <tmto/utility/array.hpp> |
|---|
| 8 | |
|---|
| 9 | #include <tmto/condition/condition.hpp> |
|---|
| 10 | #include <tmto/round_function/round_function.hpp> |
|---|
| 11 | //#include <tmto/round_function/generator/generator.hpp> |
|---|
| 12 | |
|---|
| 13 | #include <tmto/threading/shared_forward.hpp> |
|---|
| 14 | |
|---|
| 15 | #include <tmto/work_management/io_objects_fwd.hpp> |
|---|
| 16 | |
|---|
| 17 | #include <tmto/device/working_set_host_side.hpp> |
|---|
| 18 | |
|---|
| 19 | #include <tmto/origin/forward.hpp> |
|---|
| 20 | #include <tmto/table_access/table_access_fwd.hpp> |
|---|
| 21 | |
|---|
| 22 | namespace boost { |
|---|
| 23 | namespace program_options { |
|---|
| 24 | class variables_map; |
|---|
| 25 | class options_description; |
|---|
| 26 | } |
|---|
| 27 | namespace asio { |
|---|
| 28 | class io_service; |
|---|
| 29 | } |
|---|
| 30 | } |
|---|
| 31 | |
|---|
| 32 | namespace tmto { |
|---|
| 33 | template <typename T> |
|---|
| 34 | struct static_initializer { |
|---|
| 35 | static_initializer() { |
|---|
| 36 | T::static_initialize(); |
|---|
| 37 | } |
|---|
| 38 | }; |
|---|
| 39 | |
|---|
| 40 | namespace configuration { |
|---|
| 41 | class unused; |
|---|
| 42 | } |
|---|
| 43 | |
|---|
| 44 | namespace work_generator { |
|---|
| 45 | class implementation_base; |
|---|
| 46 | } |
|---|
| 47 | namespace work_consumer { |
|---|
| 48 | class implementation_base; |
|---|
| 49 | } |
|---|
| 50 | namespace work_intermediate { |
|---|
| 51 | class implementation_base; |
|---|
| 52 | } |
|---|
| 53 | |
|---|
| 54 | namespace device { |
|---|
| 55 | class device; |
|---|
| 56 | } |
|---|
| 57 | |
|---|
| 58 | namespace implementation { |
|---|
| 59 | template <typename Tag> |
|---|
| 60 | struct host_part; |
|---|
| 61 | |
|---|
| 62 | template <typename Tag> |
|---|
| 63 | struct combined_host_part; |
|---|
| 64 | |
|---|
| 65 | template <typename Tag> |
|---|
| 66 | struct arguments_host_part; |
|---|
| 67 | |
|---|
| 68 | template <> |
|---|
| 69 | struct arguments_host_part<configuration::unused> { |
|---|
| 70 | static const bool has_options = false; |
|---|
| 71 | static const char * name; |
|---|
| 72 | static const int stepping = 1; |
|---|
| 73 | }; |
|---|
| 74 | |
|---|
| 75 | template <typename Impl> |
|---|
| 76 | struct select_implementation_arguments { |
|---|
| 77 | }; |
|---|
| 78 | |
|---|
| 79 | template <typename HostPart> |
|---|
| 80 | struct tag_of; |
|---|
| 81 | template <typename Tag> |
|---|
| 82 | struct tag_of<host_part<Tag> > { |
|---|
| 83 | typedef Tag type; |
|---|
| 84 | }; |
|---|
| 85 | |
|---|
| 86 | template <typename HostPart> |
|---|
| 87 | struct arguments_tag_of; |
|---|
| 88 | template <typename Tag> |
|---|
| 89 | struct arguments_tag_of<arguments_host_part<Tag> > { |
|---|
| 90 | typedef Tag type; |
|---|
| 91 | }; |
|---|
| 92 | |
|---|
| 93 | class combined_implementation { |
|---|
| 94 | public : |
|---|
| 95 | virtual void dummy() { } |
|---|
| 96 | virtual void initialize() { } |
|---|
| 97 | |
|---|
| 98 | template <typename T> |
|---|
| 99 | device::working_set::working_set<T> * create_working_set(std::size_t size, int chunks, int num_roundfuncs) { |
|---|
| 100 | return NULL; |
|---|
| 101 | } |
|---|
| 102 | |
|---|
| 103 | int bitslice_width() { |
|---|
| 104 | return 0; |
|---|
| 105 | } |
|---|
| 106 | // bool apply_initial_roundfunc() { return false; } |
|---|
| 107 | |
|---|
| 108 | virtual const char * implementation_name() { return ""; } |
|---|
| 109 | virtual const char * condition_name() { return ""; } |
|---|
| 110 | virtual const char * round_function_name() { return ""; } |
|---|
| 111 | virtual const char * data_type_name() { return ""; } |
|---|
| 112 | virtual const char * chain_state_type_name() { return ""; } |
|---|
| 113 | |
|---|
| 114 | virtual origin::base * create_origin_management() { |
|---|
| 115 | return NULL; |
|---|
| 116 | } |
|---|
| 117 | |
|---|
| 118 | virtual table_access::master_base * create_io_scheduler(int stripewidth) { |
|---|
| 119 | return NULL; |
|---|
| 120 | } |
|---|
| 121 | |
|---|
| 122 | virtual void setup() { } |
|---|
| 123 | |
|---|
| 124 | virtual void setup |
|---|
| 125 | (threading::shared & shared, |
|---|
| 126 | work_management::io_objects_base * io_objects, |
|---|
| 127 | boost::asio::io_service & io, |
|---|
| 128 | device::device & device, bool master, int devno, |
|---|
| 129 | int num_coop_threads, |
|---|
| 130 | int abort_chain_threshold, |
|---|
| 131 | const boost::program_options::variables_map & opt, |
|---|
| 132 | origin::base *, |
|---|
| 133 | table_access::master_base * |
|---|
| 134 | ) { } |
|---|
| 135 | |
|---|
| 136 | virtual bool run(int run, int index, int devno, int dev_threadno, bool threaded, |
|---|
| 137 | bool firstrun, bool master) { |
|---|
| 138 | return false; |
|---|
| 139 | } |
|---|
| 140 | virtual void synchronize(bool master) { } |
|---|
| 141 | |
|---|
| 142 | virtual void shutdown(bool master) { } |
|---|
| 143 | |
|---|
| 144 | }; |
|---|
| 145 | } |
|---|
| 146 | |
|---|
| 147 | } |
|---|
| 148 | |
|---|
| 149 | #endif |
|---|