author
int64 658
755k
| date
stringlengths 19
19
| timezone
int64 -46,800
43.2k
| hash
stringlengths 40
40
| message
stringlengths 5
490
| mods
list | language
stringclasses 20
values | license
stringclasses 3
values | repo
stringlengths 5
68
| original_message
stringlengths 12
491
|
---|---|---|---|---|---|---|---|---|---|
8,490 |
09.03.2020 17:57:36
| -3,600 |
89397814daaab1a88723af6765c10c2872a14836
|
Add synchro parameters and dot export to the pipeline.
|
[
{
"change_type": "MODIFY",
"old_path": "include/Tools/Sequence/Pipeline.hpp",
"new_path": "include/Tools/Sequence/Pipeline.hpp",
"diff": "@@ -30,17 +30,23 @@ public:\n// Pipeline(const module::Task &first,\n// const std::vector<std::pair<std::vector<const module::Task*>, std::vector<const module::Task*>>> &sep_stages = {},\n// const std::vector<size_t> &n_threads = {},\n+ // const std::vector<size_t> &synchro_buffer_sizes = {},\n+ // const std::vector<bool> &synchro_active_waiting = {},\n// const std::vector<bool> &thread_pinning = {},\n// const std::vector<std::vector<size_t>> &puids = {});\n// Pipeline(const module::Task &first,\n// const module::Task &last,\n// const std::vector<std::pair<std::vector<const module::Task*>, std::vector<const module::Task*>>> &sep_stages = {},\n// const std::vector<size_t> &n_threads = {},\n+ // const std::vector<size_t> &synchro_buffer_sizes = {},\n+ // const std::vector<bool> &synchro_active_waiting = {},\n// const std::vector<bool> &thread_pinning = {},\n// const std::vector<std::vector<size_t>> &puids = {});\nPipeline(const std::vector<module::Task*> &firsts,\nconst std::vector<std::pair<std::vector<module::Task*>, std::vector<module::Task*>>> &sep_stages = {},\nconst std::vector<size_t> &n_threads = {},\n+ const std::vector<size_t> &synchro_buffer_sizes = {},\n+ const std::vector<bool> &synchro_active_waiting = {},\nconst std::vector<bool> &thread_pinning = {},\nconst std::vector<std::vector<size_t>> &puids = {}/*,\nconst std::vector<bool> &tasks_inplace = {}*/);\n@@ -48,12 +54,16 @@ public:\nconst std::vector<module::Task*> &lasts,\nconst std::vector<std::pair<std::vector<module::Task*>, std::vector<module::Task*>>> &sep_stages = {},\nconst std::vector<size_t> &n_threads = {},\n+ const std::vector<size_t> &synchro_buffer_sizes = {},\n+ const std::vector<bool> &synchro_active_waiting = {},\nconst std::vector<bool> &thread_pinning = {},\nconst std::vector<std::vector<size_t>> &puids = {}/*,\nconst std::vector<bool> &tasks_inplace = {}*/);\nPipeline(module::Task &first,\nconst std::vector<std::pair<std::vector<module::Task*>, std::vector<module::Task*>>> &sep_stages = {},\nconst std::vector<size_t> &n_threads = {},\n+ const std::vector<size_t> &synchro_buffer_sizes = {},\n+ const std::vector<bool> &synchro_active_waiting = {},\nconst std::vector<bool> &thread_pinning = {},\nconst std::vector<std::vector<size_t>> &puids = {}/*,\nconst std::vector<bool> &tasks_inplace = {}*/);\n@@ -61,6 +71,8 @@ public:\nmodule::Task &last,\nconst std::vector<std::pair<std::vector<module::Task*>, std::vector<module::Task*>>> &sep_stages = {},\nconst std::vector<size_t> &n_threads = {},\n+ const std::vector<size_t> &synchro_buffer_sizes = {},\n+ const std::vector<bool> &synchro_active_waiting = {},\nconst std::vector<bool> &thread_pinning = {},\nconst std::vector<std::vector<size_t>> &puids = {}/*,\nconst std::vector<bool> &tasks_inplace = {}*/);\n@@ -84,8 +96,11 @@ public:\ninline const std::vector<std::vector<module::Task*>>& get_firsts_tasks() const;\ninline const std::vector<std::vector<module::Task*>>& get_lasts_tasks() const;\n+ void export_dot(std::ostream &stream = std::cout) const;\n+\nprotected:\n- void create_adaptors();\n+ void create_adaptors(const std::vector<size_t> &synchro_buffer_sizes = {},\n+ const std::vector<bool> &synchro_active_waiting = {});\nprivate:\ntemplate <class TA>\n@@ -93,6 +108,8 @@ private:\nconst std::vector<TA*> &lasts,\nconst std::vector<std::pair<std::vector<TA*>, std::vector<TA*>>> &sep_stages = {},\nconst std::vector<size_t> &n_threads = {},\n+ const std::vector<size_t> &synchro_buffer_sizes = {},\n+ const std::vector<bool> &synchro_active_waiting = {},\nconst std::vector<bool> &thread_pinning = {},\nconst std::vector<std::vector<size_t>> &puids = {}/*,\nconst std::vector<bool> &tasks_inplace = {}*/);\n"
},
{
"change_type": "MODIFY",
"old_path": "src/Tools/Sequence/Pipeline.cpp",
"new_path": "src/Tools/Sequence/Pipeline.cpp",
"diff": "@@ -18,19 +18,30 @@ using namespace aff3ct::tools;\n// const module::Task &last,\n// const std::vector<std::pair<std::vector<const module::Task*>, std::vector<const module::Task*>>> &sep_stages,\n// const std::vector<size_t> &n_threads,\n+// const std::vector<size_t> &synchro_buffer_sizes,\n+// const std::vector<bool> &synchro_active_waiting,\n// const std::vector<bool> &thread_pinning,\n// const std::vector<std::vector<size_t>> &puids)\n// : original_sequence(first, last, 1),\n// stages(sep_stages.size()),\n// adaptors(sep_stages.size() -1)\n// {\n-// this->init<const module::Task>(first, &last, sep_stages, n_threads, thread_pinning, puids);\n+// this->init<const module::Task>(first,\n+// &last,\n+// sep_stages,\n+// n_threads,\n+// synchro_buffer_sizes,\n+// synchro_active_waiting,\n+// thread_pinning,\n+// puids);\n// }\n// Pipeline\n// ::Pipeline(const module::Task &first,\n// const std::vector<std::pair<std::vector<const module::Task*>, std::vector<const module::Task*>>> &sep_stages,\n// const std::vector<size_t> &n_threads,\n+// const std::vector<size_t> &synchro_buffer_sizes,\n+// const std::vector<bool> &synchro_active_waiting,\n// const std::vector<bool> &thread_pinning,\n// const std::vector<std::vector<size_t>> &puids)\n// : original_sequence(first, 1),\n@@ -38,7 +49,14 @@ using namespace aff3ct::tools;\n// adaptors(sep_stages.size() -1)\n// {\n// const module::Task* last = nullptr;\n-// this->init<const module::Task>(first, last, sep_stages, n_threads, thread_pinning, puids);\n+// this->init<const module::Task>(first,\n+// last,\n+// sep_stages,\n+// n_threads,\n+// synchro_buffer_sizes,\n+// synchro_active_waiting,\n+// thread_pinning,\n+// puids);\n// }\nPipeline\n@@ -46,6 +64,8 @@ Pipeline\nconst std::vector<module::Task*> &lasts,\nconst std::vector<std::pair<std::vector<module::Task*>, std::vector<module::Task*>>> &sep_stages,\nconst std::vector<size_t> &n_threads,\n+ const std::vector<size_t> &synchro_buffer_sizes,\n+ const std::vector<bool> &synchro_active_waiting,\nconst std::vector<bool> &thread_pinning,\nconst std::vector<std::vector<size_t>> &puids/*,\nconst std::vector<bool> &tasks_inplace*/)\n@@ -53,13 +73,22 @@ Pipeline\nstages(sep_stages.size()),\nadaptors(sep_stages.size() -1)\n{\n- this->init<module::Task>(firsts, lasts, sep_stages, n_threads, thread_pinning, puids/*, tasks_inplace*/);\n+ this->init<module::Task>(firsts,\n+ lasts,\n+ sep_stages,\n+ n_threads,\n+ synchro_buffer_sizes,\n+ synchro_active_waiting,\n+ thread_pinning, puids\n+ /*, tasks_inplace*/);\n}\nPipeline\n::Pipeline(const std::vector<module::Task*> &firsts,\nconst std::vector<std::pair<std::vector<module::Task*>, std::vector<module::Task*>>> &sep_stages,\nconst std::vector<size_t> &n_threads,\n+ const std::vector<size_t> &synchro_buffer_sizes,\n+ const std::vector<bool> &synchro_active_waiting,\nconst std::vector<bool> &thread_pinning,\nconst std::vector<std::vector<size_t>> &puids/*,\nconst std::vector<bool> &tasks_inplace*/)\n@@ -67,7 +96,15 @@ Pipeline\nstages(sep_stages.size()),\nadaptors(sep_stages.size() -1)\n{\n- this->init<module::Task>(firsts, {}, sep_stages, n_threads, thread_pinning, puids/*, tasks_inplace*/);\n+ this->init<module::Task>(firsts,\n+ {},\n+ sep_stages,\n+ n_threads,\n+ synchro_buffer_sizes,\n+ synchro_active_waiting,\n+ thread_pinning,\n+ puids\n+ /*, tasks_inplace*/);\n}\nPipeline\n@@ -75,10 +112,20 @@ Pipeline\nmodule::Task &last,\nconst std::vector<std::pair<std::vector<module::Task*>, std::vector<module::Task*>>> &sep_stages,\nconst std::vector<size_t> &n_threads,\n+ const std::vector<size_t> &synchro_buffer_sizes,\n+ const std::vector<bool> &synchro_active_waiting,\nconst std::vector<bool> &thread_pinning,\nconst std::vector<std::vector<size_t>> &puids/*,\nconst std::vector<bool> &tasks_inplace*/)\n-: Pipeline({&first}, {&last}, sep_stages, n_threads, thread_pinning, puids/*, tasks_inplace*/)\n+: Pipeline({&first},\n+ {&last},\n+ sep_stages,\n+ n_threads,\n+ synchro_buffer_sizes,\n+ synchro_active_waiting,\n+ thread_pinning,\n+ puids\n+ /*, tasks_inplace*/)\n{\n}\n@@ -86,10 +133,19 @@ Pipeline\n::Pipeline(module::Task &first,\nconst std::vector<std::pair<std::vector<module::Task*>, std::vector<module::Task*>>> &sep_stages,\nconst std::vector<size_t> &n_threads,\n+ const std::vector<size_t> &synchro_buffer_sizes,\n+ const std::vector<bool> &synchro_active_waiting,\nconst std::vector<bool> &thread_pinning,\nconst std::vector<std::vector<size_t>> &puids/*,\nconst std::vector<bool> &tasks_inplace*/)\n-: Pipeline({&first}, sep_stages, n_threads, thread_pinning, puids/*, tasks_inplace*/)\n+: Pipeline({&first},\n+ sep_stages,\n+ n_threads,\n+ synchro_buffer_sizes,\n+ synchro_active_waiting,\n+ thread_pinning,\n+ puids\n+ /*, tasks_inplace*/)\n{\n}\n@@ -154,6 +210,8 @@ void Pipeline\nconst std::vector<TA*> &lasts,\nconst std::vector<std::pair<std::vector<TA*>,std::vector<TA*>>> &sep_stages,\nconst std::vector<size_t> &n_threads,\n+ const std::vector<size_t> &synchro_buffer_sizes,\n+ const std::vector<bool> &synchro_active_waiting,\nconst std::vector<bool> &thread_pinning,\nconst std::vector<std::vector<size_t>> &puids/*,\nconst std::vector<bool> &tasks_inplace*/)\n@@ -166,6 +224,24 @@ void Pipeline\nthrow tools::invalid_argument(__FILE__, __LINE__, __func__, message.str());\n}\n+ if (sep_stages.size() != synchro_buffer_sizes.size() +1 && synchro_buffer_sizes.size() != 0)\n+ {\n+ std::stringstream message;\n+ message << \"'synchro_buffer_sizes.size()' has to be equal to 'sep_stages.size() -1' or equal to '0' \"\n+ << \"('synchro_buffer_sizes.size()' = \" << synchro_buffer_sizes.size() << \" , 'sep_stages.size()' = \"\n+ << sep_stages.size() << \").\";\n+ throw tools::invalid_argument(__FILE__, __LINE__, __func__, message.str());\n+ }\n+\n+ if (sep_stages.size() != synchro_active_waiting.size() +1 && synchro_active_waiting.size() != 0)\n+ {\n+ std::stringstream message;\n+ message << \"'synchro_active_waiting.size()' has to be equal to 'sep_stages.size() -1' or equal to '0' \"\n+ << \"('synchro_active_waiting.size()' = \" << synchro_active_waiting.size() << \" , 'sep_stages.size()' = \"\n+ << sep_stages.size() << \").\";\n+ throw tools::invalid_argument(__FILE__, __LINE__, __func__, message.str());\n+ }\n+\nif (sep_stages.size() != thread_pinning.size() && thread_pinning.size() != 0)\n{\nstd::stringstream message;\n@@ -245,11 +321,11 @@ void Pipeline\n}\n}\n- this->create_adaptors();\n+ this->create_adaptors(synchro_buffer_sizes, synchro_active_waiting);\n}\nvoid Pipeline\n-::create_adaptors()\n+::create_adaptors(const std::vector<size_t> &synchro_buffer_sizes, const std::vector<bool> &synchro_active_waiting)\n{\n// sck out addr occ stage tsk id sck id\nstd::vector<std::tuple<module::Socket*, size_t, size_t, size_t, size_t>> out_sck_orphans;\n@@ -477,8 +553,9 @@ void Pipeline\n{\nstd::vector<size_t > adp_n_elmts;\nstd::vector<std::type_index> adp_datatype;\n- size_t adp_buffer_size = 1024;\n- bool adp_active_waiting = false;\n+ size_t adp_buffer_size = synchro_buffer_sizes.size() ? synchro_buffer_sizes[sta] : 1;\n+ bool adp_active_waiting = synchro_active_waiting.size() ?\n+ synchro_active_waiting[sta] : false;\nsize_t adp_n_frames = 1;\nstd::vector<module::Socket*> passed_scks_out;\n@@ -513,6 +590,7 @@ void Pipeline\nadp_active_waiting,\nadp_n_frames);\n+ size_t last_task_id = 0;\nfor (size_t t = 0; t < n_threads; t++)\n{\nmodule::Adaptor* cur_adp = (t == 0) ? adp : adp->clone();\n@@ -571,15 +649,14 @@ void Pipeline\nassert(ss != nullptr);\nss->tasks .push_back(task_push);\nss->processes.push_back([task_push]() -> int { return task_push->exec(); });\n- ss->tasks_id .push_back(ss->tasks_id[ss->tasks_id.size() -1] +1);\n+ last_task_id = ss->tasks_id[ss->tasks_id.size() -1] +1;\n+ ss->tasks_id .push_back(last_task_id);\n// this->stages[sta]->update_tasks_id(t);\n}\n- auto last_task_id = this->stages[sta]->lasts_tasks_id.back() +1;\nthis->stages[sta]->lasts_tasks_id.clear();\nthis->stages[sta]->lasts_tasks_id.push_back(last_task_id);\nthis->stages[sta]->n_tasks++;\n}\n-\nthis->stages[sta]->update_firsts_and_lasts_tasks();\nsck_to_adp_sck_id = sck_to_adp_sck_id_new;\n}\n@@ -716,3 +793,84 @@ std::vector<std::vector<module::Task*>> Pipeline\n}\nreturn tasks_per_types;\n}\n+\n+void Pipeline\n+::export_dot(std::ostream &stream) const\n+{\n+ std::function<void(Generic_node<Sub_sequence>*,\n+ const size_t,\n+ const std::string&,\n+ std::ostream&)> export_dot_subsequences_recursive =\n+ [&export_dot_subsequences_recursive, this](Generic_node<Sub_sequence> *cur_node,\n+ const size_t sta,\n+ const std::string &tab,\n+ std::ostream &stream)\n+ {\n+ if (cur_node != nullptr)\n+ {\n+ this->stages[sta]->export_dot_subsequence(cur_node->get_c()->tasks,\n+ cur_node->get_c()->tasks_id,\n+ cur_node->get_c()->type,\n+ \"Sub-sequence \"+std::to_string(cur_node->get_c()->id),\n+ tab,\n+ stream);\n+\n+ for (auto c : cur_node->get_children())\n+ export_dot_subsequences_recursive(c, sta, tab, stream);\n+ }\n+ };\n+\n+ std::function<void(Generic_node<Sub_sequence>*,\n+ const size_t,\n+ const std::string&,\n+ std::ostream&)> export_dot_connections_recursive =\n+ [&export_dot_connections_recursive, this](Generic_node<Sub_sequence> *cur_node,\n+ const size_t sta,\n+ const std::string &tab,\n+ std::ostream &stream)\n+ {\n+ if (cur_node != nullptr)\n+ {\n+ this->stages[sta]->export_dot_connections(cur_node->get_c()->tasks, tab, stream);\n+\n+ for (auto c : cur_node->get_children())\n+ export_dot_connections_recursive(c, sta, tab, stream);\n+ }\n+ };\n+\n+ std::string tab = \"\\t\";\n+ stream << \"digraph Pipeline {\" << std::endl;\n+ stream << tab << \"compound=true;\" << std::endl;\n+\n+ for (size_t sta = 0; sta < this->stages.size(); sta++)\n+ {\n+ const auto n_threads = this->stages[sta]->get_n_threads();\n+ stream << tab << \"subgraph \\\"cluster_Stage \" << sta << \"\\\" {\" << std::endl;\n+ stream << tab << tab << \"node [style=filled];\" << std::endl;\n+ export_dot_subsequences_recursive(this->stages[sta]->sequences[0], sta, tab, stream);\n+ stream << tab << tab << \"label=\\\"Pipeline stage \" << sta << \" (\" << n_threads << \" thread(s))\\\";\" << std::endl;\n+ std::string color = \"blue\";\n+ stream << tab << tab << \"color=\" << color << \";\" << std::endl;\n+ stream << tab << \"}\" << std::endl;\n+ }\n+\n+ for (size_t sta = 0; sta < this->stages.size(); sta++)\n+ {\n+ export_dot_connections_recursive(this->stages[sta]->sequences[0], sta, tab, stream);\n+ if (sta > 0)\n+ {\n+ auto tsk1 = this->stages[sta -1]->get_lasts_tasks()[0].back();\n+ auto tsk2 = this->stages[sta +0]->get_firsts_tasks()[0][0];\n+\n+ auto sck1 = tsk1->sockets[0];\n+ auto sck2 = tsk2->sockets[0];\n+\n+ stream << tab << \"\\\"\" << +sck1.get() << \"\\\" -> \\\"\" << +sck2.get()\n+ << \"\\\" [ltail=\\\"cluster_\" << +&tsk1->get_module() << \"_\" << +tsk1\n+ << \"\\\" lhead=\\\"cluster_\" << +&tsk2->get_module() << \"_\" << +tsk2\n+ << \"\\\" color=\\\"green\\\" style=\\\"dashed\\\"];\" << std::endl;\n+ }\n+ }\n+\n+ stream << \"}\" << std::endl;\n+}\n"
},
{
"change_type": "MODIFY",
"old_path": "src/Tools/Sequence/Sequence.cpp",
"new_path": "src/Tools/Sequence/Sequence.cpp",
"diff": "@@ -1011,13 +1011,14 @@ void Sequence\n{\nif (!subseq_name.empty())\n{\n- stream << tab << \"subgraph \\\"cluster_\" << subseq_name << \"\\\" {\" << std::endl;\n+ stream << tab << \"subgraph \\\"cluster_\" << subseq_name << \"_\" << +this << \"\\\" {\" << std::endl;\nstream << tab << tab << \"node [style=filled];\" << std::endl;\n}\nsize_t exec_order = 0;\nfor (auto &t : subseq)\n{\n- stream << tab << tab << \"subgraph \\\"cluster_\" << +&t->get_module() << \"_\" << +&t << \"\\\" {\" << std::endl;\n+ std::string color = dynamic_cast<module::Adaptor*>(&t->get_module()) ? \"green\" :\"blue\";\n+ stream << tab << tab << \"subgraph \\\"cluster_\" << +&t->get_module() << \"_\" << +t << \"\\\" {\" << std::endl;\nstream << tab << tab << tab << \"node [style=filled];\" << std::endl;\nstream << tab << tab << tab << \"subgraph \\\"cluster_\" << +&t << \"\\\" {\" << std::endl;\nstream << tab << tab << tab << tab << \"node [style=filled];\" << std::endl;\n@@ -1035,18 +1036,18 @@ void Sequence\n<< \"[label=\\\"\" << stype << \":\" << s->get_name() << \"\\\"];\" << std::endl;\n}\nstream << tab << tab << tab << tab << \"label=\\\"\" << t->get_name() << \" (id = \" << tasks_id[exec_order] << \")\" << \"\\\";\" << std::endl;\n- stream << tab << tab << tab << tab << \"color=blue;\" << std::endl;\n+ stream << tab << tab << tab << tab << \"color=\" << color << \";\" << std::endl;\nstream << tab << tab << tab << \"}\" << std::endl;\nstream << tab << tab << tab << \"label=\\\"\" << t->get_module().get_name() << \"\\n\"\n<< (t->get_module().get_custom_name().empty() ? \"\" : t->get_module().get_custom_name() + \"\\n\")\n<< \"exec order: [\" << exec_order++ << \"]\\n\"\n<< \"addr: \" << +&t->get_module() << \"\\\";\" << std::endl;\n- stream << tab << tab << tab << \"color=blue;\" << std::endl;\n+ stream << tab << tab << tab << \"color=\" << color << \";\" << std::endl;\nstream << tab << tab << \"}\" << std::endl;\n}\nif (!subseq_name.empty())\n{\n- stream << tab << tab << \"label=\\\"\" << subseq_name << \" (\" << this->get_n_threads() << \" thread(s))\" << \"\\\";\"\n+ stream << tab << tab << \"label=\\\"\" << subseq_name << \"\\\";\"\n<< std::endl;\nstd::string color = subseq_type == subseq_t::LOOP ? \"red\" : \"blue\";\nstream << tab << tab << \"color=\" << color << \";\" << std::endl;\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
Add synchro parameters and dot export to the pipeline.
|
8,490 |
10.03.2020 09:57:02
| -3,600 |
2719be3d5f7be2f185fae9d2c375314a0335ad64
|
Create two 'check_errors' tasks: a short and a long one.
|
[
{
"change_type": "MODIFY",
"old_path": "include/Module/Monitor/BFER/Monitor_BFER.hpp",
"new_path": "include/Module/Monitor/BFER/Monitor_BFER.hpp",
"diff": "@@ -27,6 +27,7 @@ class Monitor_BFER : public Monitor\npublic:\ninline Task& operator[](const mnt::tsk t);\ninline Socket& operator[](const mnt::sck::check_errors s);\n+ inline Socket& operator[](const mnt::sck::check_errors2 s);\nprotected:\nstruct Attributes\n@@ -72,9 +73,32 @@ public:\n* \\param Y: the decoded message (from the Decoder).\n*/\ntemplate <class A = std::allocator<B>>\n- int check_errors(const std::vector<B,A>& U, const std::vector<B,A>& Y, std::vector<int64_t>& FRA, std::vector<int64_t>& BE, std::vector<int64_t>& FE, std::vector<float>& BER, std::vector<float>& FER, const int frame_id = -1);\n+ int check_errors(const std::vector<B,A>& U,\n+ const std::vector<B,A>& V,\n+ const int frame_id = -1);\n- virtual int check_errors(const B *U, const B *Y, int64_t *FRA, int32_t *BE, int32_t *FE, float *BER, float *FER, const int frame_id = -1);\n+ template <class A = std::allocator<B>>\n+ int check_errors2(const std::vector<B,A >& U,\n+ const std::vector<B,A >& V,\n+ std::vector<int64_t>& FRA,\n+ std::vector<int64_t>& BE,\n+ std::vector<int64_t>& FE,\n+ std::vector<float >& BER,\n+ std::vector<float >& FER,\n+ const int frame_id = -1);\n+\n+ virtual int check_errors(const B *U,\n+ const B *V,\n+ const int frame_id = -1);\n+\n+ virtual int check_errors2(const B *U,\n+ const B *V,\n+ int64_t *FRA,\n+ int32_t *BE,\n+ int32_t *FE,\n+ float *BER,\n+ float *FER,\n+ const int frame_id = -1);\nbool fe_limit_achieved() const;\nbool frame_limit_achieved() const;\n@@ -119,7 +143,7 @@ public:\nprotected:\nconst Attributes& get_attributes() const;\n- virtual int _check_errors(const B *U, const B *Y, const int frame_id);\n+ virtual int _check_errors(const B *U, const B *V, const int frame_id);\n};\n}\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "include/Module/Monitor/BFER/Monitor_BFER.hxx",
"new_path": "include/Module/Monitor/BFER/Monitor_BFER.hxx",
"diff": "@@ -23,10 +23,58 @@ Socket& Monitor_BFER<B>\nreturn Module::operator[]((size_t)mnt::tsk::check_errors)[(size_t)s];\n}\n+template <typename B>\n+Socket& Monitor_BFER<B>\n+::operator[](const mnt::sck::check_errors2 s)\n+{\n+ return Module::operator[]((size_t)mnt::tsk::check_errors2)[(size_t)s];\n+}\n+\n+template <typename B>\n+template <class A>\n+int Monitor_BFER<B>\n+::check_errors(const std::vector<B,A>& U,\n+ const std::vector<B,A>& V,\n+ const int frame_id)\n+{\n+ if ((int)U.size() != this->K * this->n_frames)\n+ {\n+ std::stringstream message;\n+ message << \"'U.size()' has to be equal to 'K' * 'n_frames' ('U.size()' = \" << U.size()\n+ << \", 'K' = \" << this->K << \", 'n_frames' = \" << this->n_frames << \").\";\n+ throw tools::length_error(__FILE__, __LINE__, __func__, message.str());\n+ }\n+\n+ if ((int)V.size() != this->K * this->n_frames)\n+ {\n+ std::stringstream message;\n+ message << \"'V.size()' has to be equal to 'K' * 'n_frames' ('V.size()' = \" << V.size()\n+ << \", 'K' = \" << this->K << \", 'n_frames' = \" << this->n_frames << \").\";\n+ throw tools::length_error(__FILE__, __LINE__, __func__, message.str());\n+ }\n+\n+ if (frame_id != -1 && frame_id >= this->n_frames)\n+ {\n+ std::stringstream message;\n+ message << \"'frame_id' has to be equal to '-1' or to be smaller than 'n_frames' ('frame_id' = \"\n+ << frame_id << \", 'n_frames' = \" << this->n_frames << \").\";\n+ throw tools::length_error(__FILE__, __LINE__, __func__, message.str());\n+ }\n+\n+ return this->check_errors(U.data(), V.data(), frame_id);\n+}\n+\ntemplate <typename B>\ntemplate <class A>\nint Monitor_BFER<B>\n-::check_errors(const std::vector<B,A>& U, const std::vector<B,A>& Y, std::vector<int64_t>& FRA, std::vector<int64_t>& BE, std::vector<int64_t>& FE, std::vector<float>& BER, std::vector<float>& FER, const int frame_id)\n+::check_errors2(const std::vector<B,A >& U,\n+ const std::vector<B,A >& V,\n+ std::vector<int64_t>& FRA,\n+ std::vector<int64_t>& BE,\n+ std::vector<int64_t>& FE,\n+ std::vector<float >& BER,\n+ std::vector<float >& FER,\n+ const int frame_id)\n{\nif ((int)U.size() != this->K * this->n_frames)\n{\n@@ -36,10 +84,10 @@ int Monitor_BFER<B>\nthrow tools::length_error(__FILE__, __LINE__, __func__, message.str());\n}\n- if ((int)Y.size() != this->K * this->n_frames)\n+ if ((int)V.size() != this->K * this->n_frames)\n{\nstd::stringstream message;\n- message << \"'Y.size()' has to be equal to 'K' * 'n_frames' ('Y.size()' = \" << Y.size()\n+ message << \"'V.size()' has to be equal to 'K' * 'n_frames' ('V.size()' = \" << V.size()\n<< \", 'K' = \" << this->K << \", 'n_frames' = \" << this->n_frames << \").\";\nthrow tools::length_error(__FILE__, __LINE__, __func__, message.str());\n}\n@@ -92,7 +140,7 @@ int Monitor_BFER<B>\nthrow tools::length_error(__FILE__, __LINE__, __func__, message.str());\n}\n- return this->check_errors(U.data(), Y.data(), FRA.data(), BE.data(), FE.data(), BER.data(), FER.data(), frame_id);\n+ return this->check_errors2(U.data(), V.data(), FRA.data(), BE.data(), FE.data(), BER.data(), FER.data(), frame_id);\n}\n}\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "include/Module/Monitor/Monitor.hpp",
"new_path": "include/Module/Monitor/Monitor.hpp",
"diff": "@@ -17,11 +17,12 @@ namespace module\n{\nnamespace mnt\n{\n- enum class tsk : size_t { check_errors, get_mutual_info, check_mutual_info, SIZE };\n+ enum class tsk : size_t { check_errors, check_errors2, get_mutual_info, check_mutual_info, SIZE };\nnamespace sck\n{\n- enum class check_errors : size_t { U, V, FRA, BE, FE, BER, FER, status };\n+ enum class check_errors : size_t { U, V, status };\n+ enum class check_errors2 : size_t { U, V, FRA, BE, FE, BER, FER, status };\nenum class get_mutual_info : size_t { X, Y, status };\nenum class check_mutual_info : size_t { bits, llrs_a, llrs_e, status };\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "src/Module/Monitor/BFER/Monitor_BFER.cpp",
"new_path": "src/Module/Monitor/BFER/Monitor_BFER.cpp",
"diff": "@@ -26,25 +26,34 @@ Monitor_BFER<B>\nthrow tools::invalid_argument(__FILE__, __LINE__, __func__, message.str());\n}\n- auto &p = this->create_task(\"check_errors\", (int)mnt::tsk::check_errors);\n- auto ps_U = this->template create_socket_in <B >(p, \"U\", get_K());\n- auto ps_V = this->template create_socket_in <B >(p, \"V\", get_K());\n- auto ps_FRA = this->template create_socket_out<int64_t>(p, \"FRA\", 1 );\n- auto ps_BE = this->template create_socket_out<int32_t>(p, \"BE\", 1 );\n- auto ps_FE = this->template create_socket_out<int32_t>(p, \"FE\", 1 );\n- auto ps_BER = this->template create_socket_out<float >(p, \"BER\", 1 );\n- auto ps_FER = this->template create_socket_out<float >(p, \"FER\", 1 );\n-\n- this->create_codelet(p, [ps_U, ps_V, ps_FRA, ps_BE, ps_FE, ps_BER, ps_FER](Module &m, Task &t) -> int\n- {\n- return static_cast<Monitor_BFER<B>&>(m).check_errors(static_cast<B* >(t[ps_U ].get_dataptr()),\n- static_cast<B* >(t[ps_V ].get_dataptr()),\n- static_cast<int64_t*>(t[ps_FRA].get_dataptr()),\n- static_cast<int32_t*>(t[ps_BE ].get_dataptr()),\n- static_cast<int32_t*>(t[ps_FE ].get_dataptr()),\n- static_cast<float* >(t[ps_BER].get_dataptr()),\n- static_cast<float* >(t[ps_FER].get_dataptr())\n- );\n+ auto &p1 = this->create_task(\"check_errors\", (int)mnt::tsk::check_errors);\n+ auto p1s_U = this->template create_socket_in<B>(p1, \"U\", this->get_K());\n+ auto p1s_V = this->template create_socket_in<B>(p1, \"V\", this->get_K());\n+\n+ this->create_codelet(p1, [p1s_U, p1s_V](Module &m, Task &t) -> int\n+ {\n+ return static_cast<Monitor_BFER<B>&>(m).check_errors(static_cast<B*>(t[p1s_U].get_dataptr()),\n+ static_cast<B*>(t[p1s_V].get_dataptr()));\n+ });\n+\n+ auto &p2 = this->create_task(\"check_errors2\", (int)mnt::tsk::check_errors2);\n+ auto p2s_U = this->template create_socket_in <B >(p2, \"U\", get_K());\n+ auto p2s_V = this->template create_socket_in <B >(p2, \"V\", get_K());\n+ auto p2s_FRA = this->template create_socket_out<int64_t>(p2, \"FRA\", 1 );\n+ auto p2s_BE = this->template create_socket_out<int32_t>(p2, \"BE\", 1 );\n+ auto p2s_FE = this->template create_socket_out<int32_t>(p2, \"FE\", 1 );\n+ auto p2s_BER = this->template create_socket_out<float >(p2, \"BER\", 1 );\n+ auto p2s_FER = this->template create_socket_out<float >(p2, \"FER\", 1 );\n+\n+ this->create_codelet(p2, [p2s_U, p2s_V, p2s_FRA, p2s_BE, p2s_FE, p2s_BER, p2s_FER](Module &m, Task &t) -> int\n+ {\n+ return static_cast<Monitor_BFER<B>&>(m).check_errors2(static_cast<B* >(t[p2s_U ].get_dataptr()),\n+ static_cast<B* >(t[p2s_V ].get_dataptr()),\n+ static_cast<int64_t*>(t[p2s_FRA].get_dataptr()),\n+ static_cast<int32_t*>(t[p2s_BE ].get_dataptr()),\n+ static_cast<int32_t*>(t[p2s_FE ].get_dataptr()),\n+ static_cast<float* >(t[p2s_BER].get_dataptr()),\n+ static_cast<float* >(t[p2s_FER].get_dataptr()));\n});\nreset();\n@@ -134,7 +143,37 @@ bool Monitor_BFER<B>\ntemplate <typename B>\nint Monitor_BFER<B>\n-::check_errors(const B *U, const B *V, int64_t *FRA, int32_t *BE, int32_t *FE, float *BER, float *FER, const int frame_id)\n+::check_errors(const B *U,\n+ const B *V,\n+ const int frame_id)\n+{\n+ const auto f_start = (frame_id < 0) ? 0 : frame_id % get_n_frames();\n+ const auto f_stop = (frame_id < 0) ? get_n_frames() : f_start +1;\n+\n+ int n_be_total = 0;\n+ for (auto f = f_start; f < f_stop; f++)\n+ n_be_total += this->_check_errors(U + f * get_K(),\n+ V + f * get_K(),\n+ f);\n+\n+ this->callback_check.notify();\n+\n+ if (this->fe_limit_achieved())\n+ this->callback_fe_limit_achieved.notify();\n+\n+ return n_be_total;\n+}\n+\n+template <typename B>\n+int Monitor_BFER<B>\n+::check_errors2(const B *U,\n+ const B *V,\n+ int64_t *FRA,\n+ int32_t *BE,\n+ int32_t *FE,\n+ float *BER,\n+ float *FER,\n+ const int frame_id)\n{\nconst auto f_start = (frame_id < 0) ? 0 : frame_id % get_n_frames();\nconst auto f_stop = (frame_id < 0) ? get_n_frames() : f_start +1;\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
Create two 'check_errors' tasks: a short and a long one.
|
8,490 |
11.03.2020 16:21:35
| -3,600 |
b9b7e0bacfbf250fa33c015067570bbbc5385e5a
|
Add an unbind method to sockets.
|
[
{
"change_type": "MODIFY",
"old_path": "include/Module/Socket.hpp",
"new_path": "include/Module/Socket.hpp",
"diff": "@@ -75,6 +75,8 @@ public:\ninline void operator()(void* dataptr);\ninline void reset();\n+\n+ inline size_t unbind(Socket& s_out);\n};\n}\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "include/Module/Socket.hxx",
"new_path": "include/Module/Socket.hxx",
"diff": "#include <algorithm>\n+#include <iterator>\n#include <sstream>\n#include \"Tools/Exception/exception.hpp\"\n@@ -203,7 +204,7 @@ void Socket\nthrow tools::runtime_error(__FILE__, __LINE__, __func__, message.str());\n}\n- if ((size_t)priority >= s_out.bound_sockets.size() || priority == -1)\n+ if ((size_t)priority > s_out.bound_sockets.size() || priority == -1)\ns_out.bound_sockets.push_back(this);\nelse\ns_out.bound_sockets.insert(s_out.bound_sockets.begin() + priority, this);\n@@ -304,5 +305,72 @@ void Socket\nthis->bound_socket = nullptr;\n}\n+size_t Socket\n+::unbind(Socket &s_out)\n+{\n+ if (this->bound_socket == nullptr)\n+ {\n+ std::stringstream message;\n+ message << \"The current input socket can't be unbound because it is not bound to any output socket (\"\n+ << \"'s_out.databytes'\" << \" = \" << s_out.databytes << \", \"\n+ << \"'s_out.name'\" << \" = \" << s_out.get_name() << \", \"\n+ << \"'s_out.task.name'\" << \" = \" << s_out.task.get_name() << \", \"\n+// << \"'s_out.task.module.name'\" << \" = \" << s_out.task.get_module_name() << \", \"\n+ << \"'databytes'\" << \" = \" << this->databytes << \", \"\n+ << \"'name'\" << \" = \" << get_name() << \", \"\n+ << \"'task.name'\" << \" = \" << task.get_name() << \", \"\n+// << \"'task.module.name'\" << \" = \" << task.get_module_name()\n+ << \").\";\n+ throw tools::runtime_error(__FILE__, __LINE__, __func__, message.str());\n+ }\n+\n+ if (this->bound_socket != &s_out)\n+ {\n+ std::stringstream message;\n+ message << \"This socket is connected to a different socket than 's_out' (\"\n+ << \"'bound_socket->databytes'\" << \" = \" << this->bound_socket->databytes << \", \"\n+ << \"'bound_socket->name'\" << \" = \" << this->bound_socket->get_name() << \", \"\n+ << \"'bound_socket->task.name'\" << \" = \" << this->bound_socket->task.get_name() << \", \"\n+// << \"'bound_socket->task.module.name'\" << \" = \" << this->bound_socket->task.get_module_name() << \", \"\n+ << \"'s_out.databytes'\" << \" = \" << s_out.databytes << \", \"\n+ << \"'s_out.name'\" << \" = \" << s_out.get_name() << \", \"\n+ << \"'s_out.task.name'\" << \" = \" << s_out.task.get_name() << \", \"\n+// << \"'s_out.task.module.name'\" << \" = \" << s_out.task.get_module_name() << \", \"\n+ << \"'databytes'\" << \" = \" << this->databytes << \", \"\n+ << \"'name'\" << \" = \" << get_name() << \", \"\n+ << \"'task.name'\" << \" = \" << task.get_name() << \", \"\n+// << \"'task.module.name'\" << \" = \" << task.get_module_name()\n+ << \").\";\n+ throw tools::runtime_error(__FILE__, __LINE__, __func__, message.str());\n+ }\n+\n+ this->bound_socket = nullptr;\n+\n+ size_t unbind_pos = 0;\n+ auto it = std::find(s_out.bound_sockets.begin(), s_out.bound_sockets.end(), this);\n+ if (it != s_out.bound_sockets.end())\n+ {\n+ unbind_pos = (int)std::distance(s_out.bound_sockets.begin(), it) -1;\n+ s_out.bound_sockets.erase(it);\n+ }\n+ else\n+ {\n+ std::stringstream message;\n+ message << \"The 's_out' output socket is not bound to the current input socket (\"\n+ << \"'s_out.databytes'\" << \" = \" << s_out.databytes << \", \"\n+ << \"'s_out.name'\" << \" = \" << s_out.get_name() << \", \"\n+ << \"'s_out.task.name'\" << \" = \" << s_out.task.get_name() << \", \"\n+// << \"'s_out.task.module.name'\" << \" = \" << s_out.task.get_module_name() << \", \"\n+ << \"'databytes'\" << \" = \" << this->databytes << \", \"\n+ << \"'name'\" << \" = \" << get_name() << \", \"\n+ << \"'task.name'\" << \" = \" << task.get_name() << \", \"\n+// << \"'task.module.name'\" << \" = \" << task.get_module_name()\n+ << \").\";\n+ throw tools::runtime_error(__FILE__, __LINE__, __func__, message.str());\n+ }\n+\n+ return unbind_pos;\n+}\n+\n}\n}\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
Add an unbind method to sockets.
|
8,490 |
11.03.2020 16:22:41
| -3,600 |
c2cb6d2b1c812174896ab0105bc54be79b185b64
|
Improve the pipeline to manage bind and unbind of adaptors.
|
[
{
"change_type": "MODIFY",
"old_path": "include/Tools/Sequence/Pipeline.hpp",
"new_path": "include/Tools/Sequence/Pipeline.hpp",
"diff": "* \\file\n* \\brief Class tools::Pipeline.\n*/\n-#ifndef CHAIN_PIPELINE_HPP_\n-#define CHAIN_PIPELINE_HPP_\n+#ifndef PIPELINE_HPP_\n+#define PIPELINE_HPP_\n#include <functional>\n#include <cstdint>\n+#include <utility>\n#include <memory>\n#include <vector>\n@@ -26,6 +27,19 @@ protected:\nstd::vector<std::pair<std::vector<std::shared_ptr<module::Adaptor>>,\nstd::vector<std::shared_ptr<module::Adaptor>>>> adaptors;\n+ // sck out addr stage tsk id sck id unbind_pos\n+ std::vector<std::pair<std::tuple<module::Socket*, size_t, size_t, size_t, size_t>,\n+ // sck in addr stage tsk id sck id\n+ std::tuple<module::Socket*, size_t, size_t, size_t>>> sck_orphan_binds;\n+\n+ // sck out addr sck in addr priority\n+ std::vector<std::tuple<module::Socket*, module::Socket*, size_t>> adaptors_binds;\n+\n+ std::vector<std::vector<size_t>> saved_firsts_tasks_id;\n+ std::vector<std::vector<size_t>> saved_lasts_tasks_id;\n+\n+ bool bound_adaptors;\n+\npublic:\n// Pipeline(const module::Task &first,\n// const std::vector<std::pair<std::vector<const module::Task*>, std::vector<const module::Task*>>> &sep_stages = {},\n@@ -98,10 +112,12 @@ public:\nvoid export_dot(std::ostream &stream = std::cout) const;\n+ void bind_adaptors();\n+ void unbind_adaptors();\n+\nprotected:\nvoid create_adaptors(const std::vector<size_t> &synchro_buffer_sizes = {},\nconst std::vector<bool> &synchro_active_waiting = {});\n-\nprivate:\ntemplate <class TA>\nvoid init(const std::vector<TA*> &firsts,\n@@ -121,4 +137,4 @@ private:\n#include \"Tools/Sequence/Pipeline.hxx\"\n#endif\n-#endif /* CHAIN_PIPELINE_HPP_ */\n+#endif /* PIPELINE_HPP_ */\n"
},
{
"change_type": "MODIFY",
"old_path": "src/Tools/Sequence/Pipeline.cpp",
"new_path": "src/Tools/Sequence/Pipeline.cpp",
"diff": "@@ -24,7 +24,10 @@ using namespace aff3ct::tools;\n// const std::vector<std::vector<size_t>> &puids)\n// : original_sequence(first, last, 1),\n// stages(sep_stages.size()),\n-// adaptors(sep_stages.size() -1)\n+// adaptors(sep_stages.size() -1),\n+// saved_firsts_tasks_id(sep_stages.size()),\n+// saved_lasts_tasks_id(sep_stages.size()),\n+// bound_adaptors(false)\n// {\n// this->init<const module::Task>(first,\n// &last,\n@@ -46,7 +49,10 @@ using namespace aff3ct::tools;\n// const std::vector<std::vector<size_t>> &puids)\n// : original_sequence(first, 1),\n// stages(sep_stages.size()),\n-// adaptors(sep_stages.size() -1)\n+// adaptors(sep_stages.size() -1),\n+// saved_firsts_tasks_id(sep_stages.size()),\n+// saved_lasts_tasks_id(sep_stages.size()),\n+// bound_adaptors(false)\n// {\n// const module::Task* last = nullptr;\n// this->init<const module::Task>(first,\n@@ -71,7 +77,10 @@ Pipeline\nconst std::vector<bool> &tasks_inplace*/)\n: original_sequence(firsts, lasts, 1),\nstages(sep_stages.size()),\n- adaptors(sep_stages.size() -1)\n+ adaptors(sep_stages.size() -1),\n+ saved_firsts_tasks_id(sep_stages.size()),\n+ saved_lasts_tasks_id(sep_stages.size()),\n+ bound_adaptors(false)\n{\nthis->init<module::Task>(firsts,\nlasts,\n@@ -94,7 +103,10 @@ Pipeline\nconst std::vector<bool> &tasks_inplace*/)\n: original_sequence(firsts, 1),\nstages(sep_stages.size()),\n- adaptors(sep_stages.size() -1)\n+ adaptors(sep_stages.size() -1),\n+ saved_firsts_tasks_id(sep_stages.size()),\n+ saved_lasts_tasks_id(sep_stages.size()),\n+ bound_adaptors(false)\n{\nthis->init<module::Task>(firsts,\n{},\n@@ -322,6 +334,7 @@ void Pipeline\n}\nthis->create_adaptors(synchro_buffer_sizes, synchro_active_waiting);\n+ this->bind_adaptors();\n}\nvoid Pipeline\n@@ -329,10 +342,6 @@ void Pipeline\n{\n// sck out addr occ stage tsk id sck id\nstd::vector<std::tuple<module::Socket*, size_t, size_t, size_t, size_t>> out_sck_orphans;\n- // sck out addr stage tsk id sck id\n- std::vector<std::pair<std::tuple<module::Socket*, size_t, size_t, size_t>,\n- // sck in addr stage tsk id sck id\n- std::tuple<module::Socket*, size_t, size_t, size_t>>> sck_orphan_binds;\n// for all the stages in the pipeline\nfor (size_t sta = 0; sta < this->stages.size() -1; sta++)\n@@ -403,11 +412,15 @@ void Pipeline\nif (tsk->get_socket_type(*sck) == module::socket_t::SIN ||\ntsk->get_socket_type(*sck) == module::socket_t::SIN_SOUT)\n{\n+ module::Socket* bsck = nullptr;\ntry\n{\n// get output bounded socket\n- auto bsck = &sck->get_bound_socket(); // can throw if there is no bounded socket\n-\n+ bsck = &sck->get_bound_socket(); // can throw if there is no bounded socket\n+ }\n+ catch (const std::exception&) {}\n+ if (bsck != nullptr)\n+ {\n// check if the task of the bounded socket is not in the current stage\nif (std::find(tasks_per_threads[t].begin(),\ntasks_per_threads[t].end(),\n@@ -420,15 +433,23 @@ void Pipeline\nbreak;\nif (pos < out_sck_orphans.size())\n- sck_orphan_binds.push_back(std::make_pair(\n+ {\n+ auto sck_out = std::get<0>(out_sck_orphans[pos]);\n+ auto sck_in = sck.get();\n+ auto unbind_sout_pos = std::distance(sck_out->get_bound_sockets().begin(),\n+ std::find(sck_out->get_bound_sockets().begin(),\n+ sck_out->get_bound_sockets().end(),\n+ sck_in)) -1;\n+ this->sck_orphan_binds.push_back(std::make_pair(\nstd::make_tuple(std::get<0>(out_sck_orphans[pos]),\nstd::get<2>(out_sck_orphans[pos]),\nstd::get<3>(out_sck_orphans[pos]),\n- std::get<4>(out_sck_orphans[pos])),\n- std::make_tuple(sck.get(), sta +1, tsk_id, sck_id)));\n+ std::get<4>(out_sck_orphans[pos]),\n+ unbind_sout_pos),\n+ std::make_tuple(sck_in, sta +1, tsk_id, sck_id)));\n+ }\n}\n}\n- catch (const std::exception&) { /* do nothing */ }\n}\n}\n}\n@@ -453,7 +474,7 @@ void Pipeline\n// }\n// std::cout << std::endl << \"Detected socket binds:\" << std::endl;\n- // for (auto &bind : sck_orphan_binds)\n+ // for (auto &bind : this->sck_orphan_binds)\n// {\n// auto sck_out_name = std::get<0>(bind.first)->get_name();\n// auto tsk_out_name = std::get<0>(bind.first)->get_task().get_name();\n@@ -476,6 +497,7 @@ void Pipeline\n// ----------------------------------------------------------------------------------------------------------------\n// ------------------------------------------------------------------------------------------------ create adaptors\n// ----------------------------------------------------------------------------------------------------------------\n+ auto sck_orphan_binds = this->sck_orphan_binds;\nmodule::Adaptor* adp = nullptr;\nstd::map<module::Socket*, size_t> sck_to_adp_sck_id;\nfor (size_t sta = 0; sta < this->stages.size(); sta++)\n@@ -514,11 +536,14 @@ void Pipeline\nif (tsk_in_sta == sta)\n{\nauto sck_out_ptr = std::get<0>(bind.first);\n+ auto priority = std::get<4>(bind.first);\nauto tsk_in_id = std::get<2>(bind.second);\nauto sck_in_id = std::get<3>(bind.second);\nauto sck_in = tasks_per_threads[t][tsk_in_id]->sockets[sck_in_id];\n- sck_in->reset();\n- sck_in->bind(*task_pull->sockets[sck_to_adp_sck_id[sck_out_ptr]]);\n+ this->adaptors_binds.push_back(\n+ std::make_tuple(task_pull->sockets[sck_to_adp_sck_id[sck_out_ptr]].get(),\n+ sck_in.get(),\n+ priority));\n}\nelse\nsck_orphan_binds_new.push_back(bind);\n@@ -528,20 +553,9 @@ void Pipeline\n}\nif (t > 0)\n- {\n- // add the adaptor to the current stage\nthis->stages[sta]->all_modules[t].push_back(cur_adp);\n}\n-\n- auto ss = this->stages[sta]->sequences[t]->get_contents();\n- assert(ss != nullptr);\n- ss->tasks .insert(ss->tasks.begin(), task_pull);\n- ss->processes.insert(ss->processes.begin(), [task_pull]() -> int { return task_pull->exec(); });\n- this->stages[sta]->update_tasks_id(t);\n- }\n- this->stages[sta]->firsts_tasks_id.clear();\n- this->stages[sta]->firsts_tasks_id.push_back(0);\n- this->stages[sta]->n_tasks++;\n+ this->saved_firsts_tasks_id[sta] = this->stages[sta]->firsts_tasks_id;\nsck_orphan_binds = sck_orphan_binds_new;\n}\n@@ -590,7 +604,7 @@ void Pipeline\nadp_active_waiting,\nadp_n_frames);\n- size_t last_task_id = 0;\n+ // size_t last_task_id = 0;\nfor (size_t t = 0; t < n_threads; t++)\n{\nmodule::Adaptor* cur_adp = (t == 0) ? adp : adp->clone();\n@@ -614,9 +628,12 @@ void Pipeline\nauto tsk_out_id = std::get<2>(bind.first);\nauto sck_out_id = std::get<3>(bind.first);\nauto sck_out = tasks_per_threads[t][tsk_out_id]->sockets[sck_out_id];\n- sck_out->reset();\n+ auto priority = std::get<4>(bind.first);\nsck_to_adp_sck_id_new[sck_out_ptr] = adp_sck_id;\n- task_push->sockets[adp_sck_id++]->bind(*sck_out);\n+ this->adaptors_binds.push_back(\n+ std::make_tuple(sck_out.get(),\n+ task_push->sockets[adp_sck_id++].get(),\n+ priority));\npassed_scks_out.push_back(sck_out_ptr);\n}\n}\n@@ -635,36 +652,195 @@ void Pipeline\nauto adp_prev = t == 0 ? this->adaptors[sta -1].first [ 0] :\nthis->adaptors[sta -1].second[t -1];\nauto sck_out = (*adp_prev)[tsk_out_id].sockets[sck_out_id];\n- task_push->sockets[adp_sck_id++]->bind(*sck_out);\n+ auto priority = std::get<4>(bind.first);\n+ this->adaptors_binds.push_back(\n+ std::make_tuple(sck_out.get(),\n+ task_push->sockets[adp_sck_id++].get(),\n+ priority));\npassed_scks_out.push_back(sck_out_ptr);\n}\n}\n}\npassed_scks_out.clear();\n+ }\n+ this->saved_lasts_tasks_id[sta] = this->stages[sta]->lasts_tasks_id;\n+ }\n+ sck_to_adp_sck_id = sck_to_adp_sck_id_new;\n+ }\n+}\n+\n+void Pipeline\n+::bind_adaptors()\n+{\n+ if (!this->bound_adaptors)\n+ {\n+ for (size_t sta = 0; sta < this->stages.size(); sta++)\n+ {\n+ const auto n_threads = this->stages[sta]->get_n_threads();\n+\n+ // --------------------------------------------------------------------------------------------------------\n+ // ------------------------------------------------------------------------------------------- pull adaptor\n+ // --------------------------------------------------------------------------------------------------------\n+ if (sta > 0)\n+ {\n+ auto n_threads_prev_sta = this->stages[sta -1]->get_n_threads();\n+ for (size_t t = 0; t < n_threads; t++)\n+ {\n+ module::Adaptor* cur_adp = t > 0 ? adaptors[sta -1].second[t -1].get() :\n+ adaptors[sta -1].first [ 0].get();\n+\n+ if (t > 0 || sta == this->stages.size() -1) // add the adaptor to the current stage\n+ this->stages[sta]->all_modules[t].push_back(cur_adp);\n+\n+ auto task_pull = n_threads_prev_sta == 1 ? &(*cur_adp)[(int)module::adp::tsk::pull_n] :\n+ &(*cur_adp)[(int)module::adp::tsk::pull_1];\n+\n+ auto ss = this->stages[sta]->sequences[t]->get_contents();\n+ assert(ss != nullptr);\n+ ss->tasks .insert(ss->tasks.begin(), task_pull);\n+ ss->processes.insert(ss->processes.begin(), [task_pull]() -> int { return task_pull->exec(); });\n+ this->stages[sta]->update_tasks_id(t);\n+ }\n+ this->stages[sta]->firsts_tasks_id.clear();\n+ this->stages[sta]->firsts_tasks_id.push_back(0);\n+ this->stages[sta]->n_tasks++;\n+ }\n+\n+ // --------------------------------------------------------------------------------------------------------\n+ // ------------------------------------------------------------------------------------------- push adaptor\n+ // --------------------------------------------------------------------------------------------------------\n+ if (sta < this->stages.size() -1)\n+ {\n+ size_t last_task_id = 0;\n+ for (size_t t = 0; t < n_threads; t++)\n+ {\n+ module::Adaptor* cur_adp = adaptors[sta].first[t].get();\n// add the adaptor to the current stage\nthis->stages[sta]->all_modules[t].push_back(cur_adp);\n+ auto task_push = n_threads == 1 ? &(*cur_adp)[(int)module::adp::tsk::push_1] :\n+ &(*cur_adp)[(int)module::adp::tsk::push_n];\n+\nauto ss = this->stages[sta]->get_last_subsequence(t);\nassert(ss != nullptr);\nss->tasks .push_back(task_push);\nss->processes.push_back([task_push]() -> int { return task_push->exec(); });\nlast_task_id = ss->tasks_id[ss->tasks_id.size() -1] +1;\nss->tasks_id .push_back(last_task_id);\n- // this->stages[sta]->update_tasks_id(t);\n}\nthis->stages[sta]->lasts_tasks_id.clear();\nthis->stages[sta]->lasts_tasks_id.push_back(last_task_id);\nthis->stages[sta]->n_tasks++;\n}\nthis->stages[sta]->update_firsts_and_lasts_tasks();\n- sck_to_adp_sck_id = sck_to_adp_sck_id_new;\n+ }\n+\n+ // ------------------------------------------------------------------------------------------------------------\n+ // ---------------------------------------------------------------------------------------------- bind adaptors\n+ // ------------------------------------------------------------------------------------------------------------\n+ for (auto &bind : this->sck_orphan_binds)\n+ {\n+ auto sck_out = std::get<0>(bind.first);\n+ auto sck_in = std::get<0>(bind.second);\n+ sck_in->unbind(*sck_out);\n+ }\n+\n+ for (auto &bind : this->adaptors_binds)\n+ {\n+ auto sck_out = std::get<0>(bind);\n+ auto sck_in = std::get<1>(bind);\n+ auto priority = std::get<2>(bind);\n+ sck_in->bind(*sck_out, priority);\n+ }\n+\n+ this->bound_adaptors = true;\n+ }\n+}\n+\n+void Pipeline\n+::unbind_adaptors()\n+{\n+ if (this->bound_adaptors)\n+ {\n+ for (size_t sta = 0; sta < this->stages.size(); sta++)\n+ {\n+ const auto n_threads = this->stages[sta]->get_n_threads();\n+\n+ // --------------------------------------------------------------------------------------------------------\n+ // ------------------------------------------------------------------------------------------- pull adaptor\n+ // --------------------------------------------------------------------------------------------------------\n+ if (sta > 0)\n+ {\n+ for (size_t t = 0; t < n_threads; t++)\n+ {\n+ if (t > 0 || sta == this->stages.size() -1) // rm the adaptor to the current stage\n+ this->stages[sta]->all_modules[t].pop_back();\n+\n+ auto ss = this->stages[sta]->sequences[t]->get_contents();\n+ assert(ss != nullptr);\n+ ss->tasks .erase(ss->tasks.begin());\n+ ss->processes.erase(ss->processes.begin());\n+ this->stages[sta]->update_tasks_id(t);\n+ }\n+ this->stages[sta]->firsts_tasks_id = this->saved_firsts_tasks_id[sta];\n+ this->stages[sta]->n_tasks--;\n+ }\n+\n+ // --------------------------------------------------------------------------------------------------------\n+ // ------------------------------------------------------------------------------------------- push adaptor\n+ // --------------------------------------------------------------------------------------------------------\n+ if (sta < this->stages.size() -1)\n+ {\n+ for (size_t t = 0; t < n_threads; t++)\n+ {\n+ // rm the adaptor to the current stage\n+ this->stages[sta]->all_modules[t].pop_back();\n+\n+ auto ss = this->stages[sta]->get_last_subsequence(t);\n+ assert(ss != nullptr);\n+ ss->tasks .pop_back();\n+ ss->processes.pop_back();\n+ ss->tasks_id .pop_back();\n+ }\n+ this->stages[sta]->lasts_tasks_id = this->saved_lasts_tasks_id[sta];\n+ this->stages[sta]->n_tasks--;\n+ }\n+ this->stages[sta]->update_firsts_and_lasts_tasks();\n+ }\n+\n+ // ------------------------------------------------------------------------------------------------------------\n+ // ---------------------------------------------------------------------------------------------- bind adaptors\n+ // ------------------------------------------------------------------------------------------------------------\n+ for (auto &bind : this->adaptors_binds)\n+ {\n+ auto sck_out = std::get<0>(bind);\n+ auto sck_in = std::get<1>(bind);\n+ sck_in->unbind(*sck_out);\n+ }\n+\n+ for (auto &bind : this->sck_orphan_binds)\n+ {\n+ auto sck_out = std::get<0>(bind.first);\n+ auto priority = std::get<4>(bind.first);\n+ auto sck_in = std::get<0>(bind.second);\n+ sck_in->bind(*sck_out, priority);\n+ }\n+\n+ this->bound_adaptors = false;\n}\n}\nvoid Pipeline\n::exec(std::function<bool(const std::vector<int>&)> stop_condition)\n{\n+ if (!this->bound_adaptors)\n+ {\n+ std::stringstream message;\n+ message << \"'bound_adaptors' has to be true to execute the pipeline.\";\n+ throw tools::runtime_error(__FILE__, __LINE__, __func__, message.str());\n+ }\n+\nauto &stages = this->stages;\nauto stop_threads = [&stages]()\n{\n@@ -693,6 +869,13 @@ void Pipeline\nvoid Pipeline\n::exec(std::function<bool()> stop_condition)\n{\n+ if (!this->bound_adaptors)\n+ {\n+ std::stringstream message;\n+ message << \"'bound_adaptors' has to be true to execute the pipeline.\";\n+ throw tools::runtime_error(__FILE__, __LINE__, __func__, message.str());\n+ }\n+\nauto &stages = this->stages;\nauto stop_threads = [&stages]()\n{\n@@ -857,6 +1040,8 @@ void Pipeline\nfor (size_t sta = 0; sta < this->stages.size(); sta++)\n{\nexport_dot_connections_recursive(this->stages[sta]->sequences[0], sta, tab, stream);\n+ if (this->bound_adaptors)\n+ {\nif (sta > 0)\n{\nauto tsk1 = this->stages[sta -1]->get_lasts_tasks()[0].back();\n@@ -871,6 +1056,7 @@ void Pipeline\n<< \"\\\" color=\\\"green\\\" style=\\\"dashed\\\"];\" << std::endl;\n}\n}\n+ }\nstream << \"}\" << std::endl;\n}\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
Improve the pipeline to manage bind and unbind of adaptors.
|
8,490 |
11.03.2020 16:22:51
| -3,600 |
f2adb68c582ef585bc8147653cf6292a45c527c8
|
Fix segfault in sequence.
|
[
{
"change_type": "MODIFY",
"old_path": "src/Tools/Sequence/Sequence.cpp",
"new_path": "src/Tools/Sequence/Sequence.cpp",
"diff": "@@ -236,7 +236,7 @@ void Sequence\nfor (auto first : firsts)\n{\nauto contents = last_subseq->get_contents();\n- this->firsts_tasks_id.push_back(contents ? contents->tasks_id[contents->tasks_id.size()] : 0);\n+ this->firsts_tasks_id.push_back(contents ? contents->tasks_id[contents->tasks_id.size() -1] : 0);\nlast_subseq = this->init_recursive<SS,TA>(last_subseq,\nssid,\ntaid,\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
Fix segfault in sequence.
|
8,490 |
12.03.2020 19:22:16
| -3,600 |
a4a0b285777ec393aca8fe386b9082e123b3fa06
|
Manage multi conditions in pipeline + add exceptions support in sequence.
|
[
{
"change_type": "MODIFY",
"old_path": "include/Module/Probe/Probe.hpp",
"new_path": "include/Module/Probe/Probe.hpp",
"diff": "@@ -32,8 +32,15 @@ namespace module\n}\n}\n+class AProbe : public Module\n+{\n+protected:\n+ AProbe(const int n_frames = 1);\n+ virtual ~AProbe() = default;\n+};\n+\ntemplate <typename T>\n-class Probe : public Module, public tools::Interface_reset\n+class Probe : public AProbe, public tools::Interface_reset\n{\npublic:\ninline Task& operator[](const prb::tsk t);\n"
},
{
"change_type": "MODIFY",
"old_path": "include/Module/Probe/Probe.hxx",
"new_path": "include/Module/Probe/Probe.hxx",
"diff": "@@ -25,7 +25,7 @@ Socket& Probe<T>\ntemplate <typename T>\nProbe<T>\n::Probe(const int size, const std::string &col_name, tools::Reporter_probe& reporter, const int n_frames)\n-: Module(n_frames), size(size), col_name(col_name), reporter(reporter)\n+: AProbe(n_frames), size(size), col_name(col_name), reporter(reporter)\n{\nconst std::string name = \"Probe<\" + col_name + \">\";\nthis->set_name(name);\n"
},
{
"change_type": "MODIFY",
"old_path": "include/Tools/Sequence/Pipeline.hpp",
"new_path": "include/Tools/Sequence/Pipeline.hpp",
"diff": "@@ -57,7 +57,8 @@ public:\n// const std::vector<bool> &thread_pinning = {},\n// const std::vector<std::vector<size_t>> &puids = {});\nPipeline(const std::vector<module::Task*> &firsts,\n- const std::vector<std::pair<std::vector<module::Task*>, std::vector<module::Task*>>> &sep_stages = {},\n+ const std::vector<module::Task*> &lasts,\n+ const std::vector<std::tuple<std::vector<module::Task*>, std::vector<module::Task*>, std::vector<module::Task*>>> &sep_stages = {},\nconst std::vector<size_t> &n_threads = {},\nconst std::vector<size_t> &synchro_buffer_sizes = {},\nconst std::vector<bool> &synchro_active_waiting = {},\n@@ -73,6 +74,22 @@ public:\nconst std::vector<bool> &thread_pinning = {},\nconst std::vector<std::vector<size_t>> &puids = {}/*,\nconst std::vector<bool> &tasks_inplace = {}*/);\n+ Pipeline(const std::vector<module::Task*> &firsts,\n+ const std::vector<std::tuple<std::vector<module::Task*>, std::vector<module::Task*>, std::vector<module::Task*>>> &sep_stages = {},\n+ const std::vector<size_t> &n_threads = {},\n+ const std::vector<size_t> &synchro_buffer_sizes = {},\n+ const std::vector<bool> &synchro_active_waiting = {},\n+ const std::vector<bool> &thread_pinning = {},\n+ const std::vector<std::vector<size_t>> &puids = {}/*,\n+ const std::vector<bool> &tasks_inplace = {}*/);\n+ Pipeline(const std::vector<module::Task*> &firsts,\n+ const std::vector<std::pair<std::vector<module::Task*>, std::vector<module::Task*>>> &sep_stages = {},\n+ const std::vector<size_t> &n_threads = {},\n+ const std::vector<size_t> &synchro_buffer_sizes = {},\n+ const std::vector<bool> &synchro_active_waiting = {},\n+ const std::vector<bool> &thread_pinning = {},\n+ const std::vector<std::vector<size_t>> &puids = {}/*,\n+ const std::vector<bool> &tasks_inplace = {}*/);\nPipeline(module::Task &first,\nconst std::vector<std::pair<std::vector<module::Task*>, std::vector<module::Task*>>> &sep_stages = {},\nconst std::vector<size_t> &n_threads = {},\n@@ -93,6 +110,9 @@ public:\nvirtual ~Pipeline() = default;\n+ void exec(const std::vector<std::function<bool(const std::vector<int>&)>> &stop_conditions);\n+ void exec(const std::vector<std::function<bool( )>> &stop_conditions);\n+\nvoid exec(std::function<bool(const std::vector<int>&)> stop_condition);\nvoid exec(std::function<bool( )> stop_condition);\n@@ -122,7 +142,7 @@ private:\ntemplate <class TA>\nvoid init(const std::vector<TA*> &firsts,\nconst std::vector<TA*> &lasts,\n- const std::vector<std::pair<std::vector<TA*>, std::vector<TA*>>> &sep_stages = {},\n+ const std::vector<std::tuple<std::vector<TA*>, std::vector<TA*>, std::vector<TA*>>> &sep_stages = {},\nconst std::vector<size_t> &n_threads = {},\nconst std::vector<size_t> &synchro_buffer_sizes = {},\nconst std::vector<bool> &synchro_active_waiting = {},\n"
},
{
"change_type": "MODIFY",
"old_path": "include/Tools/Sequence/Sequence.hpp",
"new_path": "include/Tools/Sequence/Sequence.hpp",
"diff": "@@ -73,6 +73,7 @@ protected:\nbool thread_pinning;\nstd::vector<size_t> puids;\nbool no_copy_mode;\n+ const std::vector<const module::Task*> saved_exceptions;\npublic:\nSequence(const std::vector<const module::Task*> &firsts,\n@@ -84,6 +85,12 @@ public:\nconst size_t n_threads = 1,\nconst bool thread_pinning = false,\nconst std::vector<size_t> &puids = {});\n+ Sequence(const std::vector<const module::Task*> &firsts,\n+ const std::vector<const module::Task*> &lasts,\n+ const std::vector<const module::Task*> &exceptions,\n+ const size_t n_threads = 1,\n+ const bool thread_pinning = false,\n+ const std::vector<size_t> &puids = {});\nSequence(const module::Task &first,\nconst size_t n_threads = 1,\nconst bool thread_pinning = false,\n@@ -104,6 +111,13 @@ public:\nconst bool thread_pinning = false,\nconst std::vector<size_t> &puids = {},\nconst bool tasks_inplace = true);\n+ Sequence(const std::vector<module::Task*> &firsts,\n+ const std::vector<module::Task*> &lasts,\n+ const std::vector<module::Task*> &exceptions,\n+ const size_t n_threads = 1,\n+ const bool thread_pinning = false,\n+ const std::vector<size_t> &puids = {},\n+ const bool tasks_inplace = true);\nSequence(module::Task &first,\nconst size_t n_threads = 1,\nconst bool thread_pinning = false,\n@@ -156,6 +170,7 @@ protected:\nTA& first,\nTA& current_task,\nconst std::vector<TA*> &lasts,\n+ const std::vector<TA*> &exceptions,\nstd::vector<size_t> &real_lasts_id,\nstd::vector<TA*> &real_lasts);\n@@ -198,7 +213,7 @@ protected:\nprivate:\ntemplate <class SS, class TA>\n- void init(const std::vector<TA*> &firsts, const std::vector<TA*> &lasts);\n+ void init(const std::vector<TA*> &firsts, const std::vector<TA*> &lasts, const std::vector<TA*> &exceptions);\ntemplate <class SS>\ninline void _init(Generic_node<SS> *root);\n};\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "src/Module/Probe/Probe.cpp",
"diff": "+#include \"Module/Probe/Probe.hpp\"\n+\n+using namespace aff3ct;\n+using namespace aff3ct::module;\n+\n+AProbe\n+::AProbe(const int n_frames)\n+: Module(n_frames)\n+{\n+}\n"
},
{
"change_type": "MODIFY",
"old_path": "src/Tools/Sequence/Pipeline.cpp",
"new_path": "src/Tools/Sequence/Pipeline.cpp",
"diff": "#include <thread>\n#include <utility>\n#include <cassert>\n+#include <fstream>\n#include \"Module/Adaptor/Adaptor.hpp\"\n#include \"Module/Adaptor/Adaptor_1_to_n.hpp\"\n@@ -68,7 +69,7 @@ using namespace aff3ct::tools;\nPipeline\n::Pipeline(const std::vector<module::Task*> &firsts,\nconst std::vector<module::Task*> &lasts,\n- const std::vector<std::pair<std::vector<module::Task*>, std::vector<module::Task*>>> &sep_stages,\n+ const std::vector<std::tuple<std::vector<module::Task*>, std::vector<module::Task*>, std::vector<module::Task*>>> &sep_stages,\nconst std::vector<size_t> &n_threads,\nconst std::vector<size_t> &synchro_buffer_sizes,\nconst std::vector<bool> &synchro_active_waiting,\n@@ -94,6 +95,7 @@ Pipeline\nPipeline\n::Pipeline(const std::vector<module::Task*> &firsts,\n+ const std::vector<module::Task*> &lasts,\nconst std::vector<std::pair<std::vector<module::Task*>, std::vector<module::Task*>>> &sep_stages,\nconst std::vector<size_t> &n_threads,\nconst std::vector<size_t> &synchro_buffer_sizes,\n@@ -101,22 +103,67 @@ Pipeline\nconst std::vector<bool> &thread_pinning,\nconst std::vector<std::vector<size_t>> &puids/*,\nconst std::vector<bool> &tasks_inplace*/)\n-: original_sequence(firsts, 1),\n+: original_sequence(firsts, lasts, 1),\nstages(sep_stages.size()),\nadaptors(sep_stages.size() -1),\nsaved_firsts_tasks_id(sep_stages.size()),\nsaved_lasts_tasks_id(sep_stages.size()),\nbound_adaptors(false)\n{\n+ std::vector<std::tuple<std::vector<module::Task*>,\n+ std::vector<module::Task*>,\n+ std::vector<module::Task*>>> sep_stages_bis;\n+ for (auto &sep_stage : sep_stages)\n+ sep_stages_bis.push_back(std::make_tuple(sep_stage.first, sep_stage.second, std::vector<module::Task*>()));\n+\nthis->init<module::Task>(firsts,\n+ lasts,\n+ sep_stages_bis,\n+ n_threads,\n+ synchro_buffer_sizes,\n+ synchro_active_waiting,\n+ thread_pinning, puids\n+ /*, tasks_inplace*/);\n+}\n+\n+Pipeline\n+::Pipeline(const std::vector<module::Task*> &firsts,\n+ const std::vector<std::tuple<std::vector<module::Task*>, std::vector<module::Task*>, std::vector<module::Task*>>> &sep_stages,\n+ const std::vector<size_t> &n_threads,\n+ const std::vector<size_t> &synchro_buffer_sizes,\n+ const std::vector<bool> &synchro_active_waiting,\n+ const std::vector<bool> &thread_pinning,\n+ const std::vector<std::vector<size_t>> &puids/*,\n+ const std::vector<bool> &tasks_inplace*/)\n+: Pipeline(firsts,\n{},\nsep_stages,\nn_threads,\nsynchro_buffer_sizes,\nsynchro_active_waiting,\n- thread_pinning,\n- puids\n- /*, tasks_inplace*/);\n+ thread_pinning, puids/*,\n+ tasks_inplace*/)\n+{\n+}\n+\n+Pipeline\n+::Pipeline(const std::vector<module::Task*> &firsts,\n+ const std::vector<std::pair<std::vector<module::Task*>, std::vector<module::Task*>>> &sep_stages,\n+ const std::vector<size_t> &n_threads,\n+ const std::vector<size_t> &synchro_buffer_sizes,\n+ const std::vector<bool> &synchro_active_waiting,\n+ const std::vector<bool> &thread_pinning,\n+ const std::vector<std::vector<size_t>> &puids/*,\n+ const std::vector<bool> &tasks_inplace*/)\n+: Pipeline(firsts,\n+ {},\n+ sep_stages,\n+ n_threads,\n+ synchro_buffer_sizes,\n+ synchro_active_waiting,\n+ thread_pinning, puids/*,\n+ tasks_inplace*/)\n+{\n}\nPipeline\n@@ -180,6 +227,7 @@ Sequence& Pipeline\ntemplate <class TA>\ntools::Sequence* create_sequence(const std::vector<TA*> &firsts,\nconst std::vector<TA*> &lasts,\n+ const std::vector<TA*> &exceptions,\nconst size_t &n_threads,\nconst bool &thread_pinning,\nconst std::vector<size_t> &puids,\n@@ -191,36 +239,32 @@ tools::Sequence* create_sequence(const std::vector<TA*> &firsts,\ntemplate <>\ntools::Sequence* create_sequence<const module::Task>(const std::vector<const module::Task*> &firsts,\nconst std::vector<const module::Task*> &lasts,\n+ const std::vector<const module::Task*> &exceptions,\nconst size_t &n_threads,\nconst bool &thread_pinning,\nconst std::vector<size_t> &puids,\nconst bool &tasks_inplace)\n{\n- if (lasts.size())\n- return new tools::Sequence(firsts, lasts, n_threads, thread_pinning, puids);\n- else\n- return new tools::Sequence(firsts, n_threads, thread_pinning, puids);\n+ return new tools::Sequence(firsts, lasts, exceptions, n_threads, thread_pinning, puids);\n}\ntemplate <>\nSequence* create_sequence<module::Task>(const std::vector<module::Task*> &firsts,\nconst std::vector<module::Task*> &lasts,\n+ const std::vector<module::Task*> &exceptions,\nconst size_t &n_threads,\nconst bool &thread_pinning,\nconst std::vector<size_t> &puids,\nconst bool &tasks_inplace)\n{\n- if (lasts.size())\n- return new tools::Sequence(firsts, lasts, n_threads, thread_pinning, puids, tasks_inplace);\n- else\n- return new tools::Sequence(firsts, n_threads, thread_pinning, puids, tasks_inplace);\n+ return new tools::Sequence(firsts, lasts, exceptions, n_threads, thread_pinning, puids, tasks_inplace);\n}\ntemplate <class TA>\nvoid Pipeline\n::init(const std::vector<TA*> &firsts,\nconst std::vector<TA*> &lasts,\n- const std::vector<std::pair<std::vector<TA*>,std::vector<TA*>>> &sep_stages,\n+ const std::vector<std::tuple<std::vector<TA*>,std::vector<TA*>,std::vector<TA*>>> &sep_stages,\nconst std::vector<size_t> &n_threads,\nconst std::vector<size_t> &synchro_buffer_sizes,\nconst std::vector<bool> &synchro_active_waiting,\n@@ -294,8 +338,9 @@ void Pipeline\nfor (size_t s = 0; s < sep_stages.size(); s++)\n{\n- const std::vector<TA*> &stage_firsts = sep_stages[s].first;\n- const std::vector<TA*> &stage_lasts = sep_stages[s].second;\n+ const std::vector<TA*> &stage_firsts = std::get<0>(sep_stages[s]);\n+ const std::vector<TA*> &stage_lasts = std::get<1>(sep_stages[s]);\n+ const std::vector<TA*> &stage_exceptions = std::get<2>(sep_stages[s]);\nconst size_t stage_n_threads = n_threads.size() ? n_threads[s] : 1;\nconst bool stage_thread_pinning = thread_pinning.size() ? thread_pinning[s] : false;\nconst std::vector<size_t> stage_puids = puids.size() ? puids[s] : std::vector<size_t>();\n@@ -303,6 +348,7 @@ void Pipeline\nthis->stages[s].reset(create_sequence<TA>(stage_firsts,\nstage_lasts,\n+ stage_exceptions,\nstage_n_threads,\nstage_thread_pinning,\nstage_puids,\n@@ -832,8 +878,16 @@ void Pipeline\n}\nvoid Pipeline\n-::exec(std::function<bool(const std::vector<int>&)> stop_condition)\n+::exec(const std::vector<std::function<bool(const std::vector<int>&)>> &stop_conditions)\n+{\n+ if (stop_conditions.size() != this->stages.size())\n{\n+ std::stringstream message;\n+ message << \"'stop_conditions.size()' has to be equal to 'stages.size()' ('stop_conditions.size()' = \"\n+ << stop_conditions.size() << \", 'stages.size()' = \" << stages.size() << \").\";\n+ throw tools::invalid_argument(__FILE__, __LINE__, __func__, message.str());\n+ }\n+\nif (!this->bound_adaptors)\n{\nstd::stringstream message;\n@@ -853,13 +907,14 @@ void Pipeline\nfor (size_t s = 0; s < stages.size() -1; s++)\n{\nauto &stage = stages[s];\n+ auto &stop_condition = stop_conditions[s];\nthreads.push_back(std::thread([&stage, &stop_condition, &stop_threads]()\n{\nstage->exec(stop_condition);\nstop_threads();\n}));\n}\n- stages[stages.size() -1]->exec(stop_condition);\n+ stages[stages.size() -1]->exec(stop_conditions[stages.size() -1]);\nstop_threads();\nfor (auto &t : threads)\n@@ -867,8 +922,16 @@ void Pipeline\n}\nvoid Pipeline\n-::exec(std::function<bool()> stop_condition)\n+::exec(const std::vector<std::function<bool()>> &stop_conditions)\n+{\n+ if (stop_conditions.size() != this->stages.size())\n{\n+ std::stringstream message;\n+ message << \"'stop_conditions.size()' has to be equal to 'stages.size()' ('stop_conditions.size()' = \"\n+ << stop_conditions.size() << \", 'stages.size()' = \" << stages.size() << \").\";\n+ throw tools::invalid_argument(__FILE__, __LINE__, __func__, message.str());\n+ }\n+\nif (!this->bound_adaptors)\n{\nstd::stringstream message;\n@@ -888,19 +951,32 @@ void Pipeline\nfor (size_t s = 0; s < stages.size() -1; s++)\n{\nauto &stage = stages[s];\n+ auto &stop_condition = stop_conditions[s];\nthreads.push_back(std::thread([&stage, &stop_condition, &stop_threads]()\n{\nstage->exec(stop_condition);\nstop_threads();\n}));\n}\n- stages[stages.size() -1]->exec(stop_condition);\n+ stages[stages.size() -1]->exec(stop_conditions[stages.size() -1]);\nstop_threads();\nfor (auto &t : threads)\nt.join();\n}\n+void Pipeline\n+::exec(std::function<bool(const std::vector<int>&)> stop_condition)\n+{\n+ this->exec(std::vector<std::function<bool(const std::vector<int>&)>>(this->stages.size(), stop_condition));\n+}\n+\n+void Pipeline\n+::exec(std::function<bool()> stop_condition)\n+{\n+ this->exec(std::vector<std::function<bool()>>(this->stages.size(), stop_condition));\n+}\n+\nconst std::vector<std::vector<module::Task*>>& Pipeline\n::get_firsts_tasks() const\n{\n"
},
{
"change_type": "MODIFY",
"old_path": "src/Tools/Sequence/Sequence.cpp",
"new_path": "src/Tools/Sequence/Sequence.cpp",
"diff": "#include \"Module/Module.hpp\"\n#include \"Module/Task.hpp\"\n#include \"Module/Socket.hpp\"\n+#include \"Module/Probe/Probe.hpp\"\n#include \"Module/Loop/Loop.hpp\"\n#include \"Module/Router/Router.hpp\"\n#include \"Module/Adaptor/Adaptor.hpp\"\n@@ -25,6 +26,7 @@ using namespace aff3ct::tools;\nSequence\n::Sequence(const std::vector<const module::Task*> &firsts,\nconst std::vector<const module::Task*> &lasts,\n+ const std::vector<const module::Task*> &exceptions,\nconst size_t n_threads,\nconst bool thread_pinning,\nconst std::vector<size_t> &puids)\n@@ -37,7 +39,8 @@ Sequence\ntasks_inplace(false),\nthread_pinning(thread_pinning),\npuids(puids),\n- no_copy_mode(true)\n+ no_copy_mode(true),\n+ saved_exceptions(exceptions)\n{\n#ifndef AFF3CT_HWLOC\nif (thread_pinning)\n@@ -53,34 +56,26 @@ Sequence\nthrow tools::invalid_argument(__FILE__, __LINE__, __func__, message.str());\n}\n- this->init<tools::Sub_sequence_const,const module::Task>(firsts, lasts);\n+ this->init<tools::Sub_sequence_const,const module::Task>(firsts, lasts, exceptions);\n}\nSequence\n::Sequence(const std::vector<const module::Task*> &firsts,\n+ const std::vector<const module::Task*> &lasts,\nconst size_t n_threads,\nconst bool thread_pinning,\nconst std::vector<size_t> &puids)\n-: n_threads(n_threads),\n- sequences(n_threads, nullptr),\n- modules(n_threads),\n- all_modules(n_threads),\n- mtx_exception(new std::mutex()),\n- force_exit_loop(new std::atomic<bool>(false)),\n- tasks_inplace(false),\n- thread_pinning(thread_pinning),\n- puids(puids),\n- no_copy_mode(true)\n-{\n- if (thread_pinning && puids.size() < n_threads)\n+: Sequence(firsts, lasts, {}, n_threads, thread_pinning, puids)\n{\n- std::stringstream message;\n- message << \"'puids.size()' has greater or equal to 'n_threads' ('puids.size()' = \" << puids.size()\n- << \" , 'n_threads' = \" << n_threads << \").\";\n- throw tools::invalid_argument(__FILE__, __LINE__, __func__, message.str());\n}\n- this->init<tools::Sub_sequence_const,const module::Task>(firsts, {});\n+Sequence\n+::Sequence(const std::vector<const module::Task*> &firsts,\n+ const size_t n_threads,\n+ const bool thread_pinning,\n+ const std::vector<size_t> &puids)\n+: Sequence(firsts, {}, {}, n_threads, thread_pinning, puids)\n+{\n}\nSequence\n@@ -102,9 +97,18 @@ Sequence\n{\n}\n+std::vector<const module::Task*> exceptions_convert_to_const(const std::vector<module::Task*> &exceptions)\n+{\n+ std::vector<const module::Task*> exceptions_const;\n+ for (auto exception : exceptions)\n+ exceptions_const.push_back(exception);\n+ return exceptions_const;\n+}\n+\nSequence\n::Sequence(const std::vector<module::Task*> &firsts,\nconst std::vector<module::Task*> &lasts,\n+ const std::vector<module::Task*> &exceptions,\nconst size_t n_threads,\nconst bool thread_pinning,\nconst std::vector<size_t> &puids,\n@@ -118,7 +122,8 @@ Sequence\ntasks_inplace(tasks_inplace),\nthread_pinning(thread_pinning),\npuids(puids),\n- no_copy_mode(true)\n+ no_copy_mode(true),\n+ saved_exceptions(exceptions_convert_to_const(exceptions))\n{\nif (thread_pinning && puids.size() < n_threads)\n{\n@@ -129,50 +134,38 @@ Sequence\n}\nif (tasks_inplace)\n- this->init<tools::Sub_sequence,module::Task>(firsts, lasts);\n+ this->init<tools::Sub_sequence,module::Task>(firsts, lasts, exceptions);\nelse\n{\nstd::vector<const module::Task*> firsts_bis;\nfor (auto first : firsts) firsts_bis.push_back(first);\nstd::vector<const module::Task*> lasts_bis;\nfor (auto last : lasts) lasts_bis.push_back(last);\n- this->init<tools::Sub_sequence_const,const module::Task>(firsts_bis, lasts_bis);\n+ std::vector<const module::Task*> exceptions_bis;\n+ for (auto exception : exceptions) exceptions_bis.push_back(exception);\n+ this->init<tools::Sub_sequence_const,const module::Task>(firsts_bis, lasts_bis, exceptions_bis);\n}\n}\nSequence\n::Sequence(const std::vector<module::Task*> &firsts,\n+ const std::vector<module::Task*> &lasts,\nconst size_t n_threads,\nconst bool thread_pinning,\nconst std::vector<size_t> &puids,\nconst bool tasks_inplace)\n-: n_threads(n_threads),\n- sequences(n_threads, nullptr),\n- modules(tasks_inplace ? n_threads -1 : n_threads),\n- all_modules(n_threads),\n- mtx_exception(new std::mutex()),\n- force_exit_loop(new std::atomic<bool>(false)),\n- tasks_inplace(tasks_inplace),\n- thread_pinning(false),\n- puids(puids),\n- no_copy_mode(true)\n-{\n- if (thread_pinning && puids.size() < n_threads)\n+: Sequence(firsts, lasts, {}, n_threads, thread_pinning, puids, tasks_inplace)\n{\n- std::stringstream message;\n- message << \"'puids.size()' has to be greater or equal to 'n_threads' ('puids.size()' = \" << puids.size()\n- << \" , 'n_threads' = \" << n_threads << \").\";\n- throw tools::invalid_argument(__FILE__, __LINE__, __func__, message.str());\n}\n- if (tasks_inplace)\n- this->init<tools::Sub_sequence,module::Task>(firsts, {});\n- else\n+Sequence\n+::Sequence(const std::vector<module::Task*> &firsts,\n+ const size_t n_threads,\n+ const bool thread_pinning,\n+ const std::vector<size_t> &puids,\n+ const bool tasks_inplace)\n+: Sequence(firsts, {}, {}, n_threads, thread_pinning, puids, tasks_inplace)\n{\n- std::vector<const module::Task*> firsts_bis;\n- for (auto first : firsts) firsts_bis.push_back(first);\n- this->init<tools::Sub_sequence_const,const module::Task>(firsts_bis, {});\n- }\n}\nSequence\n@@ -205,7 +198,7 @@ Sequence\ntemplate <class SS, class TA>\nvoid Sequence\n-::init(const std::vector<TA*> &firsts, const std::vector<TA*> &lasts)\n+::init(const std::vector<TA*> &firsts, const std::vector<TA*> &lasts, const std::vector<TA*> &exceptions)\n{\nif (this->is_thread_pinning())\nThread_pinning::pin(this->puids[0]);\n@@ -224,6 +217,27 @@ void Sequence\nthrow tools::invalid_argument(__FILE__, __LINE__, __func__, message.str());\n}\n+ for (auto exception : exceptions)\n+ {\n+ if (std::find(firsts.begin(), firsts.end(), exception) != firsts.end())\n+ {\n+ std::stringstream message;\n+ message << \"'exception' can't be contained in the 'firsts' vector (\"\n+ << \"'exception'\" << \" = \" << +exception << \", \"\n+ << \"'exception->get_name()'\" << \" = \" << exception->get_name() << \").\";\n+ throw tools::invalid_argument(__FILE__, __LINE__, __func__, message.str());\n+ }\n+\n+ if (std::find(lasts.begin(), lasts.end(), exception) != lasts.end())\n+ {\n+ std::stringstream message;\n+ message << \"'exception' can't be contained in the 'lasts' vector (\"\n+ << \"'exception'\" << \" = \" << +exception << \", \"\n+ << \"'exception->get_name()'\" << \" = \" << exception->get_name() << \").\";\n+ throw tools::invalid_argument(__FILE__, __LINE__, __func__, message.str());\n+ }\n+ }\n+\nauto root = new Generic_node<SS>(nullptr, {}, nullptr, 0, 0, 0);\nroot->set_contents(nullptr);\nsize_t ssid = 0, taid = 0;\n@@ -244,6 +258,7 @@ void Sequence\n*first,\n*first,\nlasts,\n+ exceptions,\nthis->lasts_tasks_id,\nreal_lasts);\n}\n@@ -289,7 +304,7 @@ Sequence* Sequence\nfor (auto ta : this->get_lasts_tasks()[0])\nlasts_tasks.push_back(ta);\n- c->init<tools::Sub_sequence_const,const module::Task>(firsts_tasks, lasts_tasks);\n+ c->init<tools::Sub_sequence_const,const module::Task>(firsts_tasks, lasts_tasks, this->saved_exceptions);\nc->mtx_exception.reset(new std::mutex());\nc->force_exit_loop.reset(new std::atomic<bool>(false));\nreturn c;\n@@ -653,6 +668,7 @@ Generic_node<SS>* Sequence\nTA &first,\nTA ¤t_task,\nconst std::vector<TA*> &lasts,\n+ const std::vector<TA*> &exceptions,\nstd::vector<size_t> &real_lasts_id,\nstd::vector<TA*> &real_lasts)\n{\n@@ -715,7 +731,8 @@ Generic_node<SS>* Sequence\n{\nnode_loop_son0->get_c()->id = ssid++;\nauto &t = loop->tasks[0]->sockets[2]->get_bound_sockets()[0]->get_task();\n- Sequence::init_recursive<SS,TA>(node_loop_son0, ssid, taid, loops, first, t, lasts, real_lasts_id, real_lasts);\n+ Sequence::init_recursive<SS,TA>(node_loop_son0, ssid, taid, loops, first, t, lasts, exceptions,\n+ real_lasts_id, real_lasts);\n}\nelse\n{\n@@ -730,7 +747,8 @@ Generic_node<SS>* Sequence\n{\nnode_loop_son1->get_c()->id = ssid++;\nauto &t = loop->tasks[0]->sockets[3]->get_bound_sockets()[0]->get_task();\n- return Sequence::init_recursive<SS,TA>(node_loop_son1, ssid, taid, loops, first, t, lasts, real_lasts_id, real_lasts);\n+ return Sequence::init_recursive<SS,TA>(node_loop_son1, ssid, taid, loops, first, t, lasts, exceptions,\n+ real_lasts_id, real_lasts);\n}\nelse\n{\n@@ -765,10 +783,15 @@ Generic_node<SS>* Sequence\nif (bs != nullptr)\n{\nauto &t = bs->get_task();\n+ if (std::find(exceptions.begin(), exceptions.end(), &t) == exceptions.end())\n+ {\nif (t.is_last_input_socket(*bs) || dynamic_cast<const module::Loop*>(&t.get_module()))\n{\nis_last = false;\n- last_subseq = Sequence::init_recursive<SS,TA>(cur_subseq, ssid, taid, loops, first, t, lasts, real_lasts_id, real_lasts);\n+ last_subseq = Sequence::init_recursive<SS,TA>(cur_subseq, ssid, taid, loops, first,\n+ t, lasts, exceptions, real_lasts_id,\n+ real_lasts);\n+ }\n}\n}\n}\n@@ -803,9 +826,6 @@ Generic_node<SS>* Sequence\nreturn cur_subseq;\n}\n-// template const module::Task& tools::Sequence::init_recursive<tools::Sub_sequence_const, const module::Task>(Generic_node<tools::Sub_sequence_const>*, size_t&, size_t&, std::vector<const module::Task*>&, const module::Task&, const module::Task&, const module::Task*);\n-// template const module::Task& tools::Sequence::init_recursive<tools::Sub_sequence, module::Task>(Generic_node<tools::Sub_sequence >*, size_t&, size_t&, std::vector< module::Task*>&, module::Task&, module::Task&, module::Task*);\n-\ntemplate <class SS, class MO>\nvoid Sequence\n::duplicate(const Generic_node<SS> *sequence)\n@@ -842,8 +862,17 @@ void Sequence\nthis->modules[tid].resize(modules_vec.size());\nthis->all_modules[tid + (this->tasks_inplace ? 1 : 0)].resize(modules_vec.size());\nfor (size_t m = 0; m < modules_vec.size(); m++)\n+ {\n+ try\n{\nthis->modules[tid][m].reset(modules_vec[m]->clone());\n+ }\n+ catch (std::exception &e)\n+ {\n+ std::cerr << rang::tag::error << \"Module clone failed when trying to duplicate the sequence: module \"\n+ << \"name is '\" << modules_vec[m]->get_name() << \"'.\" << std::endl;\n+ throw e;\n+ }\nthis->all_modules[tid + (this->tasks_inplace ? 1 : 0)][m] = this->modules[tid][m].get();\n}\n@@ -1018,6 +1047,7 @@ void Sequence\nfor (auto &t : subseq)\n{\nstd::string color = dynamic_cast<module::Adaptor*>(&t->get_module()) ? \"green\" :\"blue\";\n+ color = dynamic_cast<module::AProbe*>(&t->get_module()) ? \"pink\" : color;\nstream << tab << tab << \"subgraph \\\"cluster_\" << +&t->get_module() << \"_\" << +t << \"\\\" {\" << std::endl;\nstream << tab << tab << tab << \"node [style=filled];\" << std::endl;\nstream << tab << tab << tab << \"subgraph \\\"cluster_\" << +&t << \"\\\" {\" << std::endl;\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
Manage multi conditions in pipeline + add exceptions support in sequence.
|
8,490 |
14.03.2020 10:21:31
| -3,600 |
e8c76cb5ae50e9157c77f74e6fb347b3324a2856
|
Rename 'exceptions' in 'exclusions'.
|
[
{
"change_type": "MODIFY",
"old_path": "include/Tools/Sequence/Sequence.hpp",
"new_path": "include/Tools/Sequence/Sequence.hpp",
"diff": "@@ -73,7 +73,7 @@ protected:\nbool thread_pinning;\nstd::vector<size_t> puids;\nbool no_copy_mode;\n- const std::vector<const module::Task*> saved_exceptions;\n+ const std::vector<const module::Task*> saved_exclusions;\npublic:\nSequence(const std::vector<const module::Task*> &firsts,\n@@ -87,7 +87,7 @@ public:\nconst std::vector<size_t> &puids = {});\nSequence(const std::vector<const module::Task*> &firsts,\nconst std::vector<const module::Task*> &lasts,\n- const std::vector<const module::Task*> &exceptions,\n+ const std::vector<const module::Task*> &exclusions,\nconst size_t n_threads = 1,\nconst bool thread_pinning = false,\nconst std::vector<size_t> &puids = {});\n@@ -113,7 +113,7 @@ public:\nconst bool tasks_inplace = true);\nSequence(const std::vector<module::Task*> &firsts,\nconst std::vector<module::Task*> &lasts,\n- const std::vector<module::Task*> &exceptions,\n+ const std::vector<module::Task*> &exclusions,\nconst size_t n_threads = 1,\nconst bool thread_pinning = false,\nconst std::vector<size_t> &puids = {},\n@@ -170,7 +170,7 @@ protected:\nTA& first,\nTA& current_task,\nconst std::vector<TA*> &lasts,\n- const std::vector<TA*> &exceptions,\n+ const std::vector<TA*> &exclusions,\nstd::vector<size_t> &real_lasts_id,\nstd::vector<TA*> &real_lasts);\n@@ -213,7 +213,7 @@ protected:\nprivate:\ntemplate <class SS, class TA>\n- void init(const std::vector<TA*> &firsts, const std::vector<TA*> &lasts, const std::vector<TA*> &exceptions);\n+ void init(const std::vector<TA*> &firsts, const std::vector<TA*> &lasts, const std::vector<TA*> &exclusions);\ntemplate <class SS>\ninline void _init(Generic_node<SS> *root);\n};\n"
},
{
"change_type": "MODIFY",
"old_path": "src/Tools/Sequence/Pipeline.cpp",
"new_path": "src/Tools/Sequence/Pipeline.cpp",
"diff": "@@ -227,7 +227,7 @@ Sequence& Pipeline\ntemplate <class TA>\ntools::Sequence* create_sequence(const std::vector<TA*> &firsts,\nconst std::vector<TA*> &lasts,\n- const std::vector<TA*> &exceptions,\n+ const std::vector<TA*> &exclusions,\nconst size_t &n_threads,\nconst bool &thread_pinning,\nconst std::vector<size_t> &puids,\n@@ -239,25 +239,25 @@ tools::Sequence* create_sequence(const std::vector<TA*> &firsts,\ntemplate <>\ntools::Sequence* create_sequence<const module::Task>(const std::vector<const module::Task*> &firsts,\nconst std::vector<const module::Task*> &lasts,\n- const std::vector<const module::Task*> &exceptions,\n+ const std::vector<const module::Task*> &exclusions,\nconst size_t &n_threads,\nconst bool &thread_pinning,\nconst std::vector<size_t> &puids,\nconst bool &tasks_inplace)\n{\n- return new tools::Sequence(firsts, lasts, exceptions, n_threads, thread_pinning, puids);\n+ return new tools::Sequence(firsts, lasts, exclusions, n_threads, thread_pinning, puids);\n}\ntemplate <>\nSequence* create_sequence<module::Task>(const std::vector<module::Task*> &firsts,\nconst std::vector<module::Task*> &lasts,\n- const std::vector<module::Task*> &exceptions,\n+ const std::vector<module::Task*> &exclusions,\nconst size_t &n_threads,\nconst bool &thread_pinning,\nconst std::vector<size_t> &puids,\nconst bool &tasks_inplace)\n{\n- return new tools::Sequence(firsts, lasts, exceptions, n_threads, thread_pinning, puids, tasks_inplace);\n+ return new tools::Sequence(firsts, lasts, exclusions, n_threads, thread_pinning, puids, tasks_inplace);\n}\ntemplate <class TA>\n@@ -340,7 +340,7 @@ void Pipeline\n{\nconst std::vector<TA*> &stage_firsts = std::get<0>(sep_stages[s]);\nconst std::vector<TA*> &stage_lasts = std::get<1>(sep_stages[s]);\n- const std::vector<TA*> &stage_exceptions = std::get<2>(sep_stages[s]);\n+ const std::vector<TA*> &stage_exclusions = std::get<2>(sep_stages[s]);\nconst size_t stage_n_threads = n_threads.size() ? n_threads[s] : 1;\nconst bool stage_thread_pinning = thread_pinning.size() ? thread_pinning[s] : false;\nconst std::vector<size_t> stage_puids = puids.size() ? puids[s] : std::vector<size_t>();\n@@ -348,7 +348,7 @@ void Pipeline\nthis->stages[s].reset(create_sequence<TA>(stage_firsts,\nstage_lasts,\n- stage_exceptions,\n+ stage_exclusions,\nstage_n_threads,\nstage_thread_pinning,\nstage_puids,\n@@ -445,12 +445,10 @@ void Pipeline\n// for (size_t t = 0; t < tasks_per_threads.size(); t++)\n{\n// for all the tasks in the stage\n- // for (auto &tsk : tasks_per_threads[t])\nfor (size_t tsk_id = 0; tsk_id < tasks_per_threads[t].size(); tsk_id++)\n{\nauto tsk = tasks_per_threads[t][tsk_id];\n// for all the sockets of the tasks\n- // for (auto sck : tsk->sockets)\nfor (size_t sck_id = 0; sck_id < tsk->sockets.size(); sck_id++)\n{\nauto sck = tsk->sockets[sck_id];\n@@ -650,7 +648,6 @@ void Pipeline\nadp_active_waiting,\nadp_n_frames);\n- // size_t last_task_id = 0;\nfor (size_t t = 0; t < n_threads; t++)\n{\nmodule::Adaptor* cur_adp = (t == 0) ? adp : adp->clone();\n"
},
{
"change_type": "MODIFY",
"old_path": "src/Tools/Sequence/Sequence.cpp",
"new_path": "src/Tools/Sequence/Sequence.cpp",
"diff": "@@ -26,7 +26,7 @@ using namespace aff3ct::tools;\nSequence\n::Sequence(const std::vector<const module::Task*> &firsts,\nconst std::vector<const module::Task*> &lasts,\n- const std::vector<const module::Task*> &exceptions,\n+ const std::vector<const module::Task*> &exclusions,\nconst size_t n_threads,\nconst bool thread_pinning,\nconst std::vector<size_t> &puids)\n@@ -40,7 +40,7 @@ Sequence\nthread_pinning(thread_pinning),\npuids(puids),\nno_copy_mode(true),\n- saved_exceptions(exceptions)\n+ saved_exclusions(exclusions)\n{\n#ifndef AFF3CT_HWLOC\nif (thread_pinning)\n@@ -56,7 +56,7 @@ Sequence\nthrow tools::invalid_argument(__FILE__, __LINE__, __func__, message.str());\n}\n- this->init<tools::Sub_sequence_const,const module::Task>(firsts, lasts, exceptions);\n+ this->init<tools::Sub_sequence_const,const module::Task>(firsts, lasts, exclusions);\n}\nSequence\n@@ -97,18 +97,18 @@ Sequence\n{\n}\n-std::vector<const module::Task*> exceptions_convert_to_const(const std::vector<module::Task*> &exceptions)\n+std::vector<const module::Task*> exclusions_convert_to_const(const std::vector<module::Task*> &exclusions)\n{\n- std::vector<const module::Task*> exceptions_const;\n- for (auto exception : exceptions)\n- exceptions_const.push_back(exception);\n- return exceptions_const;\n+ std::vector<const module::Task*> exclusions_const;\n+ for (auto exception : exclusions)\n+ exclusions_const.push_back(exception);\n+ return exclusions_const;\n}\nSequence\n::Sequence(const std::vector<module::Task*> &firsts,\nconst std::vector<module::Task*> &lasts,\n- const std::vector<module::Task*> &exceptions,\n+ const std::vector<module::Task*> &exclusions,\nconst size_t n_threads,\nconst bool thread_pinning,\nconst std::vector<size_t> &puids,\n@@ -123,7 +123,7 @@ Sequence\nthread_pinning(thread_pinning),\npuids(puids),\nno_copy_mode(true),\n- saved_exceptions(exceptions_convert_to_const(exceptions))\n+ saved_exclusions(exclusions_convert_to_const(exclusions))\n{\nif (thread_pinning && puids.size() < n_threads)\n{\n@@ -134,16 +134,16 @@ Sequence\n}\nif (tasks_inplace)\n- this->init<tools::Sub_sequence,module::Task>(firsts, lasts, exceptions);\n+ this->init<tools::Sub_sequence,module::Task>(firsts, lasts, exclusions);\nelse\n{\nstd::vector<const module::Task*> firsts_bis;\nfor (auto first : firsts) firsts_bis.push_back(first);\nstd::vector<const module::Task*> lasts_bis;\nfor (auto last : lasts) lasts_bis.push_back(last);\n- std::vector<const module::Task*> exceptions_bis;\n- for (auto exception : exceptions) exceptions_bis.push_back(exception);\n- this->init<tools::Sub_sequence_const,const module::Task>(firsts_bis, lasts_bis, exceptions_bis);\n+ std::vector<const module::Task*> exclusions_bis;\n+ for (auto exception : exclusions) exclusions_bis.push_back(exception);\n+ this->init<tools::Sub_sequence_const,const module::Task>(firsts_bis, lasts_bis, exclusions_bis);\n}\n}\n@@ -198,7 +198,7 @@ Sequence\ntemplate <class SS, class TA>\nvoid Sequence\n-::init(const std::vector<TA*> &firsts, const std::vector<TA*> &lasts, const std::vector<TA*> &exceptions)\n+::init(const std::vector<TA*> &firsts, const std::vector<TA*> &lasts, const std::vector<TA*> &exclusions)\n{\nif (this->is_thread_pinning())\nThread_pinning::pin(this->puids[0]);\n@@ -217,23 +217,23 @@ void Sequence\nthrow tools::invalid_argument(__FILE__, __LINE__, __func__, message.str());\n}\n- for (auto exception : exceptions)\n+ for (auto exclusion : exclusions)\n{\n- if (std::find(firsts.begin(), firsts.end(), exception) != firsts.end())\n+ if (std::find(firsts.begin(), firsts.end(), exclusion) != firsts.end())\n{\nstd::stringstream message;\n- message << \"'exception' can't be contained in the 'firsts' vector (\"\n- << \"'exception'\" << \" = \" << +exception << \", \"\n- << \"'exception->get_name()'\" << \" = \" << exception->get_name() << \").\";\n+ message << \"'exclusion' can't be contained in the 'firsts' vector (\"\n+ << \"'exclusion'\" << \" = \" << +exclusion << \", \"\n+ << \"'exclusion->get_name()'\" << \" = \" << exclusion->get_name() << \").\";\nthrow tools::invalid_argument(__FILE__, __LINE__, __func__, message.str());\n}\n- if (std::find(lasts.begin(), lasts.end(), exception) != lasts.end())\n+ if (std::find(lasts.begin(), lasts.end(), exclusion) != lasts.end())\n{\nstd::stringstream message;\n- message << \"'exception' can't be contained in the 'lasts' vector (\"\n- << \"'exception'\" << \" = \" << +exception << \", \"\n- << \"'exception->get_name()'\" << \" = \" << exception->get_name() << \").\";\n+ message << \"'exclusion' can't be contained in the 'lasts' vector (\"\n+ << \"'exclusion'\" << \" = \" << +exclusion << \", \"\n+ << \"'exclusion->get_name()'\" << \" = \" << exclusion->get_name() << \").\";\nthrow tools::invalid_argument(__FILE__, __LINE__, __func__, message.str());\n}\n}\n@@ -258,7 +258,7 @@ void Sequence\n*first,\n*first,\nlasts,\n- exceptions,\n+ exclusions,\nthis->lasts_tasks_id,\nreal_lasts);\n}\n@@ -304,7 +304,7 @@ Sequence* Sequence\nfor (auto ta : this->get_lasts_tasks()[0])\nlasts_tasks.push_back(ta);\n- c->init<tools::Sub_sequence_const,const module::Task>(firsts_tasks, lasts_tasks, this->saved_exceptions);\n+ c->init<tools::Sub_sequence_const,const module::Task>(firsts_tasks, lasts_tasks, this->saved_exclusions);\nc->mtx_exception.reset(new std::mutex());\nc->force_exit_loop.reset(new std::atomic<bool>(false));\nreturn c;\n@@ -668,7 +668,7 @@ Generic_node<SS>* Sequence\nTA &first,\nTA ¤t_task,\nconst std::vector<TA*> &lasts,\n- const std::vector<TA*> &exceptions,\n+ const std::vector<TA*> &exclusions,\nstd::vector<size_t> &real_lasts_id,\nstd::vector<TA*> &real_lasts)\n{\n@@ -731,7 +731,7 @@ Generic_node<SS>* Sequence\n{\nnode_loop_son0->get_c()->id = ssid++;\nauto &t = loop->tasks[0]->sockets[2]->get_bound_sockets()[0]->get_task();\n- Sequence::init_recursive<SS,TA>(node_loop_son0, ssid, taid, loops, first, t, lasts, exceptions,\n+ Sequence::init_recursive<SS,TA>(node_loop_son0, ssid, taid, loops, first, t, lasts, exclusions,\nreal_lasts_id, real_lasts);\n}\nelse\n@@ -747,7 +747,7 @@ Generic_node<SS>* Sequence\n{\nnode_loop_son1->get_c()->id = ssid++;\nauto &t = loop->tasks[0]->sockets[3]->get_bound_sockets()[0]->get_task();\n- return Sequence::init_recursive<SS,TA>(node_loop_son1, ssid, taid, loops, first, t, lasts, exceptions,\n+ return Sequence::init_recursive<SS,TA>(node_loop_son1, ssid, taid, loops, first, t, lasts, exclusions,\nreal_lasts_id, real_lasts);\n}\nelse\n@@ -783,13 +783,13 @@ Generic_node<SS>* Sequence\nif (bs != nullptr)\n{\nauto &t = bs->get_task();\n- if (std::find(exceptions.begin(), exceptions.end(), &t) == exceptions.end())\n+ if (std::find(exclusions.begin(), exclusions.end(), &t) == exclusions.end())\n{\nif (t.is_last_input_socket(*bs) || dynamic_cast<const module::Loop*>(&t.get_module()))\n{\nis_last = false;\nlast_subseq = Sequence::init_recursive<SS,TA>(cur_subseq, ssid, taid, loops, first,\n- t, lasts, exceptions, real_lasts_id,\n+ t, lasts, exclusions, real_lasts_id,\nreal_lasts);\n}\n}\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
Rename 'exceptions' in 'exclusions'.
|
8,490 |
14.03.2020 10:21:59
| -3,600 |
2316e187a7b6c600957c48a84f5cd28ebbad0c79
|
Hack the false negative cppcheck error.
|
[
{
"change_type": "MODIFY",
"old_path": ".gitlab-ci.yml",
"new_path": ".gitlab-ci.yml",
"diff": "@@ -16,7 +16,7 @@ before_script:\nanalysis-cppcheck:\nstage: analysis\n- allow_failure: true\n+ allow_failure: false\nexcept:\n- schedules\nartifacts:\n"
},
{
"change_type": "MODIFY",
"old_path": "ci/analysis-cppcheck.sh",
"new_path": "ci/analysis-cppcheck.sh",
"diff": "@@ -21,7 +21,7 @@ cat cppcheck/cppcheck_all.log | grep \"(missingInclude)\" > cppcheck/cppcheck_miss\nCOUNT=$(wc -l < cppcheck/cppcheck_error.log )\n-if [ $COUNT -gt 0 ]; then\n+if [ $COUNT -gt 1 ]; then\necho \"Error count is $COUNT! cppcheck run failed :-(.\";\necho \"\"\necho \"Errors list:\"\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
Hack the false negative cppcheck error.
|
8,490 |
14.03.2020 10:35:59
| -3,600 |
e3847c23c88aa3265034fdcc3fd25bd68d7e2d43
|
Dump .dot ref sequence and pipeline when they are not equivalent.
|
[
{
"change_type": "MODIFY",
"old_path": "src/Tools/Sequence/Pipeline.cpp",
"new_path": "src/Tools/Sequence/Pipeline.cpp",
"diff": "@@ -361,6 +361,11 @@ void Pipeline\nif (ref_tasks.size() != cur_tasks.size())\n{\n+ std::ofstream f1(\"dbg_ref_sequence.dot\");\n+ this->original_sequence.export_dot(f1);\n+ std::ofstream f2(\"dbg_cur_pipeline.dot\");\n+ this->export_dot(f2);\n+\nstd::stringstream message;\nmessage << \"'ref_tasks.size()' has to be equal to 'cur_tasks.size()' ('ref_tasks.size()' = \"\n<< ref_tasks.size() << \", 'cur_tasks.size()' = \" << cur_tasks.size() << \").\";\n@@ -371,6 +376,11 @@ void Pipeline\n{\nif (std::find(ref_tasks.begin(), ref_tasks.end(), cur_tasks[ta]) == ref_tasks.end())\n{\n+ std::ofstream f1(\"dbg_ref_sequence.dot\");\n+ this->original_sequence.export_dot(f1);\n+ std::ofstream f2(\"dbg_cur_pipeline.dot\");\n+ this->export_dot(f2);\n+\nstd::stringstream message;\nmessage << \"'cur_tasks[ta]' is not contained in the 'ref_tasks' vector ('ta' = \" << ta\n<< \", 'cur_tasks[ta]' = \" << +cur_tasks[ta]\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
Dump .dot ref sequence and pipeline when they are not equivalent.
|
8,490 |
15.03.2020 10:53:40
| -3,600 |
8fdeaf9500d3a636c95571b00591c34ffae3eda6
|
CI: display the false positive error of cppcheck.
|
[
{
"change_type": "MODIFY",
"old_path": "ci/analysis-cppcheck.sh",
"new_path": "ci/analysis-cppcheck.sh",
"diff": "@@ -27,6 +27,11 @@ if [ $COUNT -gt 1 ]; then\necho \"Errors list:\"\ncat cppcheck/cppcheck_error.log\nexit 1;\n+elif [ $COUNT -gt 0 ]; then\n+ echo \"There is one false positive error.\";\n+ echo \"\"\n+ echo \"Errors list:\"\n+ cat cppcheck/cppcheck_error.log\nelse\necho \"There is no error :-).\"\nfi\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
CI: display the false positive error of cppcheck.
|
8,490 |
15.03.2020 10:54:27
| -3,600 |
e41502aa4c4c24ab816dca33cc1d8f0963e03b44
|
Rm the 'status' output socket in SystemC/TLM interface.
|
[
{
"change_type": "MODIFY",
"old_path": "src/Module/SC_Module.cpp",
"new_path": "src/Module/SC_Module.cpp",
"diff": "@@ -61,12 +61,15 @@ SC_Module\nbreak;\ncase socket_t::SOUT:\n+ if (name != \"status\")\n+ {\nindirect_sockets_out[i] = id_out;\nindirect_sockets_out_rev.push_back(i);\nsockets_out.push_back(std::unique_ptr<tlm_utils::simple_initiator_socket<SC_Module>>(\nnew tlm_utils::simple_initiator_socket<SC_Module>(name.c_str())));\nif (!is_inputs)\nSC_THREAD(start_sc_thread);\n+ }\nbreak;\ncase socket_t::SIN_SOUT:\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
Rm the 'status' output socket in SystemC/TLM interface.
|
8,490 |
15.03.2020 12:01:45
| -3,600 |
a785073beff15a92e76eeb1d77e62abac642866d
|
Add the possibility to disable headers in dumpers.
|
[
{
"change_type": "MODIFY",
"old_path": "include/Tools/Display/Dumper/Dumper.hpp",
"new_path": "include/Tools/Display/Dumper/Dumper.hpp",
"diff": "@@ -36,6 +36,7 @@ protected:\nstd::vector<bool> registered_data_bin;\nstd::vector<std::vector<unsigned>> registered_data_head;\nstd::vector<unsigned> registered_data_n_frames;\n+ bool write_headers;\npublic:\nDumper(/*const int n_frames = 1*/);\n@@ -54,6 +55,8 @@ public:\nvirtual void add (const unsigned n_err, const int frame_id = 0);\nvirtual void clear( );\n+ void set_write_headers(const bool write_headers);\n+\nprotected:\nvoid write_header_text(std::ofstream &file, const unsigned n_data, const unsigned data_size,\nconst std::vector<unsigned> &headers);\n"
},
{
"change_type": "MODIFY",
"old_path": "src/Tools/Display/Dumper/Dumper.cpp",
"new_path": "src/Tools/Display/Dumper/Dumper.cpp",
"diff": "@@ -13,10 +13,16 @@ const std::string aff3ct::tools::Dumper::default_ext = \"dump\";\nDumper\n::Dumper()\n-: add_threshold(0)\n+: add_threshold(0), write_headers(true)\n{\n}\n+void Dumper\n+::set_write_headers(const bool write_headers)\n+{\n+ this->write_headers = write_headers;\n+}\n+\ntemplate <typename T>\nvoid Dumper\n::register_data(const T *ptr, const unsigned size, const unsigned add_threshold, const std::string &file_ext,\n@@ -124,6 +130,7 @@ void Dumper\n{\nfile.open(path, std::ofstream::out | std::ios_base::binary);\n+ if (this->write_headers)\nthis->write_header_binary(file, (unsigned)this->buffer[i].size(), size, head);\nthis->write_body_binary(file, this->buffer[i], size * size_of);\n}\n@@ -131,6 +138,7 @@ void Dumper\n{\nfile.open(path, std::ofstream::out);\n+ if (this->write_headers)\nthis->write_header_text(file, (unsigned)this->buffer[i].size(), size, head);\nthis->write_body_text(file, this->buffer[i], size, type);\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "src/Tools/Display/Dumper/Dumper_reduction.cpp",
"new_path": "src/Tools/Display/Dumper/Dumper_reduction.cpp",
"diff": "@@ -164,6 +164,7 @@ void Dumper_reduction\n{\nfile.open(path, std::ofstream::out | std::ios_base::binary);\n+ if (this->write_headers)\nthis->write_header_binary(file, n_data, size, head);\nthis->write_body_binary(file, this->buffer[i], size * size_of);\nfor (auto& d : this->dumpers)\n@@ -173,6 +174,7 @@ void Dumper_reduction\n{\nfile.open(path, std::ofstream::out);\n+ if (this->write_headers)\nthis->write_header_text(file, n_data, size, head);\nthis->write_body_text(file, this->buffer[i], size, type);\nfor (auto& d : this->dumpers)\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
Add the possibility to disable headers in dumpers.
|
8,490 |
16.03.2020 16:36:15
| -3,600 |
b1bc87a9b7db2c4809beeba279c86f70aa668fd6
|
Put the 'tools::Nodes_parser' structure in public headers.
|
[
{
"change_type": "RENAME",
"old_path": "src/Tools/Code/Polar/Nodes_parser.h",
"new_path": "include/Tools/Code/Polar/Nodes_parser.hpp",
"diff": "+/*!\n+ * \\file\n+ * \\brief Struct tools::Nodes_parser.\n+ */\n#ifndef NODES_PARSER_HPP\n#define NODES_PARSER_HPP\n@@ -44,6 +48,8 @@ public:\n}\n}\n+#ifndef DOXYGEN_SHOULD_SKIP_THIS\n#include \"Tools/Code/Polar/Nodes_parser.hxx\"\n+#endif\n#endif /* NODES_PARSER_HPP */\n"
},
{
"change_type": "RENAME",
"old_path": "src/Tools/Code/Polar/Nodes_parser.hxx",
"new_path": "include/Tools/Code/Polar/Nodes_parser.hxx",
"diff": "#include \"Tools/Display/rang_format/rang_format.h\"\n#include \"Tools/general_utils.h\"\n-#include \"Tools/Code/Polar/Nodes_parser.h\"\n+#include \"Tools/Code/Polar/Nodes_parser.hpp\"\nnamespace aff3ct\n{\n"
},
{
"change_type": "MODIFY",
"old_path": "include/aff3ct.hpp",
"new_path": "include/aff3ct.hpp",
"diff": "#ifndef FROZENBITS_GENERATOR_TV_HPP_\n#include <Tools/Code/Polar/Frozenbits_generator/Frozenbits_generator_TV.hpp>\n#endif\n+#ifndef NODES_PARSER_HPP\n+#include <Tools/Code/Polar/Nodes_parser.hpp>\n+#endif\n#ifndef PATTERN_POLAR_PARSER_HPP\n#include <Tools/Code/Polar/Pattern_polar_parser.hpp>\n#endif\n"
},
{
"change_type": "MODIFY",
"old_path": "src/Factory/Module/Decoder/Polar/Decoder_polar.cpp",
"new_path": "src/Factory/Module/Decoder/Polar/Decoder_polar.cpp",
"diff": "#include \"Tools/Code/Polar/API/API_polar_static_intra_16bit.hpp\"\n#include \"Tools/Code/Polar/API/API_polar_static_intra_32bit.hpp\"\n#endif\n-#include \"Tools/Code/Polar/Nodes_parser.h\"\n+#include \"Tools/Code/Polar/Nodes_parser.hpp\"\n#include \"Factory/Module/Decoder/Polar/Decoder_polar.hpp\"\nusing namespace aff3ct;\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
Put the 'tools::Nodes_parser' structure in public headers.
|
8,490 |
17.03.2020 19:12:32
| -3,600 |
b6424f409383ad082a309d39746c8fc06f04824a
|
Add the reset interface to the reporters.
|
[
{
"change_type": "MODIFY",
"old_path": "include/Tools/Display/Reporter/Probe/Reporter_probe.hpp",
"new_path": "include/Tools/Display/Reporter/Probe/Reporter_probe.hpp",
"diff": "@@ -100,6 +100,8 @@ public:\nvirtual void probe(const std::string &name, const void *data, const int frame_id);\n+ virtual void reset();\n+\nprotected:\nvoid create_probe_checks(const std::string &name);\n"
},
{
"change_type": "MODIFY",
"old_path": "include/Tools/Display/Reporter/Reporter.hpp",
"new_path": "include/Tools/Display/Reporter/Reporter.hpp",
"diff": "#include <utility>\n#include <string>\n+#include \"Tools/Interface/Interface_reset.hpp\"\n+\nnamespace aff3ct\n{\nnamespace tools\n{\n-class Reporter\n+class Reporter : public Interface_reset\n{\npublic:\nusing title_t = std::pair<std::string, std::string>;\n@@ -38,6 +40,8 @@ public:\nvirtual report_t report(bool final = false) = 0;\nvirtual void init(); // do nothing by default\n+\n+ virtual void reset();\n};\n}\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "include/Tools/Display/Terminal/Standard/Terminal_std.hpp",
"new_path": "include/Tools/Display/Terminal/Standard/Terminal_std.hpp",
"diff": "@@ -62,6 +62,8 @@ public:\n*/\nvoid legend(std::ostream &stream = std::cout) const;\n+ std::vector<tools::Reporter*>& get_reporters();\n+\nprotected:\nvirtual void report(std::ostream &stream = std::cout, bool final = false);\n"
},
{
"change_type": "MODIFY",
"old_path": "src/Tools/Display/Reporter/Probe/Reporter_probe.cpp",
"new_path": "src/Tools/Display/Reporter/Probe/Reporter_probe.cpp",
"diff": "@@ -62,6 +62,13 @@ void Reporter_probe\n}\n}\n+void Reporter_probe\n+::reset()\n+{\n+ std::fill(this->head.begin(), this->head.end(), 0);\n+ std::fill(this->tail.begin(), this->tail.end(), 0);\n+}\n+\ntemplate <typename T>\nbool Reporter_probe\n::format_values(const int col, std::stringstream &temp_stream)\n"
},
{
"change_type": "MODIFY",
"old_path": "src/Tools/Display/Reporter/Reporter.cpp",
"new_path": "src/Tools/Display/Reporter/Reporter.cpp",
"diff": "@@ -13,3 +13,8 @@ const std::vector<Reporter::group_t>& Reporter\n{\nreturn this->cols_groups;\n}\n+\n+void Reporter\n+::reset()\n+{\n+}\n\\ No newline at end of file\n"
},
{
"change_type": "MODIFY",
"old_path": "src/Tools/Display/Terminal/Standard/Terminal_std.cpp",
"new_path": "src/Tools/Display/Terminal/Standard/Terminal_std.cpp",
"diff": "@@ -40,6 +40,12 @@ Terminal_std\nthis->reporters.push_back(r.get());\n}\n+std::vector<tools::Reporter*>& Terminal_std\n+::get_reporters()\n+{\n+ return this->reporters;\n+}\n+\nvoid Terminal_std\n::legend(std::ostream &stream) const\n{\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
Add the reset interface to the reporters.
|
8,490 |
17.03.2020 19:12:54
| -3,600 |
7bfd86e81844ef379a06d16b4c14a58bb48e45ed
|
Reset adaptors after an execution.
|
[
{
"change_type": "MODIFY",
"old_path": "src/Tools/Sequence/Pipeline.cpp",
"new_path": "src/Tools/Sequence/Pipeline.cpp",
"diff": "@@ -926,6 +926,14 @@ void Pipeline\nfor (auto &t : threads)\nt.join();\n+\n+ for (auto &padps : this->adaptors)\n+ {\n+ for (auto &adp : padps.first)\n+ adp->reset();\n+ for (auto &adp : padps.second)\n+ adp->reset();\n+ }\n}\nvoid Pipeline\n@@ -970,6 +978,14 @@ void Pipeline\nfor (auto &t : threads)\nt.join();\n+\n+ for (auto &padps : this->adaptors)\n+ {\n+ for (auto &adp : padps.first)\n+ adp->reset();\n+ for (auto &adp : padps.second)\n+ adp->reset();\n+ }\n}\nvoid Pipeline\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
Reset adaptors after an execution.
|
8,490 |
19.03.2020 11:56:53
| -3,600 |
10924be4401948bd803d6220f11975fcd3fd5dae
|
Fix the bind position bug in the pipeline.
|
[
{
"change_type": "MODIFY",
"old_path": "src/Tools/Sequence/Pipeline.cpp",
"new_path": "src/Tools/Sequence/Pipeline.cpp",
"diff": "@@ -493,7 +493,7 @@ void Pipeline\nauto unbind_sout_pos = std::distance(sck_out->get_bound_sockets().begin(),\nstd::find(sck_out->get_bound_sockets().begin(),\nsck_out->get_bound_sockets().end(),\n- sck_in)) -1;\n+ sck_in));\nthis->sck_orphan_binds.push_back(std::make_pair(\nstd::make_tuple(std::get<0>(out_sck_orphans[pos]),\nstd::get<2>(out_sck_orphans[pos]),\n@@ -535,6 +535,7 @@ void Pipeline\n// auto tsk_out_sta = std::get<1>(bind.first);\n// auto tsk_out_id = std::get<2>(bind.first);\n// auto sck_out_id = std::get<3>(bind.first);\n+ // auto sck_out_ubp = std::get<4>(bind.first);\n// auto sck_in_name = std::get<0>(bind.second)->get_name();\n// auto tsk_in_name = std::get<0>(bind.second)->get_task().get_name();\n@@ -543,7 +544,7 @@ void Pipeline\n// auto sck_in_id = std::get<3>(bind.second);\n// std::cout << \" \" << tsk_out_name << \"[\" << sck_out_name << \"] (stage \" << tsk_out_sta << \", tsk id = \"\n- // << tsk_out_id << \", sck id = \" << sck_out_id << \")\" << \" -> \"\n+ // << tsk_out_id << \", sck id = \" << sck_out_id << \", ubp = \" << sck_out_ubp << \")\" << \" -> \"\n// << tsk_in_name << \"[\" << sck_in_name << \"] (stage \" << tsk_in_sta << \", tsk id = \"\n// << tsk_in_id << \", sck id = \" << sck_in_id << \")\" << std::endl;\n// }\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
Fix the bind position bug in the pipeline.
|
8,490 |
19.03.2020 13:09:45
| -3,600 |
6bfa2517f4b5b1b6fa6c9e5b185d3b8c5740db39
|
Fix return unbind position in the socket.
|
[
{
"change_type": "MODIFY",
"old_path": "include/Module/Socket.hxx",
"new_path": "include/Module/Socket.hxx",
"diff": "@@ -350,7 +350,7 @@ size_t Socket\nauto it = std::find(s_out.bound_sockets.begin(), s_out.bound_sockets.end(), this);\nif (it != s_out.bound_sockets.end())\n{\n- unbind_pos = (int)std::distance(s_out.bound_sockets.begin(), it) -1;\n+ unbind_pos = (size_t)std::distance(s_out.bound_sockets.begin(), it);\ns_out.bound_sockets.erase(it);\n}\nelse\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
Fix return unbind position in the socket.
|
8,490 |
21.03.2020 13:26:35
| -3,600 |
49318c26ee28f1f52e46546c5cb1582e2af068ca
|
Improve the reset method of the socket by calling unbind.
|
[
{
"change_type": "MODIFY",
"old_path": "include/Module/Socket.hxx",
"new_path": "include/Module/Socket.hxx",
"diff": "@@ -300,9 +300,10 @@ void Socket\nvoid Socket\n::reset()\n{\n- // this->dataptr = nullptr;\n- this->bound_sockets.clear();\n- this->bound_socket = nullptr;\n+ if (this->bound_socket != nullptr)\n+ this->unbind(*this->bound_socket);\n+ for (auto socket : this->bound_sockets)\n+ socket->unbind(*this);\n}\nsize_t Socket\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
Improve the reset method of the socket by calling unbind.
|
8,490 |
20.04.2020 16:19:29
| -7,200 |
0faf620dc850683504400aea2cf1ccef61120f08
|
Change year from 2019 to 2020.
|
[
{
"change_type": "MODIFY",
"old_path": "doc/source/conf.py",
"new_path": "doc/source/conf.py",
"diff": "@@ -36,7 +36,7 @@ if (read_the_docs_build):\n# -- Project information -----------------------------------------------------\nproject = 'AFF3CT'\n-copyright = '2019, AFF3CT team'\n+copyright = '2020, AFF3CT team'\nauthor = 'AFF3CT team'\n# get the AFF3CT version from Git\n"
},
{
"change_type": "MODIFY",
"old_path": "src/main.cpp",
"new_path": "src/main.cpp",
"diff": "@@ -148,7 +148,7 @@ void print_version()\nstd::cout << \" - GSL: \" << gsl << std::endl;\nstd::cout << \" - MKL: \" << mkl << std::endl;\nstd::cout << \" - SystemC: \" << systemc << std::endl;\n- std::cout << \"Copyright (c) 2016-2019 - MIT license.\" << std::endl;\n+ std::cout << \"Copyright (c) 2016-2020 - MIT license.\" << std::endl;\nstd::cout << \"This is free software; see the source for copying conditions. There is NO\" << std::endl;\nstd::cout << \"warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\" << std::endl;\nexit(EXIT_SUCCESS);\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
Change year from 2019 to 2020.
|
8,489 |
12.06.2020 11:27:41
| -7,200 |
4fdaa13fda1e7909c1fb768f9a4e8323c287eec7
|
Add new codes rates and code length to DVB RCS2.
|
[
{
"change_type": "MODIFY",
"old_path": "src/Module/Puncturer/Turbo_DB/Puncturer_turbo_DB.cpp",
"new_path": "src/Module/Puncturer/Turbo_DB/Puncturer_turbo_DB.cpp",
"diff": "@@ -20,14 +20,17 @@ Puncturer_turbo_DB<B,Q>\nfloat rate = (float)K / (float)N;\nif (std::round(100.0 * rate) == std::round(100 * 2.0 / 5.0)) coderate = \"2/5\";\n+ else if (std::round(100.0 * rate) == std::round(100 * 1.0 / 3.0)) coderate = \"1/3\";\nelse if (std::round(100.0 * rate) == std::round(100 * 1.0 / 2.0)) coderate = \"1/2\";\nelse if (std::round(100.0 * rate) == std::round(100 * 2.0 / 3.0)) coderate = \"2/3\";\n+ else if (std::round(100.0 * rate) == std::round(100 * 3.0 / 4.0)) coderate = \"3/4\";\nelse if (std::round(100.0 * rate) == std::round(100 * 4.0 / 5.0)) coderate = \"4/5\";\n+ else if (std::round(100.0 * rate) == std::round(100 * 5.0 / 6.0)) coderate = \"5/6\";\nelse\n{\nstd::stringstream message;\nmessage << \"Unsupported code rate 'R' = 'K' / 'N' ('R' = \" << rate << \", 'K' = \" << K << \", 'N' = \"\n- << N << \"), supported code rates are 2/5, 1/2, 2/3 and 4/5.\";\n+ << N << \"), supported code rates are 2/5, 1/2, 2/3, 3/4, 4/5 and 5/6.\";\nthrow tools::invalid_argument(__FILE__, __LINE__, __func__, message.str());\n}\n}\n@@ -49,6 +52,10 @@ void Puncturer_turbo_DB<B,Q>\n{\nstd::copy(X_N1, X_N1 + 2 * this->K, X_N2);\n}\n+ else if (coderate == \"1/3\")// all the AB, all the Y1Y2, all the W1W2\n+ {\n+ std::copy(X_N1, X_N1 + 3 * this->K, X_N2);\n+ }\nelse if (coderate == \"2/5\")// all the AB, all the Y1Y2 , one W1W2 over two\n{\nstd::copy(X_N1, X_N1 + 2 * this->K, X_N2);\n@@ -69,6 +76,18 @@ void Puncturer_turbo_DB<B,Q>\nX_N2[j++] = X_N1[this->K + i + 1];\n}\n}\n+ else if (coderate == \"3/4\") // all the AB, two Y1Y2 over six : [101000]\n+ {\n+ std::copy(X_N1, X_N1 + this->K, X_N2);\n+ auto j = this->K;\n+ for(auto i = 0; i < this->K; i+=12)\n+ {\n+ X_N2[j++] = X_N1[this->K + i ];\n+ X_N2[j++] = X_N1[this->K + i + 1];\n+ X_N2[j++] = X_N1[this->K + i + 4];\n+ X_N2[j++] = X_N1[this->K + i + 5];\n+ }\n+ }\nelse if (coderate == \"4/5\") // all the AB, one Y1Y2 over four\n{\nstd::copy(X_N1, X_N1 + this->K, X_N2);\n@@ -79,6 +98,22 @@ void Puncturer_turbo_DB<B,Q>\nX_N2[j++] = X_N1[this->K + i + 1];\n}\n}\n+ else if (coderate == \"5/6\") // all the AB, four Y1Y2 over twenty : [10001000100010000000]\n+ {\n+ std::copy(X_N1, X_N1 + this->K, X_N2);\n+ auto j = this->K;\n+ for(auto i = 0; i < this->K; i+=40)\n+ {\n+ X_N2[j++] = X_N1[this->K + i ];\n+ X_N2[j++] = X_N1[this->K + i + 1];\n+ X_N2[j++] = X_N1[this->K + i + 8];\n+ X_N2[j++] = X_N1[this->K + i + 9];\n+ X_N2[j++] = X_N1[this->K + i + 16];\n+ X_N2[j++] = X_N1[this->K + i + 17];\n+ X_N2[j++] = X_N1[this->K + i + 24];\n+ X_N2[j++] = X_N1[this->K + i + 25];\n+ }\n+ }\n}\ntemplate <typename B, typename Q>\n@@ -90,6 +125,10 @@ void Puncturer_turbo_DB<B,Q>\nstd::copy(Y_N1 , Y_N1 + 2 * this->K, Y_N2);\nstd::fill(Y_N2 + 2 * this->K, Y_N2 + 3 * this->K, (Q)0);\n}\n+ else if (coderate == \"1/3\") // all the AB, all the Y1Y2, all the W1W2\n+ {\n+ std::copy(Y_N1 , Y_N1 + 3 * this->K, Y_N2);\n+ }\nelse if (coderate == \"2/5\")// all the AB, all the Y1Y2 , one W1W2 over two\n{\nstd::copy(Y_N1 , Y_N1 + 2 * this->K, Y_N2);\n@@ -112,6 +151,19 @@ void Puncturer_turbo_DB<B,Q>\nY_N2[this->K + i + 1] = Y_N1[j++];\n}\n}\n+ else if (coderate == \"3/4\") // all the AB, two Y1Y2 over six : [101000]\n+ {\n+ std::copy(Y_N1 , Y_N1 + this->K, Y_N2);\n+ std::fill(Y_N2 + this->K, Y_N2 + 3 * this->K, (Q)0);\n+ auto j = this->K;\n+ for(auto i = 0; i < this->K; i+=12)\n+ {\n+ Y_N2[this->K + i ] = Y_N1[j++];\n+ Y_N2[this->K + i + 1] = Y_N1[j++];\n+ Y_N2[this->K + i + 4] = Y_N1[j++];\n+ Y_N2[this->K + i + 5] = Y_N1[j++];\n+ }\n+ }\nelse if (coderate == \"4/5\") // all the AB, one Y1Y2 over four\n{\nstd::copy(Y_N1 , Y_N1 + this->K, Y_N2);\n@@ -123,6 +175,23 @@ void Puncturer_turbo_DB<B,Q>\nY_N2[this->K + i + 1] = Y_N1[j++];\n}\n}\n+ else if (coderate == \"5/6\") // all the AB, four Y1Y2 over twenty : [10001000100010000000]\n+ {\n+ std::copy(Y_N1 , Y_N1 + this->K, Y_N2);\n+ std::fill(Y_N2 + this->K, Y_N2 + 3 * this->K, (Q)0);\n+ auto j = this->K;\n+ for(auto i = 0; i < this->K; i+=40)\n+ {\n+ Y_N2[this->K + i ] = Y_N1[j++];\n+ Y_N2[this->K + i + 1] = Y_N1[j++];\n+ Y_N2[this->K + i + 8] = Y_N1[j++];\n+ Y_N2[this->K + i + 9] = Y_N1[j++];\n+ Y_N2[this->K + i + 16] = Y_N1[j++];\n+ Y_N2[this->K + i + 17] = Y_N1[j++];\n+ Y_N2[this->K + i + 24] = Y_N1[j++];\n+ Y_N2[this->K + i + 25] = Y_N1[j++];\n+ }\n+ }\n}\n// ==================================================================================== explicit template instantiation\n"
},
{
"change_type": "MODIFY",
"old_path": "src/Tools/Interleaver/ARP/Interleaver_core_ARP_DVB_RCS2.cpp",
"new_path": "src/Tools/Interleaver/ARP/Interleaver_core_ARP_DVB_RCS2.cpp",
"diff": "@@ -13,7 +13,7 @@ Interleaver_core_ARP_DVB_RCS2<T>\n{\nswitch (size)\n{\n- case 56:\n+ case 56: // wfm 2\np = 9;\nq0 = 2;\nq1 = 2;\n@@ -27,7 +27,7 @@ Interleaver_core_ARP_DVB_RCS2<T>\nq2 = 8;\nq3 = 1;\nbreak;\n- case 152:\n+ case 152: // wfm 1, wfm 3\np = 17;\nq0 = 9;\nq1 = 5;\n@@ -48,6 +48,13 @@ Interleaver_core_ARP_DVB_RCS2<T>\nq2 = 2;\nq3 = 3;\nbreak;\n+ case 236:\n+ p = 23;\n+ q0 = 10;\n+ q1 = 2;\n+ q2 = 11;\n+ q3 = 1;\n+ break;\ncase 340:\np = 23;\nq0 = 6;\n@@ -83,6 +90,34 @@ Interleaver_core_ARP_DVB_RCS2<T>\nq2 = 8;\nq3 = 1;\nbreak;\n+ case 460: // wfm 8\n+ p = 29;\n+ q0 = 6;\n+ q1 = 5;\n+ q2 = 0;\n+ q3 = 0;\n+ break;\n+ case 492: // wfm 13\n+ p = 31;\n+ q0 = 0;\n+ q1 = 3;\n+ q2 = 1;\n+ q3 = 0;\n+ break;\n+ case 520: // wfm 9\n+ p = 31;\n+ q0 = 0;\n+ q1 = 1;\n+ q2 = 2;\n+ q3 = 0;\n+ break;\n+ case 576: // wfm 10\n+ p = 31;\n+ q0 = 0;\n+ q1 = 0;\n+ q2 = 0;\n+ q3 = 0;\n+ break;\ncase 652:\np = 107;\nq0 = 2;\n@@ -111,6 +146,13 @@ Interleaver_core_ARP_DVB_RCS2<T>\nq2 = 13;\nq3 = 5;\nbreak;\n+ case 1056: // wfm 15\n+ p = 43;\n+ q0 = 0;\n+ q1 = 0;\n+ q2 = 6;\n+ q3 = 2;\n+ break;\ncase 1192:\np = 49;\nq0 = 0;\n@@ -125,6 +167,13 @@ Interleaver_core_ARP_DVB_RCS2<T>\nq2 = 6;\nq3 = 2;\nbreak;\n+ case 1420:\n+ p = 53;\n+ q0 = 1;\n+ q1 = 4;\n+ q2 = 6;\n+ q3 = 2;\n+ break;\ncase 1504:\np = 53;\nq0 = 2;\n@@ -132,6 +181,13 @@ Interleaver_core_ARP_DVB_RCS2<T>\nq2 = 2;\nq3 = 2;\nbreak;\n+ case 1600:\n+ p = 53;\n+ q0 = 1;\n+ q1 = 10;\n+ q2 = 7;\n+ q3 = 1;\n+ break;\ncase 1752:\np = 59;\nq0 = 1;\n@@ -139,6 +195,13 @@ Interleaver_core_ARP_DVB_RCS2<T>\nq2 = 2;\nq3 = 1;\nbreak;\n+ case 1777:\n+ p = 59;\n+ q0 = 3;\n+ q1 = 8;\n+ q2 = 5;\n+ q3 = 1;\n+ break;\ndefault:\nstd::stringstream message;\nmessage << \"There is no ARP parameters for 'size' = \" << size << \" (supported sizes are 56, 64, 152, \"\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
Add new codes rates and code length to DVB RCS2.
|
8,488 |
22.09.2020 09:53:40
| -7,200 |
2c749cd40b2a6a8b487b13247eb0e94700612360
|
Add focal distrib.
|
[
{
"change_type": "MODIFY",
"old_path": ".gitlab-ci.yml",
"new_path": ".gitlab-ci.yml",
"diff": "@@ -1336,7 +1336,7 @@ deploy-upload-ppa:\nscript:\n- source ./ci/tools/git-branch.sh\n- source ./ci/tools/threads.sh\n- - export DISTRIBS=\"xenial;bionic\"\n+ - export DISTRIBS=\"xenial;bionic;focal\"\n- export CC=\"gcc\"\n- export CXX=\"g++\"\n- export CFLAGS=\"-Wall -funroll-loops -m64 -msse4.2\"\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
Add focal distrib.
|
8,488 |
23.09.2020 09:51:32
| -7,200 |
03ed0a606cc64fe1aa7ba1cfe7de83467ec61752
|
Doc: note on Ubuntu versions for apt packages.
|
[
{
"change_type": "MODIFY",
"old_path": "doc/source/user/installation/installation/installation.rst",
"new_path": "doc/source/user/installation/installation/installation.rst",
"diff": "@@ -95,6 +95,11 @@ Update package list and install:\n* The package ``libaff3ct-dev`` contains the ``include/`` folder and depends on the ``libaff3ct`` package.\n+.. note:: Only LTS releases of Ubuntu are officially supported, starting from\n+ 16.04. For other releases, you may try to use `the pinning method\n+ <https://help.ubuntu.com/community/PinningHowto>`_.\n+\n+\nContents\n--------\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
Doc: note on Ubuntu versions for apt packages.
|
8,488 |
23.09.2020 09:54:58
| -7,200 |
cd456238645ecc8a3479efb92e54981fd50aa3a4
|
Doc: Remove useless blank lines.
|
[
{
"change_type": "MODIFY",
"old_path": "doc/source/user/installation/installation/installation.rst",
"new_path": "doc/source/user/installation/installation/installation.rst",
"diff": "@@ -36,7 +36,6 @@ To install |AFF3CT|, call the `install` target on the current Makefile:\n.. note:: Depending on the chosen ``CMAKE_INSTALL_PREFIX`` location, the\nadministrator privileges (**sudo**) can be required.\n-\nVisual Studio Solution\n\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\n@@ -99,8 +98,6 @@ Update package list and install:\n16.04. For other releases, you may try to use `the pinning method\n<https://help.ubuntu.com/community/PinningHowto>`_.\n-\n-\nContents\n--------\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
Doc: Remove useless blank lines.
|
8,490 |
07.10.2020 16:44:53
| -7,200 |
9a8e7309353d883a7db2e2c01f5a5f6cab9d67f8
|
CI: fix the coverage script.
|
[
{
"change_type": "MODIFY",
"old_path": "ci/test-build-coverage-regression.sh",
"new_path": "ci/test-build-coverage-regression.sh",
"diff": "@@ -58,6 +58,8 @@ cd ${WD}\nmkdir code_coverage_files || true\nlcov --capture --directory $build_root/CMakeFiles/aff3ct-obj.dir/src --output-file code_coverage_files/aff3ct.info\nrc=$?; if [[ $rc != 0 ]]; then exit $rc; fi\n-lcov --remove code_coverage_files/aff3ct.info \"*/usr*\" \"*lib/*\" \"*/Tools/version.cpp\" --output-file ${WD}/code_coverage_files/aff3ct_clean.info\n+cp code_coverage_files/aff3ct.info code_coverage_files/aff3ct2.info\nrc=$?; if [[ $rc != 0 ]]; then exit $rc; fi\n-sed -i -e \"s#${WD}/#\\./#g\" code_coverage_files/aff3ct_clean.info\n+sed -i -e \"s#${WD}/#\\./#g\" code_coverage_files/aff3ct2.info\n+rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi\n+lcov --remove code_coverage_files/aff3ct2.info \"*/usr*\" \"*lib/*\" \"*/Tools/version.cpp\" --output-file ${WD}/code_coverage_files/aff3ct_clean.info\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
CI: fix the coverage script.
|
8,490 |
07.10.2020 18:20:01
| -7,200 |
7cf4180f847d4fd912aeb8f7b5c6243318d4cf68
|
CI: use new `needs` keyword to replace the pipeline by a DAG.
|
[
{
"change_type": "MODIFY",
"old_path": ".gitlab-ci.yml",
"new_path": ".gitlab-ci.yml",
"diff": "@@ -113,7 +113,11 @@ build-linux-gcc-nointr:\nGIT_SUBMODULE_STRATEGY: recursive\nexcept:\n- schedules\n- dependencies: []\n+ needs:\n+ - job: analysis-cppcheck\n+ artifacts: false\n+ - job: analysis-headers\n+ artifacts: false\ntags:\n- linux\n- gcc\n@@ -139,8 +143,13 @@ build-linux-gcc-x64-sse4.2:\nGIT_SUBMODULE_STRATEGY: recursive\nexcept:\n- schedules\n- dependencies:\n- - analysis-documentation\n+ needs:\n+ - job: analysis-cppcheck\n+ artifacts: false\n+ - job: analysis-headers\n+ artifacts: false\n+ - job: analysis-documentation\n+ artifacts: true\ntags:\n- linux\n- gcc\n@@ -165,8 +174,13 @@ build-linux-gcc-x64-avx2:\nstage: build\nvariables:\nGIT_SUBMODULE_STRATEGY: recursive\n- dependencies:\n- - analysis-documentation\n+ needs:\n+ - job: analysis-cppcheck\n+ artifacts: false\n+ - job: analysis-headers\n+ artifacts: false\n+ - job: analysis-documentation\n+ artifacts: true\ntags:\n- linux\n- gcc\n@@ -193,7 +207,11 @@ build-linux-gcc-8-bit:\nGIT_SUBMODULE_STRATEGY: recursive\nexcept:\n- schedules\n- dependencies: []\n+ needs:\n+ - job: analysis-cppcheck\n+ artifacts: false\n+ - job: analysis-headers\n+ artifacts: false\ntags:\n- linux\n- gcc\n@@ -219,7 +237,11 @@ build-linux-gcc-mpi:\nGIT_SUBMODULE_STRATEGY: recursive\nexcept:\n- schedules\n- dependencies: []\n+ needs:\n+ - job: analysis-cppcheck\n+ artifacts: false\n+ - job: analysis-headers\n+ artifacts: false\ntags:\n- linux\n- gcc\n@@ -245,7 +267,11 @@ build-linux-gcc-systemc:\nGIT_SUBMODULE_STRATEGY: recursive\nexcept:\n- schedules\n- dependencies: []\n+ needs:\n+ - job: analysis-cppcheck\n+ artifacts: false\n+ - job: analysis-headers\n+ artifacts: false\ntags:\n- linux\n- gcc\n@@ -272,7 +298,11 @@ build-linux-clang:\nGIT_SUBMODULE_STRATEGY: recursive\nexcept:\n- schedules\n- dependencies: []\n+ needs:\n+ - job: analysis-cppcheck\n+ artifacts: false\n+ - job: analysis-headers\n+ artifacts: false\ntags:\n- linux\n- clang\n@@ -297,7 +327,11 @@ build-linux-gcc-4.8:\nGIT_SUBMODULE_STRATEGY: recursive\nexcept:\n- schedules\n- dependencies: []\n+ needs:\n+ - job: analysis-cppcheck\n+ artifacts: false\n+ - job: analysis-headers\n+ artifacts: false\ntags:\n- linux\n- gcc-4.8\n@@ -322,7 +356,11 @@ build-linux-icpc:\nGIT_SUBMODULE_STRATEGY: recursive\nexcept:\n- schedules\n- dependencies: []\n+ needs:\n+ - job: analysis-cppcheck\n+ artifacts: false\n+ - job: analysis-headers\n+ artifacts: false\ntags:\n- linux\n- icpc\n@@ -350,8 +388,13 @@ build-windows-gcc-x86-sse4.2:\nGIT_SUBMODULE_STRATEGY: recursive\nexcept:\n- schedules\n- dependencies:\n- - analysis-documentation\n+ needs:\n+ - job: analysis-cppcheck\n+ artifacts: false\n+ - job: analysis-headers\n+ artifacts: false\n+ - job: analysis-documentation\n+ artifacts: true\ntags:\n- windows\n- gcc\n@@ -376,8 +419,13 @@ build-windows-gcc-x64-avx2:\nGIT_SUBMODULE_STRATEGY: recursive\nexcept:\n- schedules\n- dependencies:\n- - analysis-documentation\n+ needs:\n+ - job: analysis-cppcheck\n+ artifacts: false\n+ - job: analysis-headers\n+ artifacts: false\n+ - job: analysis-documentation\n+ artifacts: true\ntags:\n- windows\n- 64-bit\n@@ -402,7 +450,11 @@ build-windows-msvc-avx:\nGIT_SUBMODULE_STRATEGY: recursive\nexcept:\n- schedules\n- dependencies: []\n+ needs:\n+ - job: analysis-cppcheck\n+ artifacts: false\n+ - job: analysis-headers\n+ artifacts: false\ntags:\n- windows\n- msvc\n@@ -425,8 +477,13 @@ build-macos-clang-x64-sse4.2:\nGIT_SUBMODULE_STRATEGY: recursive\nexcept:\n- schedules\n- dependencies:\n- - analysis-documentation\n+ needs:\n+ - job: analysis-cppcheck\n+ artifacts: false\n+ - job: analysis-headers\n+ artifacts: false\n+ - job: analysis-documentation\n+ artifacts: true\ntags:\n- macos\n- apple-clang\n@@ -451,8 +508,9 @@ check-debug-parser:\nGIT_SUBMODULE_STRATEGY: recursive\nexcept:\n- schedules\n- dependencies:\n- - build-linux-gcc-x64-sse4.2\n+ needs:\n+ - job: build-linux-gcc-x64-sse4.2\n+ artifacts: true\ntags:\n- linux\n- x86\n@@ -475,8 +533,9 @@ check-documentation:\nstage: check\nexcept:\n- schedules\n- dependencies:\n- - build-linux-gcc-x64-sse4.2\n+ needs:\n+ - job: build-linux-gcc-x64-sse4.2\n+ artifacts: true\ntags:\n- linux\n- x86\n@@ -493,8 +552,9 @@ test-regression-bch:\nretry: 1\nexcept:\n- schedules\n- dependencies:\n- - build-linux-gcc-x64-sse4.2\n+ needs:\n+ - job: build-linux-gcc-x64-sse4.2\n+ artifacts: true\ntags:\n- linux\n- x86\n@@ -518,8 +578,9 @@ test-regression-bch:\n# GIT_SUBMODULE_STRATEGY: recursive\n# only:\n# - schedules\n-# dependencies:\n-# - build-linux-gcc-x64-avx2\n+# needs:\n+# - job: build-linux-gcc-x64-avx2\n+# artifacts: true\n# tags:\n# - linux\n# - x86\n@@ -546,8 +607,9 @@ test-regression-ldpc:\nretry: 1\nexcept:\n- schedules\n- dependencies:\n- - build-linux-gcc-x64-sse4.2\n+ needs:\n+ - job: build-linux-gcc-x64-sse4.2\n+ artifacts: true\ntags:\n- linux\n- x86\n@@ -572,8 +634,9 @@ test-regression-ldpc:\n# GIT_SUBMODULE_STRATEGY: recursive\n# only:\n# - schedules\n-# dependencies:\n-# - build-linux-gcc-x64-avx2\n+# needs:\n+# - job: build-linux-gcc-x64-avx2\n+# artifacts: true\n# tags:\n# - linux\n# - x86\n@@ -600,8 +663,9 @@ test-regression-polar:\nretry: 1\nexcept:\n- schedules\n- dependencies:\n- - build-linux-gcc-x64-sse4.2\n+ needs:\n+ - job: build-linux-gcc-x64-sse4.2\n+ artifacts: true\ntags:\n- linux\n- x86\n@@ -626,8 +690,9 @@ test-regression-polar:\n# GIT_SUBMODULE_STRATEGY: recursive\n# only:\n# - schedules\n-# dependencies:\n-# - build-linux-gcc-x64-avx2\n+# needs:\n+# - job: build-linux-gcc-x64-avx2\n+# artifacts: true\n# tags:\n# - linux\n# - x86\n@@ -654,8 +719,9 @@ test-regression-polar-mk:\nretry: 1\nexcept:\n- schedules\n- dependencies:\n- - build-linux-gcc-x64-sse4.2\n+ needs:\n+ - job: build-linux-gcc-x64-sse4.2\n+ artifacts: true\ntags:\n- linux\n- x86\n@@ -680,8 +746,9 @@ test-regression-polar-mk:\n# GIT_SUBMODULE_STRATEGY: recursive\n# only:\n# - schedules\n-# dependencies:\n-# - build-linux-gcc-x64-avx2\n+# needs:\n+# - job: build-linux-gcc-x64-avx2\n+# artifacts: true\n# tags:\n# - linux\n# - x86\n@@ -708,8 +775,9 @@ test-regression-ra:\nretry: 1\nexcept:\n- schedules\n- dependencies:\n- - build-linux-gcc-x64-sse4.2\n+ needs:\n+ - job: build-linux-gcc-x64-sse4.2\n+ artifacts: true\ntags:\n- linux\n- x86\n@@ -733,8 +801,9 @@ test-regression-ra:\n# GIT_SUBMODULE_STRATEGY: recursive\n# only:\n# - schedules\n-# dependencies:\n-# - build-linux-gcc-x64-avx2\n+# needs:\n+# - job: build-linux-gcc-x64-avx2\n+# artifacts: true\n# tags:\n# - linux\n# - x86\n@@ -761,8 +830,9 @@ test-regression-rep:\nretry: 1\nexcept:\n- schedules\n- dependencies:\n- - build-linux-gcc-x64-sse4.2\n+ needs:\n+ - job: build-linux-gcc-x64-sse4.2\n+ artifacts: true\ntags:\n- linux\n- x86\n@@ -786,8 +856,9 @@ test-regression-rep:\n# GIT_SUBMODULE_STRATEGY: recursive\n# only:\n# - schedules\n-# dependencies:\n-# - build-linux-gcc-x64-avx2\n+# needs:\n+# - job: build-linux-gcc-x64-avx2\n+# artifacts: true\n# tags:\n# - linux\n# - x86\n@@ -814,8 +885,9 @@ test-regression-rs:\nretry: 1\nexcept:\n- schedules\n- dependencies:\n- - build-linux-gcc-x64-sse4.2\n+ needs:\n+ - job: build-linux-gcc-x64-sse4.2\n+ artifacts: true\ntags:\n- linux\n- x86\n@@ -839,8 +911,9 @@ test-regression-rs:\n# GIT_SUBMODULE_STRATEGY: recursive\n# only:\n# - schedules\n-# dependencies:\n-# - build-linux-gcc-x64-avx2\n+# needs:\n+# - job: build-linux-gcc-x64-avx2\n+# artifacts: true\n# tags:\n# - linux\n# - x86\n@@ -867,8 +940,9 @@ test-regression-rsc:\nretry: 1\nexcept:\n- schedules\n- dependencies:\n- - build-linux-gcc-x64-sse4.2\n+ needs:\n+ - job: build-linux-gcc-x64-sse4.2\n+ artifacts: true\ntags:\n- linux\n- x86\n@@ -892,8 +966,9 @@ test-regression-rsc:\n# GIT_SUBMODULE_STRATEGY: recursive\n# only:\n# - schedules\n-# dependencies:\n-# - build-linux-gcc-x64-avx2\n+# needs:\n+# - job: build-linux-gcc-x64-avx2\n+# artifacts: true\n# tags:\n# - linux\n# - x86\n@@ -920,8 +995,9 @@ test-regression-rsc-db:\nretry: 1\nexcept:\n- schedules\n- dependencies:\n- - build-linux-gcc-x64-sse4.2\n+ needs:\n+ - job: build-linux-gcc-x64-sse4.2\n+ artifacts: true\ntags:\n- linux\n- x86\n@@ -945,8 +1021,9 @@ test-regression-rsc-db:\n# GIT_SUBMODULE_STRATEGY: recursive\n# only:\n# - schedules\n-# dependencies:\n-# - build-linux-gcc-x64-avx2\n+# needs:\n+# - job: build-linux-gcc-x64-avx2\n+# artifacts: true\n# tags:\n# - linux\n# - x86\n@@ -973,8 +1050,9 @@ test-regression-turbo:\nretry: 1\nexcept:\n- schedules\n- dependencies:\n- - build-linux-gcc-x64-sse4.2\n+ needs:\n+ - job: build-linux-gcc-x64-sse4.2\n+ artifacts: true\ntags:\n- linux\n- x86\n@@ -999,8 +1077,9 @@ test-regression-turbo:\n# GIT_SUBMODULE_STRATEGY: recursive\n# only:\n# - schedules\n-# dependencies:\n-# - build-linux-gcc-x64-avx2\n+# needs:\n+# - job: build-linux-gcc-x64-avx2\n+# artifacts: true\n# tags:\n# - linux\n# - x86\n@@ -1027,8 +1106,9 @@ test-regression-turbo-db:\nretry: 1\nexcept:\n- schedules\n- dependencies:\n- - build-linux-gcc-x64-sse4.2\n+ needs:\n+ - job: build-linux-gcc-x64-sse4.2\n+ artifacts: true\ntags:\n- linux\n- x86\n@@ -1053,8 +1133,9 @@ test-regression-turbo-db:\n# GIT_SUBMODULE_STRATEGY: recursive\n# only:\n# - schedules\n-# dependencies:\n-# - build-linux-gcc-x64-avx2\n+# needs:\n+# - job: build-linux-gcc-x64-avx2\n+# artifacts: true\n# tags:\n# - linux\n# - x86\n@@ -1081,8 +1162,9 @@ test-regression-turbo-prod:\nretry: 1\nexcept:\n- schedules\n- dependencies:\n- - build-linux-gcc-x64-sse4.2\n+ needs:\n+ - job: build-linux-gcc-x64-sse4.2\n+ artifacts: true\ntags:\n- linux\n- x86\n@@ -1107,8 +1189,9 @@ test-regression-turbo-prod:\n# GIT_SUBMODULE_STRATEGY: recursive\n# only:\n# - schedules\n-# dependencies:\n-# - build-linux-gcc-x64-avx2\n+# needs:\n+# - job: build-linux-gcc-x64-avx2\n+# artifacts: true\n# tags:\n# - linux\n# - x86\n@@ -1135,8 +1218,9 @@ test-regression-uncoded:\nretry: 1\nexcept:\n- schedules\n- dependencies:\n- - build-linux-gcc-x64-sse4.2\n+ needs:\n+ - job: build-linux-gcc-x64-sse4.2\n+ artifacts: true\ntags:\n- linux\n- x86\n@@ -1160,8 +1244,9 @@ test-regression-uncoded:\n# GIT_SUBMODULE_STRATEGY: recursive\n# only:\n# - schedules\n-# dependencies:\n-# - build-linux-gcc-x64-avx2\n+# needs:\n+# - job: build-linux-gcc-x64-avx2\n+# artifacts: true\n# tags:\n# - linux\n# - x86\n@@ -1187,8 +1272,9 @@ test-regression-long:\nGIT_SUBMODULE_STRATEGY: recursive\nonly:\n- schedules\n- dependencies:\n- - build-linux-gcc-x64-avx2\n+ needs:\n+ - job: build-linux-gcc-x64-avx2\n+ artifacts: true\ntags:\n- linux\n- x86\n@@ -1214,7 +1300,11 @@ test-build-coverage-regression:\nGIT_SUBMODULE_STRATEGY: recursive\nexcept:\n- schedules\n- dependencies: []\n+ needs:\n+ - job: analysis-cppcheck\n+ artifacts: false\n+ - job: analysis-headers\n+ artifacts: false\ntags:\n- linux\n- gcc\n@@ -1235,8 +1325,9 @@ coverage-linux:\nstage: coverage\nexcept:\n- schedules\n- dependencies:\n- - test-build-coverage-regression\n+ needs:\n+ - job: test-build-coverage-regression\n+ artifacts: true\ntags:\n- linux\n- lcov\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
CI: use new `needs` keyword to replace the pipeline by a DAG.
|
8,490 |
08.10.2020 10:25:41
| -7,200 |
2e70239c69b64fa8e3b1846dfc601696ed8bd685
|
CI: fix static compilation on Ubuntu >= 18.04.
|
[
{
"change_type": "MODIFY",
"old_path": ".gitlab-ci.yml",
"new_path": ".gitlab-ci.yml",
"diff": "@@ -131,7 +131,7 @@ build-linux-gcc-nointr:\n- export CC=\"gcc\"\n- export CXX=\"g++\"\n- export CFLAGS=\"-Wall -funroll-loops -DMIPP_NO_INTRINSICS\"\n- - export LFLAGS=\"-static -static-libgcc -static-libstdc++ -Wl,--whole-archive -lpthread -Wl,--no-whole-archive\"\n+ - export LFLAGS=\"-static -static-libgcc -static-libstdc++ -Wl,--whole-archive -lrt -lpthread -Wl,--no-whole-archive\"\n- export CMAKE_OPT=\"-DAFF3CT_COMPILE_EXE=ON -DAFF3CT_COMPILE_STATIC_LIB=ON -DAFF3CT_COMPILE_SHARED_LIB=ON -DAFF3CT_PREC=MULTI -DAFF3CT_EXT_STRINGS=OFF\"\n- export NAME=\"build_linux_gcc_nointr\"\n- source ./ci/tools/threads.sh\n@@ -164,7 +164,7 @@ build-linux-gcc-x64-sse4.2:\n- export CC=\"gcc\"\n- export CXX=\"g++\"\n- export CFLAGS=\"-Wall -funroll-loops -m64 -msse4.2\"\n- - export LFLAGS=\"-static -static-libgcc -static-libstdc++ -Wl,--whole-archive -lpthread -Wl,--no-whole-archive\"\n+ - export LFLAGS=\"-static -static-libgcc -static-libstdc++ -Wl,--whole-archive -lrt -lpthread -Wl,--no-whole-archive\"\n- export CMAKE_OPT=\"-DAFF3CT_COMPILE_EXE=ON -DAFF3CT_COMPILE_STATIC_LIB=ON -DAFF3CT_COMPILE_SHARED_LIB=ON -DAFF3CT_PREC=MULTI -DAFF3CT_EXT_STRINGS=OFF\"\n- export NAME=\"build_linux_gcc_x64_sse4.2\"\n- source ./ci/tools/threads.sh\n@@ -195,7 +195,7 @@ build-linux-gcc-x64-avx2:\n- export CC=\"gcc\"\n- export CXX=\"g++\"\n- export CFLAGS=\"-Wall -funroll-loops -m64 -mavx2 -mfma\"\n- - export LFLAGS=\"-static -static-libgcc -static-libstdc++ -Wl,--whole-archive -lpthread -Wl,--no-whole-archive\"\n+ - export LFLAGS=\"-static -static-libgcc -static-libstdc++ -Wl,--whole-archive -lrt -lpthread -Wl,--no-whole-archive\"\n- export CMAKE_OPT=\"-DAFF3CT_COMPILE_EXE=ON -DAFF3CT_COMPILE_STATIC_LIB=ON -DAFF3CT_COMPILE_SHARED_LIB=ON -DAFF3CT_PREC=MULTI -DAFF3CT_EXT_STRINGS=OFF\"\n- export NAME=\"build_linux_gcc_x64_avx2\"\n- source ./ci/tools/threads.sh\n@@ -1431,7 +1431,7 @@ deploy-upload-ppa:\n- export CC=\"gcc\"\n- export CXX=\"g++\"\n- export CFLAGS=\"-Wall -funroll-loops -m64 -msse4.2\"\n- - export LFLAGS=\"-static -static-libgcc -static-libstdc++ -Wl,--whole-archive -lpthread -Wl,--no-whole-archive\"\n+ - export LFLAGS=\"-static -static-libgcc -static-libstdc++ -Wl,--whole-archive -lrt -lpthread -Wl,--no-whole-archive\"\n- export CMAKE_OPT=\"-DAFF3CT_COMPILE_EXE=OFF -DAFF3CT_COMPILE_STATIC_LIB=OFF -DAFF3CT_COMPILE_SHARED_LIB=OFF -DAFF3CT_PREC=MULTI -DAFF3CT_EXT_STRINGS=OFF\"\n- export NAME=\"build\"\n- ./ci/deploy-upload-ppa.sh\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
CI: fix static compilation on Ubuntu >= 18.04.
|
8,490 |
08.10.2020 14:50:27
| -7,200 |
ab1a97eb870b99335f35da1e153f1f373b320e28
|
CI: simplify regression tests for short and long runs.
|
[
{
"change_type": "MODIFY",
"old_path": ".gitlab-ci.yml",
"new_path": ".gitlab-ci.yml",
"diff": "@@ -141,8 +141,6 @@ build-linux-gcc-x64-sse4.2:\nstage: build\nvariables:\nGIT_SUBMODULE_STRATEGY: recursive\n- except:\n- - schedules\nneeds:\n- job: analysis-cppcheck\nartifacts: false\n@@ -174,6 +172,8 @@ build-linux-gcc-x64-avx2:\nstage: build\nvariables:\nGIT_SUBMODULE_STRATEGY: recursive\n+ except:\n+ - schedules\nneeds:\n- job: analysis-cppcheck\nartifacts: false\n@@ -550,8 +550,6 @@ test-regression-bch:\nvariables:\nGIT_SUBMODULE_STRATEGY: recursive\nretry: 1\n- except:\n- - schedules\nneeds:\n- job: build-linux-gcc-x64-sse4.2\nartifacts: true\n@@ -569,44 +567,15 @@ test-regression-bch:\nscript:\n- source ./ci/tools/threads.sh\n- source ./ci/tools/git-version.sh\n- - export TIME_SEC=\"5\"\n+# - export TIME_SEC=\"5\"\n+ - export TIME_SEC=$CI_AFF3CT_TEST_BCH_TIME_SEC\n- ./ci/test-regression.py --refs-path refs/BCH --results-path test-regression-results-bch --build-path build_linux_gcc_x64_sse4.2 --binary-path bin/aff3ct-$GIT_VERSION --max-snr-time $TIME_SEC --sensibility 2.5 --weak-rate 0.9 --verbose 1 --n-threads $THREADS\n-# test-regression-bch-long:\n-# stage: test\n-# variables:\n-# GIT_SUBMODULE_STRATEGY: recursive\n-# only:\n-# - schedules\n-# needs:\n-# - job: build-linux-gcc-x64-avx2\n-# artifacts: true\n-# tags:\n-# - linux\n-# - x86\n-# - 64-bit\n-# - avx2\n-# - powerful\n-# - schedules\n-# - python3.4\n-# artifacts:\n-# name: test-regression-results-bch\n-# when: always\n-# paths:\n-# - test-regression-results-bch/\n-# script:\n-# - source ./ci/tools/threads.sh\n-# - source ./ci/tools/git-version.sh\n-# - export TIME_SEC=$CI_TIME_SEC_TEST_LONG_BCH\n-# - ./ci/test-regression.py --refs-path refs/BCH --results-path test-regression-results-bch --build-path build_linux_gcc_x64_avx2 --binary-path bin/aff3ct-$GIT_VERSION --max-snr-time $TIME_SEC --sensibility 2.5 --weak-rate 0.9 --verbose 1 --n-threads $THREADS\n-\ntest-regression-ldpc:\nstage: test\nvariables:\nGIT_SUBMODULE_STRATEGY: recursive\nretry: 1\n- except:\n- - schedules\nneeds:\n- job: build-linux-gcc-x64-sse4.2\nartifacts: true\n@@ -625,44 +594,15 @@ test-regression-ldpc:\nscript:\n- source ./ci/tools/threads.sh\n- source ./ci/tools/git-version.sh\n- - export TIME_SEC=\"10\"\n+# - export TIME_SEC=\"10\"\n+ - export TIME_SEC=$CI_AFF3CT_TEST_LDPC_TIME_SEC\n- ./ci/test-regression.py --refs-path refs/LDPC --results-path test-regression-results-ldpc --build-path build_linux_gcc_x64_sse4.2 --binary-path bin/aff3ct-$GIT_VERSION --max-snr-time $TIME_SEC --sensibility 2.5 --weak-rate 0.9 --verbose 1 --n-threads $THREADS\n-# test-regression-ldpc-long:\n-# stage: test\n-# variables:\n-# GIT_SUBMODULE_STRATEGY: recursive\n-# only:\n-# - schedules\n-# needs:\n-# - job: build-linux-gcc-x64-avx2\n-# artifacts: true\n-# tags:\n-# - linux\n-# - x86\n-# - 64-bit\n-# - avx2\n-# - powerful\n-# - schedules\n-# - python3.4\n-# artifacts:\n-# name: test-regression-results-ldpc\n-# when: always\n-# paths:\n-# - test-regression-results-ldpc/\n-# script:\n-# - source ./ci/tools/threads.sh\n-# - source ./ci/tools/git-version.sh\n-# - export TIME_SEC=$CI_TIME_SEC_TEST_LONG_LDPC\n-# - ./ci/test-regression.py --refs-path refs/LDPC --results-path test-regression-results-ldpc --build-path build_linux_gcc_x64_avx2 --binary-path bin/aff3ct-$GIT_VERSION --max-snr-time $TIME_SEC --sensibility 2.5 --weak-rate 0.9 --verbose 1 --n-threads $THREADS\n-\ntest-regression-polar:\nstage: test\nvariables:\nGIT_SUBMODULE_STRATEGY: recursive\nretry: 1\n- except:\n- - schedules\nneeds:\n- job: build-linux-gcc-x64-sse4.2\nartifacts: true\n@@ -681,44 +621,15 @@ test-regression-polar:\nscript:\n- source ./ci/tools/threads.sh\n- source ./ci/tools/git-version.sh\n- - export TIME_SEC=\"5\"\n+# - export TIME_SEC=\"5\"\n+ - export TIME_SEC=$CI_AFF3CT_TEST_POLAR_TIME_SEC\n- ./ci/test-regression.py --refs-path refs/POLAR --results-path test-regression-results-polar --build-path build_linux_gcc_x64_sse4.2 --binary-path bin/aff3ct-$GIT_VERSION --max-snr-time $TIME_SEC --sensibility 2.5 --weak-rate 0.9 --verbose 1 --n-threads $THREADS\n-# test-regression-polar-long:\n-# stage: test\n-# variables:\n-# GIT_SUBMODULE_STRATEGY: recursive\n-# only:\n-# - schedules\n-# needs:\n-# - job: build-linux-gcc-x64-avx2\n-# artifacts: true\n-# tags:\n-# - linux\n-# - x86\n-# - 64-bit\n-# - avx2\n-# - powerful\n-# - schedules\n-# - python3.4\n-# artifacts:\n-# name: test-regression-results-polar\n-# when: always\n-# paths:\n-# - test-regression-results-polar/\n-# script:\n-# - source ./ci/tools/threads.sh\n-# - source ./ci/tools/git-version.sh\n-# - export TIME_SEC=$CI_TIME_SEC_TEST_LONG_POLAR\n-# - ./ci/test-regression.py --refs-path refs/POLAR --results-path test-regression-results-polar --build-path build_linux_gcc_x64_avx2 --binary-path bin/aff3ct-$GIT_VERSION --max-snr-time $TIME_SEC --sensibility 2.5 --weak-rate 0.9 --verbose 1 --n-threads $THREADS\n-\ntest-regression-polar-mk:\nstage: test\nvariables:\nGIT_SUBMODULE_STRATEGY: recursive\nretry: 1\n- except:\n- - schedules\nneeds:\n- job: build-linux-gcc-x64-sse4.2\nartifacts: true\n@@ -737,37 +648,10 @@ test-regression-polar-mk:\nscript:\n- source ./ci/tools/threads.sh\n- source ./ci/tools/git-version.sh\n- - export TIME_SEC=\"5\"\n+# - export TIME_SEC=\"5\"\n+ - export TIME_SEC=$CI_AFF3CT_TEST_POLAR_MK_TIME_SEC\n- ./ci/test-regression.py --refs-path refs/POLAR_MK --results-path test-regression-results-polar-mk --build-path build_linux_gcc_x64_sse4.2 --binary-path bin/aff3ct-$GIT_VERSION --max-snr-time $TIME_SEC --sensibility 2.5 --weak-rate 0.9 --verbose 1 --n-threads $THREADS\n-# test-regression-polar-mk-long:\n-# stage: test\n-# variables:\n-# GIT_SUBMODULE_STRATEGY: recursive\n-# only:\n-# - schedules\n-# needs:\n-# - job: build-linux-gcc-x64-avx2\n-# artifacts: true\n-# tags:\n-# - linux\n-# - x86\n-# - 64-bit\n-# - avx2\n-# - powerful\n-# - schedules\n-# - python3.4\n-# artifacts:\n-# name: test-regression-results-polar-mk\n-# when: always\n-# paths:\n-# - test-regression-results-polar-mk/\n-# script:\n-# - source ./ci/tools/threads.sh\n-# - source ./ci/tools/git-version.sh\n-# - export TIME_SEC=$CI_TIME_SEC_TEST_LONG_POLAR\n-# - ./ci/test-regression.py --refs-path refs/POLAR_MK --results-path test-regression-results-polar-mk --build-path build_linux_gcc_x64_avx2 --binary-path bin/aff3ct-$GIT_VERSION --max-snr-time $TIME_SEC --sensibility 2.5 --weak-rate 0.9 --verbose 1 --n-threads $THREADS\n-\ntest-regression-ra:\nstage: test\nvariables:\n@@ -792,44 +676,15 @@ test-regression-ra:\nscript:\n- source ./ci/tools/threads.sh\n- source ./ci/tools/git-version.sh\n- - export TIME_SEC=\"5\"\n+# - export TIME_SEC=\"5\"\n+ - export TIME_SEC=$CI_AFF3CT_TEST_RA_TIME_SEC\n- ./ci/test-regression.py --refs-path refs/RA --results-path test-regression-results-ra --build-path build_linux_gcc_x64_sse4.2 --binary-path bin/aff3ct-$GIT_VERSION --max-snr-time $TIME_SEC --sensibility 2.5 --weak-rate 0.9 --verbose 1 --n-threads $THREADS\n-# test-regression-ra-long:\n-# stage: test\n-# variables:\n-# GIT_SUBMODULE_STRATEGY: recursive\n-# only:\n-# - schedules\n-# needs:\n-# - job: build-linux-gcc-x64-avx2\n-# artifacts: true\n-# tags:\n-# - linux\n-# - x86\n-# - 64-bit\n-# - avx2\n-# - powerful\n-# - schedules\n-# - python3.4\n-# artifacts:\n-# name: test-regression-results-ra\n-# when: always\n-# paths:\n-# - test-regression-results-ra/\n-# script:\n-# - source ./ci/tools/threads.sh\n-# - source ./ci/tools/git-version.sh\n-# - export TIME_SEC=$CI_TIME_SEC_TEST_LONG_RA\n-# - ./ci/test-regression.py --refs-path refs/RA --results-path test-regression-results-ra --build-path build_linux_gcc_x64_avx2 --binary-path bin/aff3ct-$GIT_VERSION --max-snr-time $TIME_SEC --sensibility 2.5 --weak-rate 0.9 --verbose 1 --n-threads $THREADS\n-\ntest-regression-rep:\nstage: test\nvariables:\nGIT_SUBMODULE_STRATEGY: recursive\nretry: 1\n- except:\n- - schedules\nneeds:\n- job: build-linux-gcc-x64-sse4.2\nartifacts: true\n@@ -847,44 +702,15 @@ test-regression-rep:\nscript:\n- source ./ci/tools/threads.sh\n- source ./ci/tools/git-version.sh\n- - export TIME_SEC=\"5\"\n+# - export TIME_SEC=\"5\"\n+ - export TIME_SEC=$CI_AFF3CT_TEST_REP_TIME_SEC\n- ./ci/test-regression.py --refs-path refs/REP --results-path test-regression-results-rep --build-path build_linux_gcc_x64_sse4.2 --binary-path bin/aff3ct-$GIT_VERSION --max-snr-time $TIME_SEC --sensibility 2.5 --weak-rate 0.9 --verbose 1 --n-threads $THREADS\n-# test-regression-rep-long:\n-# stage: test\n-# variables:\n-# GIT_SUBMODULE_STRATEGY: recursive\n-# only:\n-# - schedules\n-# needs:\n-# - job: build-linux-gcc-x64-avx2\n-# artifacts: true\n-# tags:\n-# - linux\n-# - x86\n-# - 64-bit\n-# - avx2\n-# - powerful\n-# - schedules\n-# - python3.4\n-# artifacts:\n-# name: test-regression-results-rep\n-# when: always\n-# paths:\n-# - test-regression-results-rep/\n-# script:\n-# - source ./ci/tools/threads.sh\n-# - source ./ci/tools/git-version.sh\n-# - export TIME_SEC=$CI_TIME_SEC_TEST_LONG_REP\n-# - ./ci/test-regression.py --refs-path refs/REP --results-path test-regression-results-rep --build-path build_linux_gcc_x64_avx2 --binary-path bin/aff3ct-$GIT_VERSION --max-snr-time $TIME_SEC --sensibility 2.5 --weak-rate 0.9 --verbose 1 --n-threads $THREADS\n-\ntest-regression-rs:\nstage: test\nvariables:\nGIT_SUBMODULE_STRATEGY: recursive\nretry: 1\n- except:\n- - schedules\nneeds:\n- job: build-linux-gcc-x64-sse4.2\nartifacts: true\n@@ -902,44 +728,15 @@ test-regression-rs:\nscript:\n- source ./ci/tools/threads.sh\n- source ./ci/tools/git-version.sh\n- - export TIME_SEC=\"5\"\n+# - export TIME_SEC=\"5\"\n+ - export TIME_SEC=$CI_AFF3CT_TEST_RS_TIME_SEC\n- ./ci/test-regression.py --refs-path refs/RS --results-path test-regression-results-rs --build-path build_linux_gcc_x64_sse4.2 --binary-path bin/aff3ct-$GIT_VERSION --max-snr-time $TIME_SEC --sensibility 2.5 --weak-rate 0.9 --verbose 1 --n-threads $THREADS\n-# test-regression-rs-long:\n-# stage: test\n-# variables:\n-# GIT_SUBMODULE_STRATEGY: recursive\n-# only:\n-# - schedules\n-# needs:\n-# - job: build-linux-gcc-x64-avx2\n-# artifacts: true\n-# tags:\n-# - linux\n-# - x86\n-# - 64-bit\n-# - avx2\n-# - powerful\n-# - schedules\n-# - python3.4\n-# artifacts:\n-# name: test-regression-results-rs\n-# when: always\n-# paths:\n-# - test-regression-results-rs/\n-# script:\n-# - source ./ci/tools/threads.sh\n-# - source ./ci/tools/git-version.sh\n-# - export TIME_SEC=$CI_TIME_SEC_TEST_LONG_RS\n-# - ./ci/test-regression.py --refs-path refs/RS --results-path test-regression-results-rs --build-path build_linux_gcc_x64_avx2 --binary-path bin/aff3ct-$GIT_VERSION --max-snr-time $TIME_SEC --sensibility 2.5 --weak-rate 0.9 --verbose 1 --n-threads $THREADS\n-\ntest-regression-rsc:\nstage: test\nvariables:\nGIT_SUBMODULE_STRATEGY: recursive\nretry: 1\n- except:\n- - schedules\nneeds:\n- job: build-linux-gcc-x64-sse4.2\nartifacts: true\n@@ -957,44 +754,15 @@ test-regression-rsc:\nscript:\n- source ./ci/tools/threads.sh\n- source ./ci/tools/git-version.sh\n- - export TIME_SEC=\"5\"\n+# - export TIME_SEC=\"5\"\n+ - export TIME_SEC=$CI_AFF3CT_TEST_RSC_TIME_SEC\n- ./ci/test-regression.py --refs-path refs/RSC --results-path test-regression-results-rsc --build-path build_linux_gcc_x64_sse4.2 --binary-path bin/aff3ct-$GIT_VERSION --max-snr-time $TIME_SEC --sensibility 2.5 --weak-rate 0.9 --verbose 1 --n-threads $THREADS\n-# test-regression-rsc-long:\n-# stage: test\n-# variables:\n-# GIT_SUBMODULE_STRATEGY: recursive\n-# only:\n-# - schedules\n-# needs:\n-# - job: build-linux-gcc-x64-avx2\n-# artifacts: true\n-# tags:\n-# - linux\n-# - x86\n-# - 64-bit\n-# - avx2\n-# - powerful\n-# - schedules\n-# - python3.4\n-# artifacts:\n-# name: test-regression-results-rsc\n-# when: always\n-# paths:\n-# - test-regression-results-rsc/\n-# script:\n-# - source ./ci/tools/threads.sh\n-# - source ./ci/tools/git-version.sh\n-# - export TIME_SEC=$CI_TIME_SEC_TEST_LONG_RSC\n-# - ./ci/test-regression.py --refs-path refs/RSC --results-path test-regression-results-rsc --build-path build_linux_gcc_x64_avx2 --binary-path bin/aff3ct-$GIT_VERSION --max-snr-time $TIME_SEC --sensibility 2.5 --weak-rate 0.9 --verbose 1 --n-threads $THREADS\n-\ntest-regression-rsc-db:\nstage: test\nvariables:\nGIT_SUBMODULE_STRATEGY: recursive\nretry: 1\n- except:\n- - schedules\nneeds:\n- job: build-linux-gcc-x64-sse4.2\nartifacts: true\n@@ -1012,44 +780,15 @@ test-regression-rsc-db:\nscript:\n- source ./ci/tools/threads.sh\n- source ./ci/tools/git-version.sh\n- - export TIME_SEC=\"5\"\n+# - export TIME_SEC=\"5\"\n+ - export TIME_SEC=$CI_AFF3CT_TEST_RSC_DB_TIME_SEC\n- ./ci/test-regression.py --refs-path refs/RSC_DB --results-path test-regression-results-rsc-db --build-path build_linux_gcc_x64_sse4.2 --binary-path bin/aff3ct-$GIT_VERSION --max-snr-time $TIME_SEC --sensibility 2.5 --weak-rate 0.9 --verbose 1 --n-threads $THREADS\n-# test-regression-rsc-db-long:\n-# stage: test\n-# variables:\n-# GIT_SUBMODULE_STRATEGY: recursive\n-# only:\n-# - schedules\n-# needs:\n-# - job: build-linux-gcc-x64-avx2\n-# artifacts: true\n-# tags:\n-# - linux\n-# - x86\n-# - 64-bit\n-# - avx2\n-# - powerful\n-# - schedules\n-# - python3.4\n-# artifacts:\n-# name: test-regression-results-rsc-db\n-# when: always\n-# paths:\n-# - test-regression-results-rsc-db/\n-# script:\n-# - source ./ci/tools/threads.sh\n-# - source ./ci/tools/git-version.sh\n-# - export TIME_SEC=$CI_TIME_SEC_TEST_LONG_RSC_DB\n-# - ./ci/test-regression.py --refs-path refs/RSC_DB --results-path test-regression-results-rsc-db --build-path build_linux_gcc_x64_avx2 --binary-path bin/aff3ct-$GIT_VERSION --max-snr-time $TIME_SEC --sensibility 2.5 --weak-rate 0.9 --verbose 1 --n-threads $THREADS\n-\ntest-regression-turbo:\nstage: test\nvariables:\nGIT_SUBMODULE_STRATEGY: recursive\nretry: 1\n- except:\n- - schedules\nneeds:\n- job: build-linux-gcc-x64-sse4.2\nartifacts: true\n@@ -1068,44 +807,15 @@ test-regression-turbo:\nscript:\n- source ./ci/tools/threads.sh\n- source ./ci/tools/git-version.sh\n- - export TIME_SEC=\"5\"\n+# - export TIME_SEC=\"5\"\n+ - export TIME_SEC=$CI_AFF3CT_TEST_TURBO_TIME_SEC\n- ./ci/test-regression.py --refs-path refs/TURBO --results-path test-regression-results-turbo --build-path build_linux_gcc_x64_sse4.2 --binary-path bin/aff3ct-$GIT_VERSION --max-snr-time $TIME_SEC --sensibility 2.5 --weak-rate 0.9 --verbose 1 --n-threads $THREADS\n-# test-regression-turbo-long:\n-# stage: test\n-# variables:\n-# GIT_SUBMODULE_STRATEGY: recursive\n-# only:\n-# - schedules\n-# needs:\n-# - job: build-linux-gcc-x64-avx2\n-# artifacts: true\n-# tags:\n-# - linux\n-# - x86\n-# - 64-bit\n-# - avx2\n-# - powerful\n-# - schedules\n-# - python3.4\n-# artifacts:\n-# name: test-regression-results-turbo\n-# when: always\n-# paths:\n-# - test-regression-results-turbo/\n-# script:\n-# - source ./ci/tools/threads.sh\n-# - source ./ci/tools/git-version.sh\n-# - export TIME_SEC=$CI_TIME_SEC_TEST_LONG_TURBO\n-# - ./ci/test-regression.py --refs-path refs/TURBO --results-path test-regression-results-turbo --build-path build_linux_gcc_x64_avx2 --binary-path bin/aff3ct-$GIT_VERSION --max-snr-time $TIME_SEC --sensibility 2.5 --weak-rate 0.9 --verbose 1 --n-threads $THREADS\n-\ntest-regression-turbo-db:\nstage: test\nvariables:\nGIT_SUBMODULE_STRATEGY: recursive\nretry: 1\n- except:\n- - schedules\nneeds:\n- job: build-linux-gcc-x64-sse4.2\nartifacts: true\n@@ -1124,44 +834,15 @@ test-regression-turbo-db:\nscript:\n- source ./ci/tools/threads.sh\n- source ./ci/tools/git-version.sh\n- - export TIME_SEC=\"5\"\n+# - export TIME_SEC=\"5\"\n+ - export TIME_SEC=$CI_AFF3CT_TEST_TURBO_DB_TIME_SEC\n- ./ci/test-regression.py --refs-path refs/TURBO_DB --results-path test-regression-results-turbo-db --build-path build_linux_gcc_x64_sse4.2 --binary-path bin/aff3ct-$GIT_VERSION --max-snr-time $TIME_SEC --sensibility 2.5 --weak-rate 0.9 --verbose 1 --n-threads $THREADS\n-# test-regression-turbo-db-long:\n-# stage: test\n-# variables:\n-# GIT_SUBMODULE_STRATEGY: recursive\n-# only:\n-# - schedules\n-# needs:\n-# - job: build-linux-gcc-x64-avx2\n-# artifacts: true\n-# tags:\n-# - linux\n-# - x86\n-# - 64-bit\n-# - avx2\n-# - powerful\n-# - schedules\n-# - python3.4\n-# artifacts:\n-# name: test-regression-results-turbo-db\n-# when: always\n-# paths:\n-# - test-regression-results-turbo-db/\n-# script:\n-# - source ./ci/tools/threads.sh\n-# - source ./ci/tools/git-version.sh\n-# - export TIME_SEC=$CI_TIME_SEC_TEST_LONG_TURBO_DB\n-# - ./ci/test-regression.py --refs-path refs/TURBO_DB --results-path test-regression-results-turbo-db --build-path build_linux_gcc_x64_avx2 --binary-path bin/aff3ct-$GIT_VERSION --max-snr-time $TIME_SEC --sensibility 2.5 --weak-rate 0.9 --verbose 1 --n-threads $THREADS\n-\ntest-regression-turbo-prod:\nstage: test\nvariables:\nGIT_SUBMODULE_STRATEGY: recursive\nretry: 1\n- except:\n- - schedules\nneeds:\n- job: build-linux-gcc-x64-sse4.2\nartifacts: true\n@@ -1180,44 +861,15 @@ test-regression-turbo-prod:\nscript:\n- source ./ci/tools/threads.sh\n- source ./ci/tools/git-version.sh\n- - export TIME_SEC=\"30\"\n+# - export TIME_SEC=\"30\"\n+ - export TIME_SEC=$CI_AFF3CT_TEST_TURBO_PROD_TIME_SEC\n- ./ci/test-regression.py --refs-path refs/TURBO_PROD --results-path test-regression-results-turbo-prod --build-path build_linux_gcc_x64_sse4.2 --binary-path bin/aff3ct-$GIT_VERSION --max-snr-time $TIME_SEC --sensibility 2.5 --weak-rate 0.9 --verbose 1 --n-threads $THREADS\n-# test-regression-turbo-prod-long:\n-# stage: test\n-# variables:\n-# GIT_SUBMODULE_STRATEGY: recursive\n-# only:\n-# - schedules\n-# needs:\n-# - job: build-linux-gcc-x64-avx2\n-# artifacts: true\n-# tags:\n-# - linux\n-# - x86\n-# - 64-bit\n-# - avx2\n-# - powerful\n-# - schedules\n-# - python3.4\n-# artifacts:\n-# name: test-regression-results-turbo-prod\n-# when: always\n-# paths:\n-# - test-regression-results-turbo-prod/\n-# script:\n-# - source ./ci/tools/threads.sh\n-# - source ./ci/tools/git-version.sh\n-# - export TIME_SEC=$CI_TIME_SEC_TEST_LONG_TURBO_PROD\n-# - ./ci/test-regression.py --refs-path refs/TURBO_PROD --results-path test-regression-results-turbo-prod --build-path build_linux_gcc_x64_avx2 --binary-path bin/aff3ct-$GIT_VERSION --max-snr-time $TIME_SEC --sensibility 2.5 --weak-rate 0.9 --verbose 1 --n-threads $THREADS\n-\ntest-regression-uncoded:\nstage: test\nvariables:\nGIT_SUBMODULE_STRATEGY: recursive\nretry: 1\n- except:\n- - schedules\nneeds:\n- job: build-linux-gcc-x64-sse4.2\nartifacts: true\n@@ -1235,65 +887,10 @@ test-regression-uncoded:\nscript:\n- source ./ci/tools/threads.sh\n- source ./ci/tools/git-version.sh\n- - export TIME_SEC=\"5\"\n+# - export TIME_SEC=\"5\"\n+ - export TIME_SEC=$CI_AFF3CT_TEST_UNCODED_TIME_SEC\n- ./ci/test-regression.py --refs-path refs/UNCODED --results-path test-regression-results-uncoded --build-path build_linux_gcc_x64_sse4.2 --binary-path bin/aff3ct-$GIT_VERSION --max-snr-time $TIME_SEC --sensibility 2.5 --weak-rate 0.9 --verbose 1 --n-threads $THREADS\n-# test-regression-uncoded-long:\n-# stage: test\n-# variables:\n-# GIT_SUBMODULE_STRATEGY: recursive\n-# only:\n-# - schedules\n-# needs:\n-# - job: build-linux-gcc-x64-avx2\n-# artifacts: true\n-# tags:\n-# - linux\n-# - x86\n-# - 64-bit\n-# - avx2\n-# - powerful\n-# - schedules\n-# - python3.4\n-# artifacts:\n-# name: test-regression-results-uncoded\n-# when: always\n-# paths:\n-# - test-regression-results-uncoded/\n-# script:\n-# - source ./ci/tools/threads.sh\n-# - source ./ci/tools/git-version.sh\n-# - export TIME_SEC=$CI_TIME_SEC_TEST_LONG_UNCODED\n-# - ./ci/test-regression.py --refs-path refs/UNCODED --results-path test-regression-results-uncoded --build-path build_linux_gcc_x64_avx2 --binary-path bin/aff3ct-$GIT_VERSION --max-snr-time $TIME_SEC --sensibility 2.5 --weak-rate 0.9 --verbose 1 --n-threads $THREADS\n-\n-test-regression-long:\n- stage: test\n- variables:\n- GIT_SUBMODULE_STRATEGY: recursive\n- only:\n- - schedules\n- needs:\n- - job: build-linux-gcc-x64-avx2\n- artifacts: true\n- tags:\n- - linux\n- - x86\n- - 64-bit\n- - avx2\n- - powerful\n- - schedules\n- - python3.4\n- artifacts:\n- name: test-regression-long-results\n- when: always\n- paths:\n- - test-regression-long-results/\n- script:\n- - source ./ci/tools/threads.sh\n- - source ./ci/tools/git-version.sh\n- - export TIME_SEC=$CI_TIME_SEC_TEST_LONG\n- - ./ci/test-regression.py --refs-path refs --results-path test-regression-long-results --build-path build_linux_gcc_x64_avx2 --binary-path bin/aff3ct-$GIT_VERSION --max-snr-time $TIME_SEC --sensibility 2.5 --weak-rate 0.9 --verbose 1 --n-threads $THREADS\n-\ntest-build-coverage-regression:\nstage: test\nvariables:\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
CI: simplify regression tests for short and long runs.
|
8,490 |
08.10.2020 20:22:06
| -7,200 |
2edcafc0fc5f85e5c01a9601dd61c7932ae35b87
|
CI: try to fix long regression tests.
|
[
{
"change_type": "MODIFY",
"old_path": ".gitlab-ci.yml",
"new_path": ".gitlab-ci.yml",
"diff": "@@ -17,8 +17,6 @@ before_script:\nanalysis-cppcheck:\nstage: analysis\nallow_failure: false\n- except:\n- - schedules\nartifacts:\nname: analysis-cppcheck-logs\nwhen: always\n@@ -59,8 +57,6 @@ analysis-clang:\nanalysis-headers:\nstage: analysis\n- except:\n- - schedules\nartifacts:\nname: analysis-headers\nwhen: always\n@@ -89,8 +85,6 @@ analysis-git-submodules:\nanalysis-documentation:\nstage: analysis\n- except:\n- - schedules\nartifacts:\nname: analysis-documentation\nwhen: always\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
CI: try to fix long regression tests.
|
8,490 |
23.10.2020 13:28:05
| -7,200 |
7cee7d9b38e3e135c239769e0a664e34390f55f4
|
Check the `info_bits_pos` vector in the LDPC decoders.
|
[
{
"change_type": "MODIFY",
"old_path": "include/Module/Decoder/LDPC/BP/Flooding/Decoder_LDPC_BP_flooding.hxx",
"new_path": "include/Module/Decoder/LDPC/BP/Flooding/Decoder_LDPC_BP_flooding.hxx",
"diff": "#include <sstream>\n#include <string>\n+#include \"Tools/general_utils.h\"\n#include \"Tools/Exception/exception.hpp\"\n#include \"Tools/Perf/common/hard_decide.h\"\n#include \"Module/Decoder/LDPC/BP/Flooding/Decoder_LDPC_BP_flooding.hpp\"\n@@ -31,6 +32,8 @@ Decoder_LDPC_BP_flooding<B,R,Update_rule>\nconst std::string name = \"Decoder_LDPC_BP_flooding<\" + this->up_rule.get_name() + \">\";\nthis->set_name(name);\n+ tools::check_LUT(info_bits_pos, \"info_bits_pos\", (size_t)K);\n+\nmipp::vector<unsigned char> connections(this->H.get_n_rows(), 0);\nconst auto &msg_chk_to_var_id = this->H.get_col_to_rows();\n"
},
{
"change_type": "MODIFY",
"old_path": "include/Module/Decoder/LDPC/BP/Flooding/Decoder_LDPC_BP_flooding_inter.hxx",
"new_path": "include/Module/Decoder/LDPC/BP/Flooding/Decoder_LDPC_BP_flooding_inter.hxx",
"diff": "#include <string>\n#include <cmath>\n+#include \"Tools/general_utils.h\"\n#include \"Tools/Exception/exception.hpp\"\n#include \"Tools/Perf/Reorderer/Reorderer.hpp\"\n#include \"Module/Decoder/LDPC/BP/Horizontal_layered/Decoder_LDPC_BP_horizontal_layered_inter.hpp\"\n@@ -39,6 +40,8 @@ Decoder_LDPC_BP_flooding_inter<B,R,Update_rule>\nconst std::string name = \"Decoder_LDPC_BP_flooding_inter<\" + this->up_rule.get_name() + \">\";\nthis->set_name(name);\n+ tools::check_LUT(info_bits_pos, \"info_bits_pos\", (size_t)K);\n+\nif (this->sat_val <= 0)\n{\nstd::stringstream message;\n"
},
{
"change_type": "MODIFY",
"old_path": "include/Module/Decoder/LDPC/BP/Horizontal_layered/Decoder_LDPC_BP_horizontal_layered.hxx",
"new_path": "include/Module/Decoder/LDPC/BP/Horizontal_layered/Decoder_LDPC_BP_horizontal_layered.hxx",
"diff": "#include <string>\n#include <algorithm>\n+#include \"Tools/general_utils.h\"\n#include \"Tools/Perf/common/hard_decide.h\"\n#include \"Module/Decoder/LDPC/BP/Horizontal_layered/Decoder_LDPC_BP_horizontal_layered.hpp\"\n@@ -28,6 +29,8 @@ Decoder_LDPC_BP_horizontal_layered<B,R,Update_rule>\nconst std::string name = \"Decoder_LDPC_BP_horizontal_layered<\" + this->up_rule.get_name() + \">\";\nthis->set_name(name);\n+ tools::check_LUT(info_bits_pos, \"info_bits_pos\", (size_t)K);\n+\nthis->reset();\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "include/Module/Decoder/LDPC/BP/Horizontal_layered/Decoder_LDPC_BP_horizontal_layered_inter.hxx",
"new_path": "include/Module/Decoder/LDPC/BP/Horizontal_layered/Decoder_LDPC_BP_horizontal_layered_inter.hxx",
"diff": "#include <string>\n#include <cmath>\n+#include \"Tools/general_utils.h\"\n#include \"Tools/Exception/exception.hpp\"\n#include \"Tools/Perf/Reorderer/Reorderer.hpp\"\n#include \"Module/Decoder/LDPC/BP/Horizontal_layered/Decoder_LDPC_BP_horizontal_layered_inter.hpp\"\n@@ -54,6 +55,8 @@ Decoder_LDPC_BP_horizontal_layered_inter<B,R,Update_rule>\nconst std::string name = \"Decoder_LDPC_BP_horizontal_layered_inter<\" + this->up_rule.get_name() + \">\";\nthis->set_name(name);\n+ tools::check_LUT(info_bits_pos, \"info_bits_pos\", (size_t)K);\n+\nif (this->sat_val <= 0)\n{\nstd::stringstream message;\n"
},
{
"change_type": "MODIFY",
"old_path": "include/Module/Decoder/LDPC/BP/Vertical_layered/Decoder_LDPC_BP_vertical_layered.hxx",
"new_path": "include/Module/Decoder/LDPC/BP/Vertical_layered/Decoder_LDPC_BP_vertical_layered.hxx",
"diff": "#include <string>\n#include <cmath>\n+#include \"Tools/general_utils.h\"\n#include \"Tools/Perf/common/hard_decide.h\"\n#include \"Module/Decoder/LDPC/BP/Vertical_layered/Decoder_LDPC_BP_vertical_layered.hpp\"\n@@ -33,6 +34,8 @@ Decoder_LDPC_BP_vertical_layered<B,R,Update_rule>\nconst std::string name = \"Decoder_LDPC_BP_vertical_layered<\" + this->up_rule.get_name() + \">\";\nthis->set_name(name);\n+ tools::check_LUT(info_bits_pos, \"info_bits_pos\", (size_t)K);\n+\nsize_t cur_off_msg = 0;\nconst auto n_chk_nodes = (int)this->H.get_n_cols();\nfor (auto c = 0; c < n_chk_nodes; c++)\n"
},
{
"change_type": "MODIFY",
"old_path": "include/Module/Decoder/LDPC/BP/Vertical_layered/Decoder_LDPC_BP_vertical_layered_inter.hxx",
"new_path": "include/Module/Decoder/LDPC/BP/Vertical_layered/Decoder_LDPC_BP_vertical_layered_inter.hxx",
"diff": "#include <sstream>\n#include <algorithm>\n+#include \"Tools/general_utils.h\"\n#include \"Tools/Exception/exception.hpp\"\n#include \"Tools/Perf/Reorderer/Reorderer.hpp\"\n#include \"Module/Decoder/LDPC/BP/Horizontal_layered/Decoder_LDPC_BP_horizontal_layered_inter.hpp\"\n@@ -40,6 +41,8 @@ Decoder_LDPC_BP_vertical_layered_inter<B,R,Update_rule>\nconst std::string name = \"Decoder_LDPC_BP_vertical_layered_inter<\" + this->up_rule.get_name() + \">\";\nthis->set_name(name);\n+ tools::check_LUT(info_bits_pos, \"info_bits_pos\", (size_t)K);\n+\nif (this->sat_val <= 0)\n{\nstd::stringstream message;\n"
},
{
"change_type": "MODIFY",
"old_path": "include/Module/Encoder/LDPC/From_H/Encoder_LDPC_from_H.hpp",
"new_path": "include/Module/Encoder/LDPC/From_H/Encoder_LDPC_from_H.hpp",
"diff": "@@ -23,9 +23,9 @@ private:\nstatic std::thread::id master_thread_id;\npublic:\n- Encoder_LDPC_from_H(const int K, const int N, const tools::Sparse_matrix &H, const std::string& G_method = \"FAST\",\n- const std::string& G_save_path = \"\", const bool G_save_path_single_thread = true,\n- const int n_frames = 1);\n+ Encoder_LDPC_from_H(const int K, const int N, const tools::Sparse_matrix &H,\n+ const std::string& G_method = \"IDENTITY\", const std::string& G_save_path = \"\",\n+ const bool G_save_path_single_thread = true, const int n_frames = 1);\nvirtual ~Encoder_LDPC_from_H() = default;\nvirtual Encoder_LDPC_from_H<B>* clone() const;\n"
},
{
"change_type": "MODIFY",
"old_path": "include/Tools/general_utils.h",
"new_path": "include/Tools/general_utils.h",
"diff": "@@ -103,6 +103,9 @@ std::vector<T*> convert_to_ptr(const std::vector<std::unique_ptr<T>> &v);\ntemplate <typename T>\nstd::vector<T*> convert_to_ptr(const std::vector<std::shared_ptr<T>> &v);\n+template <typename T>\n+void check_LUT(const std::vector<T> &LUT, const std::string &LUT_name = \"LUT\", const size_t LUT_size = 0);\n+\n}\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "src/Module/Decoder/LDPC/BF/Decoder_LDPC_bit_flipping.cpp",
"new_path": "src/Module/Decoder/LDPC/BF/Decoder_LDPC_bit_flipping.cpp",
"diff": "#include <limits>\n#include <cmath>\n+#include \"Tools/general_utils.h\"\n#include \"Tools/Perf/common/hard_decide.h\"\n#include \"Tools/Exception/exception.hpp\"\n#include \"Module/Decoder/LDPC/BF/Decoder_LDPC_bit_flipping.hpp\"\n@@ -41,6 +42,8 @@ Decoder_LDPC_bit_flipping<B,R>\nconst std::string name = \"Decoder_LDPC_bit_flipping\";\nthis->set_name(name);\n+ tools::check_LUT(info_bits_pos, \"info_bits_pos\", (size_t)K);\n+\n/*if (n_ite <= 0)\n{\nstd::stringstream message;\n"
},
{
"change_type": "MODIFY",
"old_path": "src/Module/Decoder/LDPC/BF/Decoder_LDPC_bit_flipping_hard.cpp",
"new_path": "src/Module/Decoder/LDPC/BF/Decoder_LDPC_bit_flipping_hard.cpp",
"diff": "#include <sstream>\n#include <string>\n+#include \"Tools/general_utils.h\"\n#include \"Tools/Perf/common/hard_decide.h\"\n#include \"Tools/Exception/exception.hpp\"\n#include \"Module/Decoder/LDPC/BF/Decoder_LDPC_bit_flipping_hard.hpp\"\n@@ -33,6 +34,8 @@ Decoder_LDPC_bit_flipping_hard<B,R>\nconst std::string name = \"Decoder_LDPC_bit_flipping_hard\";\nthis->set_name(name);\n+ tools::check_LUT<unsigned>(info_bits_pos, \"info_bits_pos\", (size_t)K);\n+\nif (n_ite <= 0)\n{\nstd::stringstream message;\n"
},
{
"change_type": "MODIFY",
"old_path": "src/Module/Decoder/LDPC/BP/Flooding/Gallager/Decoder_LDPC_BP_flooding_Gallager_A.cpp",
"new_path": "src/Module/Decoder/LDPC/BP/Flooding/Gallager/Decoder_LDPC_BP_flooding_Gallager_A.cpp",
"diff": "#include <sstream>\n#include <numeric>\n+#include \"Tools/general_utils.h\"\n#include \"Tools/Perf/common/hard_decide.h\"\n#include \"Tools/Exception/exception.hpp\"\n#include \"Tools/Math/utils.h\"\n@@ -28,6 +29,8 @@ Decoder_LDPC_BP_flooding_Gallager_A<B,R>\nconst std::string name = \"Decoder_LDPC_BP_flooding_Gallager_A\";\nthis->set_name(name);\n+ tools::check_LUT(info_bits_pos, \"info_bits_pos\", (size_t)K);\n+\nstd::vector<unsigned char> connections(this->H.get_n_rows(), 0);\nconst auto &chk_to_var_id = this->H.get_col_to_rows();\n"
},
{
"change_type": "MODIFY",
"old_path": "src/Module/Decoder/LDPC/BP/Horizontal_layered/ONMS/Decoder_LDPC_BP_horizontal_layered_ONMS_inter.cpp",
"new_path": "src/Module/Decoder/LDPC/BP/Horizontal_layered/ONMS/Decoder_LDPC_BP_horizontal_layered_ONMS_inter.cpp",
"diff": "#include <limits>\n#include <cmath>\n+#include \"Tools/general_utils.h\"\n#include \"Tools/Exception/exception.hpp\"\n#include \"Tools/Perf/Reorderer/Reorderer.hpp\"\n#include \"Module/Decoder/LDPC/BP/Horizontal_layered/ONMS/Decoder_LDPC_BP_horizontal_layered_ONMS_inter.hpp\"\n@@ -36,6 +37,8 @@ Decoder_LDPC_BP_horizontal_layered_ONMS_inter<B,R>\nconst std::string name = \"Decoder_LDPC_BP_horizontal_layered_ONMS_inter\";\nthis->set_name(name);\n+ tools::check_LUT(info_bits_pos, \"info_bits_pos\", (size_t)K);\n+\nif (sizeof(R) == 1)\nthrow tools::runtime_error(__FILE__, __LINE__, __func__, \"This decoder does not work in 8-bit fixed-point.\");\n"
},
{
"change_type": "MODIFY",
"old_path": "src/Module/Decoder/LDPC/BP/Peeling/Decoder_LDPC_BP_peeling.cpp",
"new_path": "src/Module/Decoder/LDPC/BP/Peeling/Decoder_LDPC_BP_peeling.cpp",
"diff": "#include <algorithm>\n#include <string>\n+#include \"Tools/general_utils.h\"\n#include \"Tools/Perf/common/hard_decide.h\"\n#include \"Tools/Noise/noise_utils.h\"\n#include \"Module/Decoder/LDPC/BP/Peeling/Decoder_LDPC_BP_peeling.hpp\"\n@@ -22,6 +23,8 @@ Decoder_LDPC_BP_peeling<B,R>::Decoder_LDPC_BP_peeling(const int K, const int N,\n{\nconst std::string name = \"Decoder_LDPC_BP_peeling\";\nthis->set_name(name);\n+\n+ tools::check_LUT(info_bits_pos, \"info_bits_pos\", (size_t)K);\n}\ntemplate <typename B, typename R>\n"
},
{
"change_type": "MODIFY",
"old_path": "src/Tools/general_utils.cpp",
"new_path": "src/Tools/general_utils.cpp",
"diff": "+#include <map>\n#include <cmath>\n#include <limits>\n#include <sstream>\n+#include <cstdint>\n#include <algorithm>\n#include \"Tools/Math/utils.h\"\n@@ -174,6 +176,33 @@ std::vector<R> aff3ct::tools::generate_range(const std::vector<std::vector<R>>&\nreturn rangeR;\n}\n+template <typename T>\n+void aff3ct::tools::check_LUT(const std::vector<T> &LUT, const std::string &LUT_name, const size_t LUT_size)\n+{\n+ std::map<T, unsigned> count_map;\n+\n+ if (LUT_size != 0 && LUT.size() != LUT_size)\n+ {\n+ std::stringstream message;\n+ message << \"'\" + LUT_name + \".size()' has to be equal to '\" << LUT_size << \"' ('\" << LUT_name << \".size()' = \"\n+ << LUT.size() << \", 'LUT_size' = \" << LUT_size << \").\";\n+ throw invalid_argument(__FILE__, __LINE__, __func__, message.str());\n+ }\n+\n+ for (size_t i = 0; i < LUT.size(); i++)\n+ {\n+ count_map[LUT[i]]++;\n+ if (count_map[LUT[i]] != 1)\n+ {\n+ std::stringstream message;\n+ message << \"The '\" << LUT_name << \"' vector is ill-formed, it sould not contain two or more times the same \"\n+ << \"value ('count_map[\" << LUT[i] << \"]' = \" << count_map[LUT[i]] << \", \"\n+ << \"'LUT[\" << i << \"]' = \" << LUT[i] << \").\";\n+ throw invalid_argument(__FILE__, __LINE__, __func__, message.str());\n+ }\n+ }\n+}\n+\n// ==================================================================================== explicit template instantiation\ntemplate float aff3ct::tools::sigma_to_esn0<float >(const float, const int);\ntemplate double aff3ct::tools::sigma_to_esn0<double>(const double, const int);\n@@ -185,4 +214,8 @@ template float aff3ct::tools::ebn0_to_esn0 <float >(const float, const float,\ntemplate double aff3ct::tools::ebn0_to_esn0 <double>(const double, const double, const int);\ntemplate std::vector<float > aff3ct::tools::generate_range(const std::vector<std::vector<float >>&, const float );\ntemplate std::vector<double> aff3ct::tools::generate_range(const std::vector<std::vector<double>>&, const double);\n+template void aff3ct::tools::check_LUT<uint8_t >(const std::vector<uint8_t >&, const std::string&, const size_t);\n+template void aff3ct::tools::check_LUT<uint16_t>(const std::vector<uint16_t>&, const std::string&, const size_t);\n+template void aff3ct::tools::check_LUT<uint32_t>(const std::vector<uint32_t>&, const std::string&, const size_t);\n+template void aff3ct::tools::check_LUT<uint64_t>(const std::vector<uint64_t>&, const std::string&, const size_t);\n// ==================================================================================== explicit template instantiation\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
Check the `info_bits_pos` vector in the LDPC decoders.
|
8,490 |
28.10.2020 17:22:59
| -3,600 |
3c0b716e26eaa763918d08bf16c835981aa02dd4
|
Add a new `set_n_frames` method in the `Module` class.
|
[
{
"change_type": "MODIFY",
"old_path": "include/Module/Decoder/Decoder_HIHO.hpp",
"new_path": "include/Module/Decoder/Decoder_HIHO.hpp",
"diff": "@@ -71,6 +71,8 @@ public:\nvirtual int decode_hiho_cw(const B *Y_N, B *V_N, const int frame_id = -1);\n+ virtual void set_n_frames(const int n_frames);\n+\nprotected:\nvirtual int _decode_hiho(const B *Y_N, B *V_K, const int frame_id);\n"
},
{
"change_type": "MODIFY",
"old_path": "include/Module/Decoder/Decoder_HIHO.hxx",
"new_path": "include/Module/Decoder/Decoder_HIHO.hxx",
"diff": "@@ -314,5 +314,21 @@ int Decoder_HIHO<B>\nthrow tools::unimplemented_error(__FILE__, __LINE__, __func__);\n}\n+template <typename B>\n+void Decoder_HIHO<B>\n+::set_n_frames(const int n_frames)\n+{\n+ const auto old_n_frames = this->get_n_frames();\n+ Module::set_n_frames(n_frames);\n+\n+ const auto old_Y_N_size = this->Y_N.size();\n+ const auto new_Y_N_size = (old_Y_N_size / old_n_frames) * old_n_frames;\n+ this->Y_N.resize(new_Y_N_size);\n+\n+ const auto old_V_KN_size = this->V_KN.size();\n+ const auto new_V_KN_size = (old_V_KN_size / old_n_frames) * old_n_frames;\n+ this->V_KN.resize(new_V_KN_size);\n+}\n+\n}\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "include/Module/Decoder/Decoder_SIHO.hpp",
"new_path": "include/Module/Decoder/Decoder_SIHO.hpp",
"diff": "@@ -74,6 +74,8 @@ public:\nvirtual int decode_siho_cw(const R *Y_N, B *V_N, const int frame_id = -1);\n+ virtual void set_n_frames(const int n_frames);\n+\nprotected:\nvirtual int _decode_siho(const R *Y_N, B *V_K, const int frame_id);\n"
},
{
"change_type": "MODIFY",
"old_path": "include/Module/Decoder/Decoder_SIHO.hxx",
"new_path": "include/Module/Decoder/Decoder_SIHO.hxx",
"diff": "@@ -343,6 +343,22 @@ int Decoder_SIHO<B,R>\nreturn this->_decode_siho_cw(this->Y_N.data(), V_N, frame_id);\n}\n+template <typename B, typename R>\n+void Decoder_SIHO<B,R>\n+::set_n_frames(const int n_frames)\n+{\n+ const auto old_n_frames = this->get_n_frames();\n+ Decoder_HIHO<B>::set_n_frames(n_frames);\n+\n+ const auto old_Y_N_size = this->Y_N.size();\n+ const auto new_Y_N_size = (old_Y_N_size / old_n_frames) * old_n_frames;\n+ this->Y_N.resize(new_Y_N_size);\n+\n+ const auto old_V_KN_size = this->V_KN.size();\n+ const auto new_V_KN_size = (old_V_KN_size / old_n_frames) * old_n_frames;\n+ this->V_KN.resize(new_V_KN_size);\n+}\n+\n}\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "include/Module/Decoder/Decoder_SISO.hpp",
"new_path": "include/Module/Decoder/Decoder_SISO.hpp",
"diff": "@@ -88,6 +88,8 @@ public:\n*/\nvirtual int tail_length() const;\n+ virtual void set_n_frames(const int n_frames);\n+\nprotected:\nvirtual int _decode_siso(const R *sys, const R *par, R *ext, const int frame_id);\n"
},
{
"change_type": "MODIFY",
"old_path": "include/Module/Decoder/Decoder_SISO.hxx",
"new_path": "include/Module/Decoder/Decoder_SISO.hxx",
"diff": "@@ -296,5 +296,21 @@ int Decoder_SISO<B,R>\nthrow tools::unimplemented_error(__FILE__, __LINE__, __func__);\n}\n+template <typename B, typename R>\n+void Decoder_SISO<B, R>\n+::set_n_frames(const int n_frames)\n+{\n+ const auto old_n_frames = this->get_n_frames();\n+ Decoder_SIHO<B,R>::set_n_frames(n_frames);\n+\n+ const auto old_Y_N1_size = this->Y_N1.size();\n+ const auto new_Y_N1_size = (old_Y_N1_size / old_n_frames) * old_n_frames;\n+ this->Y_N1.resize(new_Y_N1_size);\n+\n+ const auto old_Y_N2_size = this->Y_N2.size();\n+ const auto new_Y_N2_size = (old_Y_N2_size / old_n_frames) * old_n_frames;\n+ this->Y_N2.resize(new_Y_N2_size);\n+}\n+\n}\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "include/Module/Module.hpp",
"new_path": "include/Module/Module.hpp",
"diff": "@@ -65,7 +65,9 @@ public:\n*\n* \\return the number of frames to process in this Module.\n*/\n- virtual int get_n_frames() const;\n+ int get_n_frames() const;\n+\n+ virtual void set_n_frames(const int n_frames);\nconst std::string& get_name() const;\n"
},
{
"change_type": "MODIFY",
"old_path": "include/Module/Socket.hpp",
"new_path": "include/Module/Socket.hpp",
"diff": "@@ -28,7 +28,7 @@ protected:\nconst std::string name;\nconst std::type_index datatype;\n- const size_t databytes;\n+ size_t databytes;\nbool fast;\nvoid* dataptr;\nstd::vector<Socket*> bound_sockets;\n@@ -77,6 +77,9 @@ public:\ninline void reset();\ninline size_t unbind(Socket& s_out);\n+\n+protected:\n+ inline void set_databytes(const size_t databytes);\n};\n}\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "include/Module/Socket.hxx",
"new_path": "include/Module/Socket.hxx",
"diff": "@@ -376,5 +376,11 @@ size_t Socket\nreturn unbind_pos;\n}\n+void Socket\n+::set_databytes(const size_t databytes)\n+{\n+ this->databytes = databytes;\n+}\n+\n}\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "include/Module/Task.hpp",
"new_path": "include/Module/Task.hpp",
"diff": "@@ -137,6 +137,8 @@ protected:\nvoid create_codelet(std::function<int(Module &m, Task& t)> &codelet);\n+ void update_n_frames(const size_t old_n_frames, const size_t new_n_frames);\n+\nprivate:\ntemplate <typename T>\ninline Socket& create_socket(const std::string &name, const size_t n_elmts, const bool hack_status = false);\n"
},
{
"change_type": "MODIFY",
"old_path": "src/Module/Module.cpp",
"new_path": "src/Module/Module.cpp",
"diff": "@@ -61,6 +61,27 @@ int Module\nreturn n_frames;\n}\n+void Module\n+::set_n_frames(const int n_frames)\n+{\n+#ifdef AFF3CT_SYSTEMC_MODULE\n+ std::stringstream message;\n+ message << \"'This feature is not supported with the SystemC/TLM interface.\";\n+ throw tools::invalid_argument(__FILE__, __LINE__, __func__, message.str());\n+#endif\n+\n+ if (n_frames <= 0)\n+ {\n+ std::stringstream message;\n+ message << \"'n_frames' has to be greater than 0 ('n_frames' = \" << n_frames << \").\";\n+ throw tools::invalid_argument(__FILE__, __LINE__, __func__, message.str());\n+ }\n+\n+ for (auto &t : tasks)\n+ t->update_n_frames((size_t)this->get_n_frames(), (size_t)n_frames);\n+ this->n_frames = n_frames;\n+}\n+\nvoid Module\n::set_name(const std::string &name)\n{\n"
},
{
"change_type": "MODIFY",
"old_path": "src/Module/Task.cpp",
"new_path": "src/Module/Task.cpp",
"diff": "@@ -443,10 +443,31 @@ void Task\n// create automatically a socket that contains the status of the task\nconst bool hack_status = true;\n- auto s = this->template create_socket_out<int>(\"status\", /*1*/this->get_module().get_n_frames(), hack_status);\n+ auto s = this->template create_socket_out<int>(\"status\", this->get_module().get_n_frames(), hack_status);\nthis->sockets[s]->dataptr = (void*)this->status.data();\n}\n+void Task\n+::update_n_frames(const size_t old_n_frames, const size_t new_n_frames)\n+{\n+ for (auto &s : this->sockets)\n+ {\n+ const auto old_databytes = s->get_databytes();\n+ const auto new_databytes = (old_databytes / old_n_frames) * new_n_frames;\n+ s->set_databytes(new_databytes);\n+ }\n+\n+ if (this->is_autoalloc())\n+ {\n+ for (auto &v : this->out_buffers)\n+ {\n+ const auto old_databytes = v.size();\n+ const auto new_databytes = (old_databytes / old_n_frames) * new_n_frames;\n+ v.resize(new_databytes);\n+ }\n+ }\n+}\n+\nbool Task\n::can_exec() const\n{\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
Add a new `set_n_frames` method in the `Module` class.
|
8,490 |
01.11.2020 19:36:36
| -3,600 |
028ec06941fbd1af8384c1bc1c1e8412e27682fe
|
Fix 'module::set_n_frames()' for 'module::Subsequence'.
|
[
{
"change_type": "MODIFY",
"old_path": "src/Module/Subsequence/Subsequence.cpp",
"new_path": "src/Module/Subsequence/Subsequence.cpp",
"diff": "@@ -174,11 +174,33 @@ void Subsequence\nconst auto old_n_frames = this->get_n_frames();\nif (old_n_frames != n_frames)\n{\n+ auto &p = *this->tasks[0];\n+ auto &lasts = this->get_sequence().get_lasts_tasks()[0];\n+ size_t sid = 0;\n+ for (auto &last : lasts) for (auto &s : last->sockets)\n+ {\n+ if (last->get_socket_type(*s) == socket_t::SOUT && s->get_name() != \"status\")\n+ {\n+ while (p.get_socket_type(*p.sockets[sid]) != socket_t::SOUT) sid++;\n+ p.sockets[sid++]->unbind(*s);\n+ }\n+ }\n+\nModule::set_n_frames(n_frames);\nif (this->sequence_extern)\nthis->sequence_extern->set_n_frames(n_frames);\nelse\nthis->sequence_cloned->set_n_frames(n_frames);\n+\n+ sid = 0;\n+ for (auto &last : lasts) for (auto &s : last->sockets)\n+ {\n+ if (last->get_socket_type(*s) == socket_t::SOUT && s->get_name() != \"status\")\n+ {\n+ while (p.get_socket_type(*p.sockets[sid]) != socket_t::SOUT) sid++;\n+ p.sockets[sid++]->bind(*s);\n+ }\n+ }\n}\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "src/Module/Task.cpp",
"new_path": "src/Module/Task.cpp",
"diff": "@@ -451,6 +451,7 @@ void Task\n::update_n_frames(const size_t old_n_frames, const size_t new_n_frames)\n{\nsize_t s_id = 0;\n+ size_t sout_id = 0;\nfor (auto &s : this->sockets)\n{\nif (s->get_name() != \"status\")\n@@ -461,24 +462,9 @@ void Task\nif (this->is_autoalloc() && this->socket_type[s_id] == socket_t::SOUT)\n{\n- const auto old_ptr = s->get_dataptr();\n- bool found = false;\n- for (auto &v : this->out_buffers)\n- {\n- if ((void*)v.data() == old_ptr)\n- {\n- v.resize(new_databytes);\n- s->set_dataptr((void*)v.data());\n- found = true;\n- break;\n- }\n- }\n- if (!found)\n- {\n- std::stringstream message;\n- message << \"This should never happen.\";\n- throw tools::runtime_error(__FILE__, __LINE__, __func__, message.str());\n- }\n+ this->out_buffers[sout_id].resize(new_databytes);\n+ s->set_dataptr((void*)this->out_buffers[sout_id].data());\n+ sout_id++;\n}\n}\ns_id++;\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
Fix 'module::set_n_frames()' for 'module::Subsequence'.
|
8,490 |
02.11.2020 10:47:24
| -3,600 |
236e4590d7cb68d5c295133f3a6c3a097a243132
|
Add 'set_n_frames()' for 'tools::Pipeline'.
|
[
{
"change_type": "MODIFY",
"old_path": "include/Module/Socket.hxx",
"new_path": "include/Module/Socket.hxx",
"diff": "@@ -381,16 +381,43 @@ void Socket\n{\nif (bound_sockets.size() != 0 || bound_socket != nullptr)\n{\n+ std::stringstream bound_sockets_str;\n+ if (bound_sockets.size() != 0)\n+ {\n+ bound_sockets_str << \", 'bound_sockets' = [\";\n+\n+ for (size_t bs = 0; bs < bound_sockets.size(); bs++)\n+ {\n+ bound_sockets_str << \"{\" << \"'name'\" << \" = \" << bound_sockets[bs]->get_name() << \", \"\n+ << \"'databytes'\" << \" = \" << bound_sockets[bs]->get_databytes() << \", \"\n+ << \"'task.name'\" << \" = \" << bound_sockets[bs]->get_task().get_name()\n+ << \"}\";\n+ if (bs < bound_sockets.size() -1)\n+ bound_sockets_str << \", \";\n+ }\n+\n+ bound_sockets_str << \"]\";\n+ }\n+ else if (bound_socket != nullptr)\n+ {\n+ bound_sockets_str << \", 'bound_socket' = \";\n+ bound_sockets_str << \"{\" << \"'name'\" << \" = \" << bound_socket->get_name() << \", \"\n+ << \"'databytes'\" << \" = \" << bound_socket->get_databytes() << \", \"\n+ << \"'task.name'\" << \" = \" << bound_socket->get_task().get_name()\n+ << \"}\";\n+ }\n+\nstd::stringstream message;\nmessage << \"The current socket is already bound, it is impossible to set new databytes (\"\n- << \"'cur_databytes'\" << \" = \" << get_databytes() << \", \"\n+ << \"'databytes'\" << \" = \" << get_databytes() << \", \"\n<< \"'new_databytes'\" << \" = \" << databytes << \", \"\n<< \"'name'\" << \" = \" << get_name() << \", \"\n<< \"'task.name'\" << \" = \" << task.get_name()\n-// << \"'task.module.name'\" << \" = \" << task.get_module_name()\n+ << bound_sockets_str.str()\n<< \").\";\nthrow tools::runtime_error(__FILE__, __LINE__, __func__, message.str());\n}\n+\nthis->databytes = databytes;\n}\n@@ -399,16 +426,44 @@ void Socket\n{\nif (bound_sockets.size() != 0 || bound_socket != nullptr)\n{\n+ std::stringstream bound_sockets_str;\n+ if (bound_sockets.size() != 0)\n+ {\n+ bound_sockets_str << \", 'bound_sockets' = [\";\n+\n+ for (size_t bs = 0; bs < bound_sockets.size(); bs++)\n+ {\n+ bound_sockets_str << \"{\" << \"'name'\" << \" = \" << bound_sockets[bs]->get_name() << \", \"\n+ << \"'databytes'\" << \" = \" << bound_sockets[bs]->get_databytes() << \", \"\n+ << \"'task.name'\" << \" = \" << bound_sockets[bs]->get_task().get_name()\n+ << \"}\";\n+ if (bs < bound_sockets.size() -1)\n+ bound_sockets_str << \", \";\n+ }\n+\n+ bound_sockets_str << \"]\";\n+ }\n+ else if (bound_socket != nullptr)\n+ {\n+ bound_sockets_str << \", 'bound_socket' = \";\n+ bound_sockets_str << \"{\" << \"'name'\" << \" = \" << bound_socket->get_name() << \", \"\n+ << \"'databytes'\" << \" = \" << bound_socket->get_databytes() << \", \"\n+ << \"'task.name'\" << \" = \" << bound_socket->get_task().get_name()\n+ << \"}\";\n+ }\n+\nstd::stringstream message;\nmessage << \"The current socket is already bound, it is impossible to set new dataptr (\"\n- << \"'cur_dataptr'\" << \" = \" << get_dataptr() << \", \"\n+ << \"'dataptr'\" << \" = \" << get_dataptr() << \", \"\n<< \"'new_dataptr'\" << \" = \" << dataptr << \", \"\n+ << \"'databytes'\" << \" = \" << get_databytes() << \", \"\n<< \"'name'\" << \" = \" << get_name() << \", \"\n<< \"'task.name'\" << \" = \" << task.get_name()\n-// << \"'task.module.name'\" << \" = \" << task.get_module_name()\n+ << bound_sockets_str.str()\n<< \").\";\nthrow tools::runtime_error(__FILE__, __LINE__, __func__, message.str());\n}\n+\nthis->dataptr = dataptr;\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "include/Tools/Sequence/Pipeline.hpp",
"new_path": "include/Tools/Sequence/Pipeline.hpp",
"diff": "@@ -134,10 +134,17 @@ public:\nvoid bind_adaptors();\nvoid unbind_adaptors();\n+ bool is_bound_adaptors() const;\n+\n+ int get_n_frames() const;\n+ void set_n_frames(const int n_frames);\nprotected:\nvoid create_adaptors(const std::vector<size_t> &synchro_buffer_sizes = {},\nconst std::vector<bool> &synchro_active_waiting = {});\n+\n+ void _bind_adaptors(const bool bind_adaptors = true);\n+ void _unbind_adaptors(const bool bind_orphans = true);\nprivate:\ntemplate <class TA>\nvoid init(const std::vector<TA*> &firsts,\n"
},
{
"change_type": "MODIFY",
"old_path": "src/Tools/Sequence/Pipeline.cpp",
"new_path": "src/Tools/Sequence/Pipeline.cpp",
"diff": "@@ -724,6 +724,12 @@ void Pipeline\nvoid Pipeline\n::bind_adaptors()\n+{\n+ this->_bind_adaptors(true);\n+}\n+\n+void Pipeline\n+::_bind_adaptors(const bool bind_adaptors)\n{\nif (!this->bound_adaptors)\n{\n@@ -799,6 +805,8 @@ void Pipeline\nsck_in->unbind(*sck_out);\n}\n+ if (bind_adaptors)\n+ {\nfor (auto &bind : this->adaptors_binds)\n{\nauto sck_out = std::get<0>(bind);\n@@ -806,6 +814,7 @@ void Pipeline\nauto priority = std::get<2>(bind);\nsck_in->bind(*sck_out, priority);\n}\n+ }\nthis->bound_adaptors = true;\n}\n@@ -813,6 +822,12 @@ void Pipeline\nvoid Pipeline\n::unbind_adaptors()\n+{\n+ this->_unbind_adaptors(true);\n+}\n+\n+void Pipeline\n+::_unbind_adaptors(const bool bind_orphans)\n{\nif (this->bound_adaptors)\n{\n@@ -863,7 +878,7 @@ void Pipeline\n}\n// ------------------------------------------------------------------------------------------------------------\n- // ---------------------------------------------------------------------------------------------- bind adaptors\n+ // -------------------------------------------------------------------------------------------- unbind adaptors\n// ------------------------------------------------------------------------------------------------------------\nfor (auto &bind : this->adaptors_binds)\n{\n@@ -872,6 +887,8 @@ void Pipeline\nsck_in->unbind(*sck_out);\n}\n+ if (bind_orphans)\n+ {\nfor (auto &bind : this->sck_orphan_binds)\n{\nauto sck_out = std::get<0>(bind.first);\n@@ -879,6 +896,7 @@ void Pipeline\nauto sck_in = std::get<0>(bind.second);\nsck_in->bind(*sck_out, priority);\n}\n+ }\nthis->bound_adaptors = false;\n}\n@@ -962,7 +980,7 @@ void Pipeline\nm->cancel_waiting();\n};\n- std::vector<std::thread> threads;;\n+ std::vector<std::thread> threads;\nfor (size_t s = 0; s < stages.size() -1; s++)\n{\nauto &stage = stages[s];\n@@ -1159,3 +1177,60 @@ void Pipeline\nstream << \"}\" << std::endl;\n}\n+\n+bool Pipeline\n+::is_bound_adaptors() const\n+{\n+ return this->bound_adaptors;\n+}\n+\n+int Pipeline\n+::get_n_frames() const\n+{\n+ const auto n_frames = this->stages[0]->get_n_frames();\n+\n+ for (auto &sta : this->stages)\n+ if (sta->get_n_frames() != n_frames)\n+ {\n+ std::stringstream message;\n+ message << \"All the stages/sequences do not have the same 'n_frames' value ('sta->get_n_frames()' = \"\n+ << sta->get_n_frames() << \", 'n_frames' = \" << n_frames << \").\";\n+ throw tools::runtime_error(__FILE__, __LINE__, __func__, message.str());\n+ }\n+\n+ return n_frames;\n+}\n+\n+void Pipeline\n+::set_n_frames(const int n_frames)\n+{\n+ const auto save_bound_adaptors = this->is_bound_adaptors();\n+ if (!save_bound_adaptors)\n+ this->bind_adaptors();\n+ this->_unbind_adaptors(false);\n+\n+ // set the new \"n_frames\" val in the sequences\n+ for (auto &sta : this->stages)\n+ sta->set_n_frames(n_frames);\n+\n+ // set the new \"n_frames\" val in the adaptors\n+ for (auto &adps : this->adaptors)\n+ {\n+ for (auto &adp : adps.first)\n+ adp->set_n_frames(n_frames);\n+ for (auto &adp : adps.second)\n+ adp->set_n_frames(n_frames);\n+ }\n+\n+ // bind orphans to complete the unbind of the adaptors\n+ for (auto &bind : this->sck_orphan_binds)\n+ {\n+ auto sck_out = std::get<0>(bind.first);\n+ auto priority = std::get<4>(bind.first);\n+ auto sck_in = std::get<0>(bind.second);\n+ sck_in->bind(*sck_out, priority);\n+ }\n+\n+ if (save_bound_adaptors)\n+ this->bind_adaptors();\n+}\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
Add 'set_n_frames()' for 'tools::Pipeline'.
|
8,490 |
02.11.2020 14:27:33
| -3,600 |
84aff546974a39ecef6c56e7f59cbeb156fd11d6
|
Add 'set_name' and 'set_datatype' to the 'module::Socket'.
|
[
{
"change_type": "MODIFY",
"old_path": "include/Module/Socket.hpp",
"new_path": "include/Module/Socket.hpp",
"diff": "@@ -26,8 +26,8 @@ class Socket : public tools::Interface_reset\nprotected:\nTask &task;\n- const std::string name;\n- const std::type_index datatype;\n+ std::string name;\n+ std::type_index datatype;\nsize_t databytes;\nbool fast;\nvoid* dataptr;\n@@ -79,6 +79,10 @@ public:\ninline size_t unbind(Socket& s_out);\nprotected:\n+ inline void set_name(const std::string &name);\n+\n+ inline void set_datatype(const std::type_index datatype);\n+\ninline void set_databytes(const size_t databytes);\ninline void set_dataptr(void* dataptr);\n"
},
{
"change_type": "MODIFY",
"old_path": "include/Module/Socket.hxx",
"new_path": "include/Module/Socket.hxx",
"diff": "@@ -28,6 +28,15 @@ Socket\nconst bool fast, void *dataptr)\n: task(task), name(name), datatype(datatype), databytes(databytes), fast(fast), dataptr(dataptr), bound_socket(nullptr)\n{\n+ if (databytes % type_to_size[datatype] != 0)\n+ {\n+ std::stringstream message;\n+ message << \"'databytes % type_to_size[datatype]' has to be equal to 0 (\"\n+ << \"'databytes'\" << \" = \" << databytes << \", \"\n+ << \"'type_to_size[datatype]'\" << \" = \" << type_to_size[datatype] << \", \"\n+ << \"'datatype'\" << \" = \" << type_to_string[datatype] << \").\";\n+ throw tools::runtime_error(__FILE__, __LINE__, __func__, message.str());\n+ }\n}\nconst std::string& Socket\n@@ -376,8 +385,117 @@ size_t Socket\nreturn unbind_pos;\n}\n+void Socket\n+::set_name(const std::string &name)\n+{\n+ if (name != this->get_name())\n+ {\n+ if (bound_sockets.size() != 0 || bound_socket != nullptr)\n+ {\n+ std::stringstream bound_sockets_str;\n+ if (bound_sockets.size() != 0)\n+ {\n+ bound_sockets_str << \", 'bound_sockets' = [\";\n+\n+ for (size_t bs = 0; bs < bound_sockets.size(); bs++)\n+ {\n+ bound_sockets_str << \"{\" << \"'name'\" << \" = \" << bound_sockets[bs]->get_name() << \", \"\n+ << \"'databytes'\" << \" = \" << bound_sockets[bs]->get_databytes() << \", \"\n+ << \"'task.name'\" << \" = \" << bound_sockets[bs]->get_task().get_name()\n+ << \"}\";\n+ if (bs < bound_sockets.size() -1)\n+ bound_sockets_str << \", \";\n+ }\n+\n+ bound_sockets_str << \"]\";\n+ }\n+ else if (bound_socket != nullptr)\n+ {\n+ bound_sockets_str << \", 'bound_socket' = \";\n+ bound_sockets_str << \"{\" << \"'name'\" << \" = \" << bound_socket->get_name() << \", \"\n+ << \"'databytes'\" << \" = \" << bound_socket->get_databytes() << \", \"\n+ << \"'task.name'\" << \" = \" << bound_socket->get_task().get_name()\n+ << \"}\";\n+ }\n+\n+ std::stringstream message;\n+ message << \"The current socket is already bound, it is impossible to set new name (\"\n+ << \"'databytes'\" << \" = \" << get_databytes() << \", \"\n+ << \"'name'\" << \" = \" << get_name() << \", \"\n+ << \"'new_name'\" << \" = \" << name << \", \"\n+ << \"'task.name'\" << \" = \" << task.get_name()\n+ << bound_sockets_str.str()\n+ << \").\";\n+ throw tools::runtime_error(__FILE__, __LINE__, __func__, message.str());\n+ }\n+\n+ this->name = name;\n+ }\n+}\n+\n+void Socket\n+::set_datatype(const std::type_index datatype)\n+{\n+ if (datatype != this->get_datatype())\n+ {\n+ if (bound_sockets.size() != 0 || bound_socket != nullptr)\n+ {\n+ std::stringstream bound_sockets_str;\n+ if (bound_sockets.size() != 0)\n+ {\n+ bound_sockets_str << \", 'bound_sockets' = [\";\n+\n+ for (size_t bs = 0; bs < bound_sockets.size(); bs++)\n+ {\n+ bound_sockets_str << \"{\" << \"'name'\" << \" = \" << bound_sockets[bs]->get_name() << \", \"\n+ << \"'databytes'\" << \" = \" << bound_sockets[bs]->get_databytes() << \", \"\n+ << \"'task.name'\" << \" = \" << bound_sockets[bs]->get_task().get_name()\n+ << \"}\";\n+ if (bs < bound_sockets.size() -1)\n+ bound_sockets_str << \", \";\n+ }\n+\n+ bound_sockets_str << \"]\";\n+ }\n+ else if (bound_socket != nullptr)\n+ {\n+ bound_sockets_str << \", 'bound_socket' = \";\n+ bound_sockets_str << \"{\" << \"'name'\" << \" = \" << bound_socket->get_name() << \", \"\n+ << \"'databytes'\" << \" = \" << bound_socket->get_databytes() << \", \"\n+ << \"'task.name'\" << \" = \" << bound_socket->get_task().get_name()\n+ << \"}\";\n+ }\n+\n+ std::stringstream message;\n+ message << \"The current socket is already bound, it is impossible to set new datatype (\"\n+ << \"'databytes'\" << \" = \" << get_databytes() << \", \"\n+ << \"'name'\" << \" = \" << get_name() << \", \"\n+ << \"'datatype'\" << \" = \" << get_datatype_string() << \", \"\n+ << \"'new_datatype'\" << \" = \" << type_to_string[datatype] << \", \"\n+ << \"'task.name'\" << \" = \" << task.get_name()\n+ << bound_sockets_str.str()\n+ << \").\";\n+ throw tools::runtime_error(__FILE__, __LINE__, __func__, message.str());\n+ }\n+\n+ if (this->get_databytes() % type_to_size[datatype] != 0)\n+ {\n+ std::stringstream message;\n+ message << \"'databytes % type_to_size[datatype]' has to be equal to 0 (\"\n+ << \"'databytes'\" << \" = \" << this->get_databytes() << \", \"\n+ << \"'type_to_size[datatype]'\" << \" = \" << type_to_size[datatype] << \", \"\n+ << \"'datatype'\" << \" = \" << type_to_string[datatype] << \").\";\n+ throw tools::runtime_error(__FILE__, __LINE__, __func__, message.str());\n+ }\n+\n+ this->datatype = datatype;\n+ }\n+}\n+\nvoid Socket\n::set_databytes(const size_t databytes)\n+{\n+ if (databytes != this->get_databytes())\n{\nif (bound_sockets.size() != 0 || bound_socket != nullptr)\n{\n@@ -418,11 +536,24 @@ void Socket\nthrow tools::runtime_error(__FILE__, __LINE__, __func__, message.str());\n}\n+ if (databytes % type_to_size[this->datatype] != 0)\n+ {\n+ std::stringstream message;\n+ message << \"'databytes % type_to_size[datatype]' has to be equal to 0 (\"\n+ << \"'databytes'\" << \" = \" << databytes << \", \"\n+ << \"'type_to_size[datatype]'\" << \" = \" << type_to_size[this->datatype] << \", \"\n+ << \"'datatype'\" << \" = \" << type_to_string[this->datatype] << \").\";\n+ throw tools::runtime_error(__FILE__, __LINE__, __func__, message.str());\n+ }\n+\nthis->databytes = databytes;\n}\n+}\nvoid Socket\n::set_dataptr(void* dataptr)\n+{\n+ if (dataptr != this->get_dataptr())\n{\nif (bound_sockets.size() != 0 || bound_socket != nullptr)\n{\n@@ -466,6 +597,7 @@ void Socket\nthis->dataptr = dataptr;\n}\n+}\n}\n}\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
Add 'set_name' and 'set_datatype' to the 'module::Socket'.
|
8,490 |
09.11.2020 17:36:13
| -3,600 |
77f7f3ea1dc8490be029877d98245b0d38441715
|
Fix BER/FER performance regression.
|
[
{
"change_type": "MODIFY",
"old_path": "src/Module/Channel/Rayleigh/Channel_Rayleigh_LLR.cpp",
"new_path": "src/Module/Channel/Rayleigh/Channel_Rayleigh_LLR.cpp",
"diff": "@@ -167,7 +167,8 @@ void Channel_Rayleigh_LLR<R>\n}\nelse // n_frames_per_wave = 1\n{\n- gaussian_generator->generate(this->gains .data() + frame_id * this->N, this->N, (R)1 / (R)std::sqrt((R)2));\n+ const auto gains_size = this->complex ? this->N : 2 * this->N;\n+ gaussian_generator->generate(this->gains .data() + frame_id * this->N, gains_size, (R)1 / (R)std::sqrt((R)2));\ngaussian_generator->generate(this->noised_data.data() + frame_id * this->N, this->N, (R)this->noise->get_value());\nif (this->complex)\n"
},
{
"change_type": "MODIFY",
"old_path": "src/Module/Channel/Rayleigh/Channel_Rayleigh_LLR_user.cpp",
"new_path": "src/Module/Channel/Rayleigh/Channel_Rayleigh_LLR_user.cpp",
"diff": "@@ -166,8 +166,6 @@ void Channel_Rayleigh_LLR_user<R>\ntemplate <typename R>\nvoid Channel_Rayleigh_LLR_user<R>\n::_add_noise_wg(const R *X_N, R *H_N, R *Y_N, const size_t frame_id)\n-{\n- if (add_users && this->n_frames > 1)\n{\n// get all the needed gains from the stock\nfor (unsigned i = 0; i < gains.size(); ++i)\n@@ -195,7 +193,6 @@ void Channel_Rayleigh_LLR_user<R>\nY_N[i] = X_N[i] * H_N[i] + this->noised_data[i];\n}\n}\n-}\ntemplate<typename R>\nvoid Channel_Rayleigh_LLR_user<R>\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
Fix BER/FER performance regression.
|
8,490 |
11.11.2020 10:05:38
| -3,600 |
ec2f6ad76b665774d8e1c40c782cab89e7f44ad9
|
Fix subsequence.
|
[
{
"change_type": "MODIFY",
"old_path": "include/Tools/Sequence/Sequence.hpp",
"new_path": "include/Tools/Sequence/Sequence.hpp",
"diff": "@@ -139,7 +139,7 @@ public:\nvoid exec(std::function<bool(const std::vector<const std::vector<int>*>&)> stop_condition);\nvoid exec(std::function<bool( )> stop_condition);\n- void exec(const size_t tid = 0 );\n+ void exec(const size_t tid = 0, const int frame_id = -1 );\ninline size_t get_n_threads() const;\ntemplate <class C = module::Module>\n"
},
{
"change_type": "MODIFY",
"old_path": "src/Module/Subsequence/Subsequence.cpp",
"new_path": "src/Module/Subsequence/Subsequence.cpp",
"diff": "@@ -121,7 +121,8 @@ void Subsequence\n}\n}\n- ss.get_sequence().exec(-1); // execute all frames\n+ // execute all frames\n+ ss.get_sequence().exec();\nreturn status_t::SUCCESS;\n});\n"
},
{
"change_type": "MODIFY",
"old_path": "src/Tools/Sequence/Sequence.cpp",
"new_path": "src/Tools/Sequence/Sequence.cpp",
"diff": "@@ -621,7 +621,7 @@ void Sequence\n}\nvoid Sequence\n-::exec(const size_t tid)\n+::exec(const size_t tid, const int frame_id)\n{\nif (tid >= this->sequences.size())\n{\n@@ -632,13 +632,13 @@ void Sequence\n}\nstd::function<void(Generic_node<Sub_sequence>*)> exec_sequence =\n- [&exec_sequence](Generic_node<Sub_sequence>* cur_ss)\n+ [&exec_sequence, frame_id](Generic_node<Sub_sequence>* cur_ss)\n{\nauto type = cur_ss->get_c()->type;\nauto &tasks = cur_ss->get_c()->tasks;\nif (type == subseq_t::LOOP)\n{\n- while (!tasks[0]->exec()[0])\n+ while (!tasks[0]->exec(frame_id)[0])\nexec_sequence(cur_ss->get_children()[0]);\nstatic_cast<module::Loop&>(tasks[0]->get_module()).reset();\nexec_sequence(cur_ss->get_children()[1]);\n@@ -646,7 +646,7 @@ void Sequence\nelse\n{\nfor (size_t ta = 0; ta < tasks.size(); ta++)\n- tasks[ta]->exec();\n+ tasks[ta]->exec(frame_id);\nfor (auto c : cur_ss->get_children())\nexec_sequence(c);\n}\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
Fix subsequence.
|
8,490 |
12.11.2020 10:35:31
| -3,600 |
70dcf5f889046e1e3bee89f1bd8cd7d9e7cac16d
|
Fix 'tools::Pipeline' with no copy adaptors.
|
[
{
"change_type": "MODIFY",
"old_path": ".gitignore",
"new_path": ".gitignore",
"diff": "@@ -11,6 +11,7 @@ src_files.txt\n.fuse_*\n.idea/\n.vs\n+.vscode\nCMakeSettings.json\n.scannerwork/\n"
},
{
"change_type": "MODIFY",
"old_path": "include/Module/Adaptor/Adaptor_1_to_n.hxx",
"new_path": "include/Module/Adaptor/Adaptor_1_to_n.hxx",
"diff": "@@ -112,7 +112,7 @@ void Adaptor_1_to_n\nadp.wait_push();\n// for debug mode coherence\nfor (size_t s = 0; s < t.sockets.size() -1; s++)\n- t.sockets[s]->bind(adp.get_empty_buffer(s));\n+ t.sockets[s]->dataptr = adp.get_empty_buffer(s);\n}\nelse\n{\n"
},
{
"change_type": "MODIFY",
"old_path": "include/Module/Adaptor/Adaptor_n_to_1.hxx",
"new_path": "include/Module/Adaptor/Adaptor_n_to_1.hxx",
"diff": "@@ -112,7 +112,7 @@ void Adaptor_n_to_1\nadp.wait_push();\n// for debug mode coherence\nfor (size_t s = 0; s < t.sockets.size() -1; s++)\n- t.sockets[s]->bind(adp.get_empty_buffer(s));\n+ t.sockets[s]->dataptr = adp.get_empty_buffer(s);\n}\nelse\n{\n"
},
{
"change_type": "MODIFY",
"old_path": "include/Module/Interleaver/Interleaver.hxx",
"new_path": "include/Module/Interleaver/Interleaver.hxx",
"diff": "@@ -251,7 +251,7 @@ void Interleaver<D,T>\nif (!this->core.is_uniform())\n{\n// vectorized interleaving\n- if (this->get_n_frames_per_wave() == mipp::nElReg<D>())\n+ if (this->get_n_frames_per_wave() == (size_t)mipp::nElReg<D>())\n{\nfor (auto i = 0; i < this->core.get_size(); i++)\nmipp::store<D>(&out_vec[i * mipp::nElReg<D>()],\n"
},
{
"change_type": "MODIFY",
"old_path": "include/Module/Socket.hpp",
"new_path": "include/Module/Socket.hpp",
"diff": "#include \"Tools/Interface/Interface_reset.hpp\"\n#include \"Module/Task.hpp\"\n+namespace aff3ct { namespace tools { class Sequence; } }\n+\nnamespace aff3ct\n{\nnamespace module\n{\n+class Adaptor_n_to_1;\n+class Adaptor_1_to_n;\n+\nclass Socket : public tools::Interface_reset\n{\n#ifndef DOXYGEN_SHOULD_SKIP_THIS\nfriend Task;\n+ friend Adaptor_n_to_1;\n+ friend Adaptor_1_to_n;\n+ friend tools::Sequence;\n#endif\nprotected:\nTask &task;\n"
},
{
"change_type": "MODIFY",
"old_path": "src/Module/Decoder/Turbo/Decoder_turbo_fast.cpp",
"new_path": "src/Module/Decoder/Turbo/Decoder_turbo_fast.cpp",
"diff": "@@ -33,7 +33,7 @@ void Decoder_turbo_fast<B,R>\nconst auto tail_n = this->siso_n->tail_length();\nconst auto tail_i = this->siso_i->tail_length();\n- if (this->get_n_frames_per_wave() == mipp::nElReg<B>())\n+ if (this->get_n_frames_per_wave() == (size_t)mipp::nElReg<B>())\n{\nconstexpr auto n_frames = mipp::nElReg<R>();\n@@ -205,7 +205,7 @@ void Decoder_turbo_fast<B,R>\n{\nif (this->get_n_frames_per_wave() > 1)\n{\n- if (this->get_n_frames_per_wave() == mipp::nElReg<B>())\n+ if (this->get_n_frames_per_wave() == (size_t)mipp::nElReg<B>())\n{\nconstexpr auto n_frames = mipp::nElReg<B>();\n"
},
{
"change_type": "MODIFY",
"old_path": "src/Tools/Sequence/Pipeline.cpp",
"new_path": "src/Tools/Sequence/Pipeline.cpp",
"diff": "@@ -571,6 +571,8 @@ void Pipeline\nfor (size_t t = 0; t < n_threads; t++)\n{\nmodule::Adaptor* cur_adp = (t == 0) ? adp : adp->clone();\n+ for (auto &t : cur_adp->tasks)\n+ t->set_fast(true);\nif (t > 0)\n{\nthis->adaptors[sta -1].second.push_back(std::unique_ptr<module::Adaptor>(cur_adp));\n"
},
{
"change_type": "MODIFY",
"old_path": "src/Tools/Sequence/Sequence.cpp",
"new_path": "src/Tools/Sequence/Sequence.cpp",
"diff": "@@ -1234,11 +1234,11 @@ void Sequence\n// 'pull_task->exec()' call (this way the debug mode is still working)\nauto swap_buff = contents->rebind_sockets[rebind_id][sin_id][1]->get_dataptr();\nauto buff = adp_pull->get_filled_buffer(sin_id, swap_buff);\n- contents->rebind_sockets[rebind_id][sin_id][1]->bind(buff);\n+ contents->rebind_sockets[rebind_id][sin_id][1]->dataptr = buff;\n// for the next tasks the same buffer 'buff' is required, an easy mistake is to re-swap\n// and the data will be false, this is why we just bind 'buff'\nfor (size_t ta = 2; ta < contents->rebind_sockets[rebind_id][sin_id].size(); ta++)\n- contents->rebind_sockets[rebind_id][sin_id][ta]->bind(buff);\n+ contents->rebind_sockets[rebind_id][sin_id][ta]->dataptr = buff;\n}\n}\nadp_pull->wake_up_pusher();\n@@ -1314,11 +1314,11 @@ void Sequence\n// 'push_task->exec()' call (this way the debug mode is still working)\nauto swap_buff = contents->rebind_sockets[rebind_id][sout_id][1]->get_dataptr();\nauto buff = adp_push->get_empty_buffer(sout_id, swap_buff);\n- contents->rebind_sockets[rebind_id][sout_id][1]->bind(buff);\n+ contents->rebind_sockets[rebind_id][sout_id][1]->dataptr = buff;\n// the output socket linked to the push adp can have more than one socket bound and so\n// we have to rebind all the input sokects bound to the current output socket\nfor (size_t ta = 2; ta < contents->rebind_sockets[rebind_id][sout_id].size(); ta++)\n- contents->rebind_sockets[rebind_id][sout_id][ta]->bind(buff);\n+ contents->rebind_sockets[rebind_id][sout_id][ta]->dataptr = buff;\n}\nadp_push->wake_up_puller();\nreturn status;\n@@ -1383,8 +1383,8 @@ void Sequence\nfor (size_t rebind_id = 0; rebind_id < contents->rebind_sockets.size(); rebind_id++)\nfor (size_t s = 0; s < contents->rebind_sockets[rebind_id].size(); s++)\nfor (size_t ta = 0; ta < contents->rebind_sockets[rebind_id][s].size(); ta++)\n- contents->rebind_sockets[rebind_id][s][ta]\n- ->bind(contents->rebind_dataptrs[rebind_id][s][ta]);\n+ contents->rebind_sockets[rebind_id][s][ta]->dataptr =\n+ contents->rebind_dataptrs[rebind_id][s][ta];\n}\nfor (auto c : cur_node->get_children())\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
Fix 'tools::Pipeline' with no copy adaptors.
|
8,490 |
13.11.2020 17:05:17
| -3,600 |
a82bf8279062b347168117dade121e6af222d148
|
Fix 'module::Probe 'set_n_frames' method.
|
[
{
"change_type": "MODIFY",
"old_path": "include/Module/Probe/Probe.hxx",
"new_path": "include/Module/Probe/Probe.hxx",
"diff": "@@ -30,6 +30,7 @@ Probe<T>\nconst std::string name = \"Probe<\" + col_name + \">\";\nthis->set_name(name);\nthis->set_short_name(name);\n+ AProbe::set_n_frames(n_frames);\nif (size <= 0)\n{\n@@ -49,18 +50,20 @@ Probe<T>\nreturn status_t::SUCCESS;\n});\n-\n- AProbe::set_n_frames(n_frames);\n}\ntemplate <typename T>\nvoid Probe<T>\n::set_n_frames(const size_t n_frames)\n+{\n+ const size_t old_n_frames = this->get_n_frames();\n+ if (old_n_frames != n_frames)\n{\nstd::stringstream message;\nmessage << \"This method is disabled in the 'Probe' class.\";\nthrow tools::invalid_argument(__FILE__, __LINE__, __func__, message.str());\n}\n+}\ntemplate <typename T>\ntemplate <class AT>\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
Fix 'module::Probe 'set_n_frames' method.
|
8,490 |
13.11.2020 17:05:57
| -3,600 |
7f449d76d602dc42f03b733108ae2c17b7c7be3e
|
Fix 'module::Adaptor' return status in 'tools::Pipeline'.
|
[
{
"change_type": "MODIFY",
"old_path": "src/Tools/Sequence/Pipeline.cpp",
"new_path": "src/Tools/Sequence/Pipeline.cpp",
"diff": "@@ -759,7 +759,7 @@ void Pipeline\nauto ss = this->stages[sta]->sequences[t]->get_contents();\nassert(ss != nullptr);\nss->tasks .insert(ss->tasks.begin(), task_pull);\n- ss->processes.insert(ss->processes.begin(), [task_pull]() { return task_pull->exec(); });\n+ ss->processes.insert(ss->processes.begin(), [task_pull]() -> const std::vector<int>& { return task_pull->exec(); });\nthis->stages[sta]->update_tasks_id(t);\n}\nthis->stages[sta]->firsts_tasks_id.clear();\n@@ -786,7 +786,7 @@ void Pipeline\nauto ss = this->stages[sta]->get_last_subsequence(t);\nassert(ss != nullptr);\nss->tasks .push_back(task_push);\n- ss->processes.push_back([task_push]() { return task_push->exec(); });\n+ ss->processes.push_back([task_push]() -> const std::vector<int>& { return task_push->exec(); });\nlast_task_id = ss->tasks_id[ss->tasks_id.size() -1] +1;\nss->tasks_id .push_back(last_task_id);\n}\n@@ -930,7 +930,7 @@ void Pipeline\nm->cancel_waiting();\n};\n- std::vector<std::thread> threads;;\n+ std::vector<std::thread> threads;\nfor (size_t s = 0; s < stages.size() -1; s++)\n{\nauto &stage = stages[s];\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
Fix 'module::Adaptor' return status in 'tools::Pipeline'.
|
8,490 |
13.11.2020 17:06:31
| -3,600 |
125bf79dcc06f445a4f46fcd7fdc0de1a135c7bd
|
Initialize the 'statuses' to 'nullptr' in 'tools::Sequence'.
|
[
{
"change_type": "MODIFY",
"old_path": "src/Tools/Sequence/Sequence.cpp",
"new_path": "src/Tools/Sequence/Sequence.cpp",
"diff": "@@ -441,7 +441,7 @@ void Sequence\n{\ndo\n{\n- // std::fill(statuses.begin(), statuses.end(), module::status_t::SKIPPED);\n+ std::fill(statuses.begin(), statuses.end(), nullptr);\ntry\n{\nexec_sequence(sequence, statuses);\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
Initialize the 'statuses' to 'nullptr' in 'tools::Sequence'.
|
8,490 |
14.11.2020 09:47:33
| -3,600 |
e442a8a965ccc2462a7f066ac997faddb5d48946
|
Fix wrong 'dataptr' write in the 'module::Task' 'status'.
|
[
{
"change_type": "MODIFY",
"old_path": "include/Tools/Sequence/Pipeline.hpp",
"new_path": "include/Tools/Sequence/Pipeline.hpp",
"diff": "@@ -110,10 +110,10 @@ public:\nvirtual ~Pipeline() = default;\n- void exec(const std::vector<std::function<bool(const std::vector<const std::vector<int>*>&)>> &stop_conditions);\n+ void exec(const std::vector<std::function<bool(const std::vector<const int*>&)>> &stop_conditions);\nvoid exec(const std::vector<std::function<bool( )>> &stop_conditions);\n- void exec(std::function<bool(const std::vector<const std::vector<int>*>&)> stop_condition);\n+ void exec(std::function<bool(const std::vector<const int*>&)> stop_condition);\nvoid exec(std::function<bool( )> stop_condition);\nstd::vector<Sequence*> get_stages();\n"
},
{
"change_type": "MODIFY",
"old_path": "include/Tools/Sequence/Sequence.hpp",
"new_path": "include/Tools/Sequence/Sequence.hpp",
"diff": "@@ -36,7 +36,7 @@ class Sub_sequence_generic\npublic:\nsubseq_t type;\nVTA tasks;\n- std::vector<std::function<const std::vector<int>&()>> processes;\n+ std::vector<std::function<const int*()>> processes;\nstd::vector<size_t> tasks_id;\nsize_t id;\n@@ -137,7 +137,7 @@ public:\nvoid set_thread_pinning(const bool thread_pinning, const std::vector<size_t> &puids = {});\nbool is_thread_pinning();\n- void exec(std::function<bool(const std::vector<const std::vector<int>*>&)> stop_condition);\n+ void exec(std::function<bool(const std::vector<const int*>&)> stop_condition);\nvoid exec(std::function<bool( )> stop_condition);\nvoid exec(const size_t tid = 0, const int frame_id = -1 );\ninline size_t get_n_threads() const;\n@@ -197,7 +197,7 @@ protected:\nvoid duplicate(const Generic_node<SS> *sequence);\nvoid _exec(const size_t tid,\n- std::function<bool(const std::vector<const std::vector<int>*>&)> &stop_condition,\n+ std::function<bool(const std::vector<const int*>&)> &stop_condition,\nGeneric_node<Sub_sequence>* sequence);\nvoid _exec_without_statuses(const size_t tid,\n"
},
{
"change_type": "MODIFY",
"old_path": "src/Module/Task.cpp",
"new_path": "src/Module/Task.cpp",
"diff": "@@ -222,8 +222,11 @@ void Task\nconst auto n_waves = this->get_module().get_n_waves();\nconst auto n_frames_per_wave_rest = this->get_module().get_n_frames_per_wave_rest();\n+ // do not use 'this->status' because the dataptr can have been changed by the 'tools::Sequence' when using the no\n+ // copy mode\n+ int* status = (int*)this->sockets.back()->get_dataptr();\nfor (size_t w = 0; w < n_waves; w++)\n- this->status[w] = (int)status_t::UNKNOWN;\n+ status[w] = (int)status_t::UNKNOWN;\nif ((managed_memory == false && frame_id >= 0) ||\n(frame_id == -1 && n_frames_per_wave == n_frames) ||\n@@ -233,7 +236,7 @@ void Task\n{\nconst auto real_frame_id = frame_id == -1 ? 0 : frame_id;\nconst size_t w = (real_frame_id % n_frames) / n_frames_per_wave;\n- this->status[w] = this->codelet(*this->module, *this, real_frame_id);\n+ status[w] = this->codelet(*this->module, *this, real_frame_id);\n}\nelse\n{\n@@ -255,7 +258,7 @@ void Task\nthis->sockets[sid]->dataptr = (void*)sockets_data[sid].data();\n}\n- this->status[w] = this->codelet(*this->module, *this, w * n_frames_per_wave);\n+ status[w] = this->codelet(*this->module, *this, w * n_frames_per_wave);\nfor (size_t sid = 0; sid < this->sockets.size() -1; sid++)\nif (socket_type[sid] == socket_t::SOUT || socket_type[sid] == socket_t::SIN_SOUT)\n@@ -276,8 +279,8 @@ void Task\nthis->sockets[sid]->dataptr = (void*)(sockets_dataptr_init[sid] +\nw * n_frames_per_wave * sockets_databytes_per_frame[sid]);\n- this->status[w] = this->codelet(*this->module, *this, w * n_frames_per_wave);\n- exec_status = (status_t)this->status[w];\n+ status[w] = this->codelet(*this->module, *this, w * n_frames_per_wave);\n+ exec_status = (status_t)status[w];\n}\nif (exec_status != status_t::FAILURE_STOP)\n@@ -288,7 +291,7 @@ void Task\nthis->sockets[sid]->dataptr = (void*)(sockets_dataptr_init[sid] +\nw * n_frames_per_wave * sockets_databytes_per_frame[sid]);\n- this->status[w] = this->codelet(*this->module, *this, w * n_frames_per_wave);\n+ status[w] = this->codelet(*this->module, *this, w * n_frames_per_wave);\n}\nelse\n{\n@@ -301,7 +304,7 @@ void Task\nthis->sockets[sid]->dataptr = (void*)sockets_data[sid].data();\n}\n- this->status[w] = this->codelet(*this->module, *this, w * n_frames_per_wave);\n+ status[w] = this->codelet(*this->module, *this, w * n_frames_per_wave);\nfor (size_t sid = 0; sid < this->sockets.size() -1; sid++)\nif (socket_type[sid] == socket_t::SOUT || socket_type[sid] == socket_t::SIN_SOUT)\n@@ -443,13 +446,16 @@ const std::vector<int>& Task\n}\n}\nstd::cout << \"# Returned status: [\";\n- for (size_t w = 0; w < this->status.size(); w++)\n- {\n- if (status_t_to_string.count(this->status[w]))\n- std::cout << ((w != 0) ? \", \" : \"\") << std::dec << this->status[w]\n- << \" '\" << status_t_to_string[this->status[w]] << \"'\";\n+ // do not use 'this->status' because the dataptr can have been changed by the 'tools::Sequence' when using\n+ // the no copy mode\n+ int* status = (int*)this->sockets.back()->get_dataptr();\n+ for (size_t w = 0; w < this->get_module().get_n_waves(); w++)\n+ {\n+ if (status_t_to_string.count(status[w]))\n+ std::cout << ((w != 0) ? \", \" : \"\") << std::dec << status[w]\n+ << \" '\" << status_t_to_string[status[w]] << \"'\";\nelse\n- std::cout << ((w != 0) ? \", \" : \"\") << std::dec << this->status[w];\n+ std::cout << ((w != 0) ? \", \" : \"\") << std::dec << status[w];\n}\nstd::cout << \"]\" << std::endl;\nstd::cout << \"#\" << std::noshowbase << std::endl;\n"
},
{
"change_type": "MODIFY",
"old_path": "src/Tools/Sequence/Pipeline.cpp",
"new_path": "src/Tools/Sequence/Pipeline.cpp",
"diff": "@@ -759,7 +759,12 @@ void Pipeline\nauto ss = this->stages[sta]->sequences[t]->get_contents();\nassert(ss != nullptr);\nss->tasks .insert(ss->tasks.begin(), task_pull);\n- ss->processes.insert(ss->processes.begin(), [task_pull]() -> const std::vector<int>& { return task_pull->exec(); });\n+ ss->processes.insert(ss->processes.begin(), [task_pull]() -> const int*\n+ {\n+ task_pull->exec();\n+ const int* status = (int*)task_pull->sockets.back()->get_dataptr();\n+ return status;\n+ });\nthis->stages[sta]->update_tasks_id(t);\n}\nthis->stages[sta]->firsts_tasks_id.clear();\n@@ -786,7 +791,12 @@ void Pipeline\nauto ss = this->stages[sta]->get_last_subsequence(t);\nassert(ss != nullptr);\nss->tasks .push_back(task_push);\n- ss->processes.push_back([task_push]() -> const std::vector<int>& { return task_push->exec(); });\n+ ss->processes.push_back([task_push]() -> const int*\n+ {\n+ task_push->exec();\n+ const int* status = (int*)task_push->sockets.back()->get_dataptr();\n+ return status;\n+ });\nlast_task_id = ss->tasks_id[ss->tasks_id.size() -1] +1;\nss->tasks_id .push_back(last_task_id);\n}\n@@ -905,7 +915,7 @@ void Pipeline\n}\nvoid Pipeline\n-::exec(const std::vector<std::function<bool(const std::vector<const std::vector<int>*>&)>> &stop_conditions)\n+::exec(const std::vector<std::function<bool(const std::vector<const int*>&)>> &stop_conditions)\n{\nif (stop_conditions.size() != this->stages.size())\n{\n@@ -1009,10 +1019,9 @@ void Pipeline\n}\nvoid Pipeline\n-::exec(std::function<bool(const std::vector<const std::vector<int>*>&)> stop_condition)\n+::exec(std::function<bool(const std::vector<const int*>&)> stop_condition)\n{\n- this->exec(std::vector<std::function<bool(const std::vector<const std::vector<int>*>&)>>(this->stages.size(),\n- stop_condition));\n+ this->exec(std::vector<std::function<bool(const std::vector<const int*>&)>>(this->stages.size(), stop_condition));\n}\nvoid Pipeline\n"
},
{
"change_type": "MODIFY",
"old_path": "src/Tools/Sequence/Sequence.cpp",
"new_path": "src/Tools/Sequence/Sequence.cpp",
"diff": "@@ -406,14 +406,14 @@ std::vector<std::vector<module::Task*>> Sequence\nvoid Sequence\n::_exec(const size_t tid,\n- std::function<bool(const std::vector<const std::vector<int>*>&)> &stop_condition,\n+ std::function<bool(const std::vector<const int*>&)> &stop_condition,\nGeneric_node<Sub_sequence>* sequence)\n{\nif (this->is_thread_pinning())\nThread_pinning::pin(this->puids[tid]);\n- std::function<void(Generic_node<Sub_sequence>*, std::vector<const std::vector<int>*>&)> exec_sequence =\n- [&exec_sequence](Generic_node<Sub_sequence>* cur_ss, std::vector<const std::vector<int>*>& statuses)\n+ std::function<void(Generic_node<Sub_sequence>*, std::vector<const int*>&)> exec_sequence =\n+ [&exec_sequence](Generic_node<Sub_sequence>* cur_ss, std::vector<const int*>& statuses)\n{\nauto type = cur_ss->get_c()->type;\nauto &tasks = cur_ss->get_c()->tasks;\n@@ -422,7 +422,7 @@ void Sequence\nif (type == subseq_t::LOOP)\n{\n- while (!(statuses[tasks_id[0]] = &processes[0]()))\n+ while (!(statuses[tasks_id[0]] = processes[0]()))\nexec_sequence(cur_ss->get_children()[0], statuses);\nstatic_cast<module::Loop&>(tasks[0]->get_module()).reset();\nexec_sequence(cur_ss->get_children()[1], statuses);\n@@ -430,13 +430,13 @@ void Sequence\nelse\n{\nfor (size_t p = 0; p < processes.size(); p++)\n- statuses[tasks_id[p]] = &processes[p]();\n+ statuses[tasks_id[p]] = processes[p]();\nfor (auto c : cur_ss->get_children())\nexec_sequence(c, statuses);\n}\n};\n- std::vector<const std::vector<int>*> statuses(this->n_tasks, nullptr);\n+ std::vector<const int*> statuses(this->n_tasks, nullptr);\ntry\n{\ndo\n@@ -562,7 +562,7 @@ void Sequence\n}\nvoid Sequence\n-::exec(std::function<bool(const std::vector<const std::vector<int>*>&)> stop_condition)\n+::exec(std::function<bool(const std::vector<const int*>&)> stop_condition)\n{\nif (this->is_no_copy_mode())\nthis->gen_processes(true);\n@@ -1172,7 +1172,7 @@ void Sequence\n{\nif (cur_node != nullptr)\n{\n- std::map<module::Task*, std::function<const std::vector<int>&()>> modified_tasks;\n+ std::map<module::Task*, std::function<const int*()>> modified_tasks;\nauto contents = cur_node->get_c();\ncontents->processes.clear();\ncontents->rebind_sockets.clear();\n@@ -1220,11 +1220,12 @@ void Sequence\n}\n}\n- modified_tasks[pull_task] = [contents, pull_task, adp_pull, rebind_id]()\n- -> const std::vector<int>&\n+ modified_tasks[pull_task] = [contents, pull_task, adp_pull, rebind_id]() -> const int*\n{\n// active or passive waiting here\n- const auto &status = pull_task->exec();\n+ pull_task->exec();\n+ const int* status = (int*)pull_task->sockets.back()->get_dataptr();\n+\n// rebind input sockets on the fly\nfor (size_t sin_id = 0; sin_id < contents->rebind_sockets[rebind_id].size(); sin_id++)\n{\n@@ -1302,11 +1303,11 @@ void Sequence\ncontents->rebind_dataptrs[rebind_id].push_back(dataptrs);\n}\n- modified_tasks[push_task] = [contents, push_task, adp_push, rebind_id]()\n- -> const std::vector<int>&\n+ modified_tasks[push_task] = [contents, push_task, adp_push, rebind_id]() -> const int*\n{\n// active or passive waiting here\n- const auto &status = push_task->exec();\n+ push_task->exec();\n+ const int* status = (int*)push_task->sockets.back()->get_dataptr();\n// rebind output sockets on the fly\nfor (size_t sout_id = 0; sout_id < contents->rebind_sockets[rebind_id].size(); sout_id++)\n{\n@@ -1330,7 +1331,12 @@ void Sequence\nif (modified_tasks.count(task))\ncontents->processes.push_back(modified_tasks[task]);\nelse\n- contents->processes.push_back([task]() -> const std::vector<int>& { return task->exec(); });\n+ contents->processes.push_back([task]() -> const int*\n+ {\n+ task->exec();\n+ const int* status = (int*)task->sockets.back()->get_dataptr();\n+ return status;\n+ });\nfor (auto c : cur_node->get_children())\ngen_processes_recursive(c);\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
Fix wrong 'dataptr' write in the 'module::Task' 'status'.
|
8,490 |
15.11.2020 19:55:44
| -3,600 |
e6ecd372bae32a25e8f2eebda7429d48e7f2efa1
|
Fix wrong memory access in the decoders.
|
[
{
"change_type": "MODIFY",
"old_path": "include/Module/Decoder/Decoder.hpp",
"new_path": "include/Module/Decoder/Decoder.hpp",
"diff": "@@ -70,10 +70,10 @@ public:\nvirtual void set_seed(const int seed);\n+ virtual void set_n_frames(const size_t n_frames);\n+\nprotected:\nvirtual void _reset(const size_t frame_id);\n-\n- virtual void set_n_frames_per_wave(const size_t n_frames_per_wave);\n};\n}\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "src/Module/Decoder/Decoder.cpp",
"new_path": "src/Module/Decoder/Decoder.cpp",
"diff": "@@ -15,7 +15,7 @@ Decoder\nN(N),\nauto_reset(true),\nmask(std::numeric_limits<int>::max()),\n- CWD(this->get_n_frames_per_wave())\n+ CWD(this->get_n_frames())\n{\nconst std::string name = \"Decoder\";\nthis->set_name(name);\n@@ -117,12 +117,12 @@ void Decoder\n}\nvoid Decoder\n-::set_n_frames_per_wave(const size_t n_frames_per_wave)\n+::set_n_frames(const size_t n_frames)\n{\n- const auto old_n_frames_per_wave = this->get_n_frames_per_wave();\n- if (old_n_frames_per_wave != n_frames_per_wave)\n+ const auto old_n_frames = this->get_n_frames();\n+ if (old_n_frames != n_frames)\n{\n- Module::set_n_frames_per_wave(n_frames_per_wave);\n- this->CWD.resize(n_frames_per_wave);\n+ Module::set_n_frames(n_frames);\n+ this->CWD.resize(n_frames);\n}\n}\n\\ No newline at end of file\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
Fix wrong memory access in the decoders.
|
8,490 |
16.11.2020 09:11:36
| -3,600 |
6698c59367752ec550b2a302741df3b209cdb5bb
|
Simplify and fix decoder calls when no 'CWD' vector.
|
[
{
"change_type": "MODIFY",
"old_path": "include/Module/Decoder/Decoder.hpp",
"new_path": "include/Module/Decoder/Decoder.hpp",
"diff": "@@ -74,8 +74,14 @@ public:\nprotected:\nvirtual void _reset(const size_t frame_id);\n+\n+ inline int compute_status(const std::vector<int>& status, const int frame_id);\n};\n}\n}\n+#ifndef DOXYGEN_SHOULD_SKIP_THIS\n+#include \"Module/Decoder/Decoder.hxx\"\n+#endif\n+\n#endif /* DECODER_HPP_ */\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "include/Module/Decoder/Decoder.hxx",
"diff": "+#include \"Module/Decoder/Decoder.hpp\"\n+\n+namespace aff3ct\n+{\n+namespace module\n+{\n+int Decoder\n+::compute_status(const std::vector<int>& status, const int frame_id)\n+{\n+ if (frame_id == -1)\n+ {\n+ int ret_status = 0;\n+ for (size_t w = 0; w < this->get_n_waves(); w++)\n+ {\n+ ret_status <<= this->get_n_frames_per_wave();\n+ ret_status |= status[w];\n+ }\n+ return ret_status & this->mask;\n+ }\n+ else\n+ {\n+ const auto w = (frame_id % this->get_n_frames()) / this->get_n_frames_per_wave();\n+ return status[w] & this->mask;\n+ }\n+}\n+}\n+}\n\\ No newline at end of file\n"
},
{
"change_type": "MODIFY",
"old_path": "include/Module/Decoder/Decoder_HIHO.hxx",
"new_path": "include/Module/Decoder/Decoder_HIHO.hxx",
"diff": "@@ -105,21 +105,7 @@ int Decoder_HIHO<B>\n(*this)[dec::sck::decode_hiho::V_K].bind(V_K);\nconst auto &status = (*this)[dec::tsk::decode_hiho].exec(frame_id, managed_memory);\n- if (frame_id == -1)\n- {\n- int ret_status = 0;\n- for (size_t w = 0; w < this->get_n_waves(); w++)\n- {\n- ret_status <<= this->get_n_frames_per_wave();\n- ret_status |= status[w];\n- }\n- return ret_status & this->mask;\n- }\n- else\n- {\n- const auto w = (frame_id % this->get_n_frames()) / this->get_n_frames_per_wave();\n- return status[w] & this->mask;\n- }\n+ return this->compute_status(status, frame_id);\n}\ntemplate <typename B>\n@@ -127,7 +113,12 @@ template <class A>\nint Decoder_HIHO<B>\n::decode_hiho(const std::vector<B,A>& Y_N, std::vector<B,A>& V_K, const int frame_id, const bool managed_memory)\n{\n- return this->decode_hiho(Y_N, this->CWD, V_K, frame_id, managed_memory);\n+ (*this)[dec::sck::decode_hiho::Y_N].bind(Y_N );\n+ (*this)[dec::sck::decode_hiho::CWD].bind(this->CWD);\n+ (*this)[dec::sck::decode_hiho::V_K].bind(V_K );\n+ const auto &status = (*this)[dec::tsk::decode_hiho].exec(frame_id, managed_memory);\n+\n+ return this->compute_status(status, frame_id);\n}\ntemplate <typename B>\n@@ -139,28 +130,19 @@ int Decoder_HIHO<B>\n(*this)[dec::sck::decode_hiho::V_K].bind(V_K);\nconst auto &status = (*this)[dec::tsk::decode_hiho].exec(frame_id, managed_memory);\n- if (frame_id == -1)\n- {\n- int ret_status = 0;\n- for (size_t w = 0; w < this->get_n_waves(); w++)\n- {\n- ret_status <<= this->get_n_frames_per_wave();\n- ret_status |= status[w];\n- }\n- return ret_status & this->mask;\n- }\n- else\n- {\n- const auto w = (frame_id % this->get_n_frames()) / this->get_n_frames_per_wave();\n- return status[w] & this->mask;\n- }\n+ return this->compute_status(status, frame_id);\n}\ntemplate <typename B>\nint Decoder_HIHO<B>\n::decode_hiho(const B *Y_N, B *V_K, const int frame_id, const bool managed_memory)\n{\n- return this->decode_hiho(Y_N, this->CWD.data(), V_K, frame_id, managed_memory);\n+ (*this)[dec::sck::decode_hiho::Y_N].bind(Y_N );\n+ (*this)[dec::sck::decode_hiho::CWD].bind(this->CWD.data());\n+ (*this)[dec::sck::decode_hiho::V_K].bind(V_K );\n+ const auto &status = (*this)[dec::tsk::decode_hiho].exec(frame_id, managed_memory);\n+\n+ return this->compute_status(status, frame_id);\n}\ntemplate <typename B>\n@@ -174,21 +156,7 @@ int Decoder_HIHO<B>\n(*this)[dec::sck::decode_hiho_cw::V_N].bind(V_N);\nconst auto &status = (*this)[dec::tsk::decode_hiho_cw].exec(frame_id, managed_memory);\n- if (frame_id == -1)\n- {\n- int ret_status = 0;\n- for (size_t w = 0; w < this->get_n_waves(); w++)\n- {\n- ret_status <<= this->get_n_frames_per_wave();\n- ret_status |= status[w];\n- }\n- return ret_status & this->mask;\n- }\n- else\n- {\n- const auto w = (frame_id % this->get_n_frames()) / this->get_n_frames_per_wave();\n- return status[w] & this->mask;\n- }\n+ return this->compute_status(status, frame_id);\n}\ntemplate <typename B>\n@@ -196,7 +164,12 @@ template <class A>\nint Decoder_HIHO<B>\n::decode_hiho_cw(const std::vector<B,A>& Y_N, std::vector<B,A>& V_N, const int frame_id, const bool managed_memory)\n{\n- return this->decode_hiho_cw(Y_N, this->CWD, V_N, frame_id, managed_memory);\n+ (*this)[dec::sck::decode_hiho_cw::Y_N].bind(Y_N );\n+ (*this)[dec::sck::decode_hiho_cw::CWD].bind(this->CWD);\n+ (*this)[dec::sck::decode_hiho_cw::V_N].bind(V_N );\n+ const auto &status = (*this)[dec::tsk::decode_hiho_cw].exec(frame_id, managed_memory);\n+\n+ return this->compute_status(status, frame_id);\n}\ntemplate <typename B>\n@@ -208,28 +181,19 @@ int Decoder_HIHO<B>\n(*this)[dec::sck::decode_hiho_cw::V_N].bind(V_N);\nconst auto &status = (*this)[dec::tsk::decode_hiho_cw].exec(frame_id, managed_memory);\n- if (frame_id == -1)\n- {\n- int ret_status = 0;\n- for (size_t w = 0; w < this->get_n_waves(); w++)\n- {\n- ret_status <<= this->get_n_frames_per_wave();\n- ret_status |= status[w];\n- }\n- return ret_status & this->mask;\n- }\n- else\n- {\n- const auto w = (frame_id % this->get_n_frames()) / this->get_n_frames_per_wave();\n- return status[w] & this->mask;\n- }\n+ return this->compute_status(status, frame_id);\n}\ntemplate <typename B>\nint Decoder_HIHO<B>\n::decode_hiho_cw(const B *Y_N, B *V_N, const int frame_id, const bool managed_memory)\n{\n- return this->decode_hiho_cw(Y_N, this->CWD.data(), V_N, frame_id, managed_memory);\n+ (*this)[dec::sck::decode_hiho_cw::Y_N].bind(Y_N );\n+ (*this)[dec::sck::decode_hiho_cw::CWD].bind(this->CWD.data());\n+ (*this)[dec::sck::decode_hiho_cw::V_N].bind(V_N );\n+ const auto &status = (*this)[dec::tsk::decode_hiho_cw].exec(frame_id, managed_memory);\n+\n+ return this->compute_status(status, frame_id);\n}\ntemplate <typename B>\n"
},
{
"change_type": "MODIFY",
"old_path": "include/Module/Decoder/Decoder_SIHO.hxx",
"new_path": "include/Module/Decoder/Decoder_SIHO.hxx",
"diff": "@@ -121,21 +121,7 @@ int Decoder_SIHO<B,R>\n(*this)[dec::sck::decode_siho::V_K].bind(V_K);\nconst auto &status = (*this)[dec::tsk::decode_siho].exec(frame_id, managed_memory);\n- if (frame_id == -1)\n- {\n- int ret_status = 0;\n- for (size_t w = 0; w < this->get_n_waves(); w++)\n- {\n- ret_status <<= this->get_n_frames_per_wave();\n- ret_status |= status[w];\n- }\n- return ret_status & this->mask;\n- }\n- else\n- {\n- const auto w = (frame_id % this->get_n_frames()) / this->get_n_frames_per_wave();\n- return status[w] & this->mask;\n- }\n+ return this->compute_status(status, frame_id);\n}\ntemplate <typename B, typename R>\n@@ -143,7 +129,12 @@ template <class AR, class AB>\nint Decoder_SIHO<B,R>\n::decode_siho(const std::vector<R,AR>& Y_N, std::vector<B,AB>& V_K, const int frame_id, const bool managed_memory)\n{\n- return this->decode_siho(Y_N, this->CWD, V_K, frame_id, managed_memory);\n+ (*this)[dec::sck::decode_siho::Y_N].bind(Y_N );\n+ (*this)[dec::sck::decode_siho::CWD].bind(this->CWD);\n+ (*this)[dec::sck::decode_siho::V_K].bind(V_K );\n+ const auto &status = (*this)[dec::tsk::decode_siho].exec(frame_id, managed_memory);\n+\n+ return this->compute_status(status, frame_id);\n}\ntemplate <typename B, typename R>\n@@ -155,28 +146,19 @@ int Decoder_SIHO<B,R>\n(*this)[dec::sck::decode_siho::V_K].bind(V_K);\nconst auto &status = (*this)[dec::tsk::decode_siho].exec(frame_id, managed_memory);\n- if (frame_id == -1)\n- {\n- int ret_status = 0;\n- for (size_t w = 0; w < this->get_n_waves(); w++)\n- {\n- ret_status <<= this->get_n_frames_per_wave();\n- ret_status |= status[w];\n- }\n- return ret_status & this->mask;\n- }\n- else\n- {\n- const auto w = (frame_id % this->get_n_frames()) / this->get_n_frames_per_wave();\n- return status[w] & this->mask;\n- }\n+ return this->compute_status(status, frame_id);\n}\ntemplate <typename B, typename R>\nint Decoder_SIHO<B,R>\n::decode_siho(const R *Y_N, B *V_K, const int frame_id, const bool managed_memory)\n{\n- return this->decode_siho(Y_N, this->CWD.data(), V_K, frame_id, managed_memory);\n+ (*this)[dec::sck::decode_siho::Y_N].bind(Y_N );\n+ (*this)[dec::sck::decode_siho::CWD].bind(this->CWD.data());\n+ (*this)[dec::sck::decode_siho::V_K].bind(V_K );\n+ const auto &status = (*this)[dec::tsk::decode_siho].exec(frame_id, managed_memory);\n+\n+ return this->compute_status(status, frame_id);\n}\ntemplate <typename B, typename R>\n@@ -190,21 +172,7 @@ int Decoder_SIHO<B,R>\n(*this)[dec::sck::decode_siho_cw::V_N].bind(V_N);\nconst auto &status = (*this)[dec::tsk::decode_siho_cw].exec(frame_id, managed_memory);\n- if (frame_id == -1)\n- {\n- int ret_status = 0;\n- for (size_t w = 0; w < this->get_n_waves(); w++)\n- {\n- ret_status <<= this->get_n_frames_per_wave();\n- ret_status |= status[w];\n- }\n- return ret_status & this->mask;\n- }\n- else\n- {\n- const auto w = (frame_id % this->get_n_frames()) / this->get_n_frames_per_wave();\n- return status[w] & this->mask;\n- }\n+ return this->compute_status(status, frame_id);\n}\ntemplate <typename B, typename R>\n@@ -212,7 +180,12 @@ template <class AR, class AB>\nint Decoder_SIHO<B,R>\n::decode_siho_cw(const std::vector<R,AR>& Y_N, std::vector<B,AB>& V_N, const int frame_id, const bool managed_memory)\n{\n- return this->decode_siho_cw(Y_N, this->CWD, V_N, frame_id, managed_memory);\n+ (*this)[dec::sck::decode_siho_cw::Y_N].bind(Y_N );\n+ (*this)[dec::sck::decode_siho_cw::CWD].bind(this->CWD);\n+ (*this)[dec::sck::decode_siho_cw::V_N].bind(V_N );\n+ const auto &status = (*this)[dec::tsk::decode_siho_cw].exec(frame_id, managed_memory);\n+\n+ return this->compute_status(status, frame_id);\n}\ntemplate <typename B, typename R>\n@@ -224,28 +197,19 @@ int Decoder_SIHO<B,R>\n(*this)[dec::sck::decode_siho_cw::V_N].bind(V_N);\nconst auto &status = (*this)[dec::tsk::decode_siho_cw].exec(frame_id, managed_memory);\n- if (frame_id == -1)\n- {\n- int ret_status = 0;\n- for (size_t w = 0; w < this->get_n_waves(); w++)\n- {\n- ret_status <<= this->get_n_frames_per_wave();\n- ret_status |= status[w];\n- }\n- return ret_status & this->mask;\n- }\n- else\n- {\n- const auto w = (frame_id % this->get_n_frames()) / this->get_n_frames_per_wave();\n- return status[w] & this->mask;\n- }\n+ return this->compute_status(status, frame_id);\n}\ntemplate <typename B, typename R>\nint Decoder_SIHO<B,R>\n::decode_siho_cw(const R *Y_N, B *V_N, const int frame_id, const bool managed_memory)\n{\n- return this->decode_siho_cw(Y_N, this->CWD.data(), V_N, frame_id, managed_memory);\n+ (*this)[dec::sck::decode_siho_cw::Y_N].bind(Y_N );\n+ (*this)[dec::sck::decode_siho_cw::CWD].bind(this->CWD.data());\n+ (*this)[dec::sck::decode_siho_cw::V_N].bind(V_N );\n+ const auto &status = (*this)[dec::tsk::decode_siho_cw].exec(frame_id, managed_memory);\n+\n+ return this->compute_status(status, frame_id);\n}\ntemplate <typename B, typename R>\n"
},
{
"change_type": "MODIFY",
"old_path": "include/Module/Decoder/Decoder_SISO.hxx",
"new_path": "include/Module/Decoder/Decoder_SISO.hxx",
"diff": "@@ -128,21 +128,7 @@ int Decoder_SISO<B,R>\n(*this)[dec::sck::decode_siso::Y_N2].bind(Y_N2);\nconst auto &status = (*this)[dec::tsk::decode_siso].exec(frame_id, managed_memory);\n- if (frame_id == -1)\n- {\n- int ret_status = 0;\n- for (size_t w = 0; w < this->get_n_waves(); w++)\n- {\n- ret_status <<= this->get_n_frames_per_wave();\n- ret_status |= status[w];\n- }\n- return ret_status & this->mask;\n- }\n- else\n- {\n- const auto w = (frame_id % this->get_n_frames()) / this->get_n_frames_per_wave();\n- return status[w] & this->mask;\n- }\n+ return this->compute_status(status, frame_id);\n}\ntemplate <typename B, typename R>\n@@ -150,7 +136,12 @@ template <class A>\nint Decoder_SISO<B,R>\n::decode_siso(const std::vector<R,A> &Y_N1, std::vector<R,A> &Y_N2, const int frame_id, const bool managed_memory)\n{\n- return this->decode_siso(Y_N1, this->CWD, Y_N2, frame_id, managed_memory);\n+ (*this)[dec::sck::decode_siso::Y_N1].bind(Y_N1 );\n+ (*this)[dec::sck::decode_siso::CWD ].bind(this->CWD);\n+ (*this)[dec::sck::decode_siso::Y_N2].bind(Y_N2 );\n+ const auto &status = (*this)[dec::tsk::decode_siso].exec(frame_id, managed_memory);\n+\n+ return this->compute_status(status, frame_id);\n}\ntemplate <typename B, typename R>\n@@ -162,28 +153,19 @@ int Decoder_SISO<B,R>\n(*this)[dec::sck::decode_siso::Y_N2].bind(Y_N2);\nconst auto &status = (*this)[dec::tsk::decode_siso].exec(frame_id, managed_memory);\n- if (frame_id == -1)\n- {\n- int ret_status = 0;\n- for (size_t w = 0; w < this->get_n_waves(); w++)\n- {\n- ret_status <<= this->get_n_frames_per_wave();\n- ret_status |= status[w];\n- }\n- return ret_status & this->mask;\n- }\n- else\n- {\n- const auto w = (frame_id % this->get_n_frames()) / this->get_n_frames_per_wave();\n- return status[w] & this->mask;\n- }\n+ return this->compute_status(status, frame_id);\n}\ntemplate <typename B, typename R>\nint Decoder_SISO<B,R>\n::decode_siso(const R *Y_N1, R *Y_N2, const int frame_id, const bool managed_memory)\n{\n- return this->decode_siso(Y_N1, this->CWD.data(), Y_N2, frame_id, managed_memory);\n+ (*this)[dec::sck::decode_siso::Y_N1].bind(Y_N1 );\n+ (*this)[dec::sck::decode_siso::CWD ].bind(this->CWD.data());\n+ (*this)[dec::sck::decode_siso::Y_N2].bind(Y_N2 );\n+ const auto &status = (*this)[dec::tsk::decode_siso].exec(frame_id, managed_memory);\n+\n+ return this->compute_status(status, frame_id);\n}\ntemplate <typename B, typename R>\n@@ -198,21 +180,7 @@ int Decoder_SISO<B,R>\n(*this)[dec::sck::decode_siso_alt::ext].bind(ext);\nconst auto &status = (*this)[dec::tsk::decode_siso_alt].exec(frame_id, managed_memory);\n- if (frame_id == -1)\n- {\n- int ret_status = 0;\n- for (size_t w = 0; w < this->get_n_waves(); w++)\n- {\n- ret_status <<= this->get_n_frames_per_wave();\n- ret_status |= status[w];\n- }\n- return ret_status & this->mask;\n- }\n- else\n- {\n- const auto w = (frame_id % this->get_n_frames()) / this->get_n_frames_per_wave();\n- return status[w] & this->mask;\n- }\n+ return this->compute_status(status, frame_id);\n}\ntemplate <typename B, typename R>\n@@ -221,7 +189,13 @@ int Decoder_SISO<B,R>\n::decode_siso_alt(const std::vector<R,A> &sys, const std::vector<R,A> &par, std::vector<R,A> &ext,\nconst int frame_id, const bool managed_memory)\n{\n- return this->decode_siso_alt(sys, par, this->CWD, ext, frame_id, managed_memory);\n+ (*this)[dec::sck::decode_siso_alt::sys].bind(sys );\n+ (*this)[dec::sck::decode_siso_alt::par].bind(par );\n+ (*this)[dec::sck::decode_siso_alt::CWD].bind(this->CWD);\n+ (*this)[dec::sck::decode_siso_alt::ext].bind(ext );\n+ const auto &status = (*this)[dec::tsk::decode_siso_alt].exec(frame_id, managed_memory);\n+\n+ return this->compute_status(status, frame_id);\n}\ntemplate <typename B, typename R>\n@@ -234,28 +208,20 @@ int Decoder_SISO<B,R>\n(*this)[dec::sck::decode_siso_alt::ext].bind(ext);\nconst auto &status = (*this)[dec::tsk::decode_siso_alt].exec(frame_id, managed_memory);\n- if (frame_id == -1)\n- {\n- int ret_status = 0;\n- for (size_t w = 0; w < this->get_n_waves(); w++)\n- {\n- ret_status <<= this->get_n_frames_per_wave();\n- ret_status |= status[w];\n- }\n- return ret_status & this->mask;\n- }\n- else\n- {\n- const auto w = (frame_id % this->get_n_frames()) / this->get_n_frames_per_wave();\n- return status[w] & this->mask;\n- }\n+ return this->compute_status(status, frame_id);\n}\ntemplate <typename B, typename R>\nint Decoder_SISO<B,R>\n::decode_siso_alt(const R *sys, const R *par, R *ext, const int frame_id, const bool managed_memory)\n{\n- return this->decode_siso_alt(sys, par, this->CWD.data(), ext, frame_id, managed_memory);\n+ (*this)[dec::sck::decode_siso_alt::sys].bind(sys );\n+ (*this)[dec::sck::decode_siso_alt::par].bind(par );\n+ (*this)[dec::sck::decode_siso_alt::CWD].bind(this->CWD.data());\n+ (*this)[dec::sck::decode_siso_alt::ext].bind(ext );\n+ const auto &status = (*this)[dec::tsk::decode_siso_alt].exec(frame_id, managed_memory);\n+\n+ return this->compute_status(status, frame_id);\n}\ntemplate <typename B, typename R>\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
Simplify and fix decoder calls when no 'CWD' vector.
|
8,490 |
16.11.2020 10:04:45
| -3,600 |
e8091201e3672091847288f301c8b7771d5315ca
|
Add a 'set_fast' method on the 'module::Module' class to set all tasks.
|
[
{
"change_type": "MODIFY",
"old_path": "include/Module/Module.hpp",
"new_path": "include/Module/Module.hpp",
"diff": "@@ -91,6 +91,8 @@ public:\ninline Task& operator[](const size_t id);\n+ void set_fast(const bool fast);\n+\nprotected:\nvirtual void deep_copy(const Module &m);\n"
},
{
"change_type": "MODIFY",
"old_path": "src/Module/Module.cpp",
"new_path": "src/Module/Module.cpp",
"diff": "@@ -219,3 +219,10 @@ void Module\n{\ntask.register_timer(key);\n}\n+\n+void Module\n+::set_fast(const bool fast)\n+{\n+ for (auto &t : this->tasks)\n+ t->set_fast(fast);\n+}\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
Add a 'set_fast' method on the 'module::Module' class to set all tasks.
|
8,490 |
16.11.2020 14:57:14
| -3,600 |
026be93e3d7fe42c9bd7b2dd8125b4c4f7e65098
|
Fix wrong prototypes.
|
[
{
"change_type": "MODIFY",
"old_path": "include/Module/Channel/Channel.hpp",
"new_path": "include/Module/Channel/Channel.hpp",
"diff": "@@ -106,7 +106,7 @@ public:\nvoid add_noise_wg(const std::vector<R,A>& X_N, std::vector<R,A>& H_N, std::vector<R,A>& Y_N,\nconst int frame_id = -1, const bool managed_memory = true);\n- void add_noise_wg(const R *X_N, R *Y_N, R *H_N, const int frame_id = -1, const bool managed_memory = true);\n+ void add_noise_wg(const R *X_N, R *H_N, R *Y_N, const int frame_id = -1, const bool managed_memory = true);\nvirtual void notify_noise_update();\n"
},
{
"change_type": "MODIFY",
"old_path": "include/Module/Monitor/BFER/Monitor_BFER.hpp",
"new_path": "include/Module/Monitor/BFER/Monitor_BFER.hpp",
"diff": "@@ -82,8 +82,8 @@ public:\nint check_errors2(const std::vector<B,A >& U,\nconst std::vector<B,A >& V,\nstd::vector<int64_t>& FRA,\n- std::vector<int64_t>& BE,\n- std::vector<int64_t>& FE,\n+ std::vector<int32_t>& BE,\n+ std::vector<int32_t>& FE,\nstd::vector<float >& BER,\nstd::vector<float >& FER,\nconst int frame_id = -1,\n"
},
{
"change_type": "MODIFY",
"old_path": "include/Module/Monitor/BFER/Monitor_BFER.hxx",
"new_path": "include/Module/Monitor/BFER/Monitor_BFER.hxx",
"diff": "@@ -48,8 +48,8 @@ int Monitor_BFER<B>\n::check_errors2(const std::vector<B,A >& U,\nconst std::vector<B,A >& V,\nstd::vector<int64_t>& FRA,\n- std::vector<int64_t>& BE,\n- std::vector<int64_t>& FE,\n+ std::vector<int32_t>& BE,\n+ std::vector<int32_t>& FE,\nstd::vector<float >& BER,\nstd::vector<float >& FER,\nconst int frame_id, const bool managed_memory)\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
Fix wrong prototypes.
|
8,490 |
17.11.2020 08:50:00
| -3,600 |
263a85e70e47ba5f0d0df6c4c3f329b3cfe3cfbc
|
Rm useless enum. val.
|
[
{
"change_type": "MODIFY",
"old_path": "include/Module/Task.hpp",
"new_path": "include/Module/Task.hpp",
"diff": "@@ -28,8 +28,7 @@ class Socket;\nenum status_t : int { SUCCESS = 0,\nFAILURE = 1,\nFAILURE_STOP = -1,\n- UNKNOWN = -2,\n- SKIPPED = std::numeric_limits<int>::min() };\n+ UNKNOWN = -2 };\nenum class socket_t : uint8_t { SIN, SIN_SOUT, SOUT };\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
Rm useless enum. val.
|
8,490 |
17.11.2020 08:50:42
| -3,600 |
d16c14959ce16a82b8050bee3af5bddfb7c3c87c
|
Doc: fix "readthedocs.org" compilation error.
|
[
{
"change_type": "MODIFY",
"old_path": "doc/source/conf.py",
"new_path": "doc/source/conf.py",
"diff": "@@ -40,6 +40,7 @@ copyright = '2020, AFF3CT team'\nauthor = 'AFF3CT team'\n# get the AFF3CT version from Git\n+subprocess.call('git fetch --all --tags', shell=True)\nlabel = subprocess.check_output([\"git\", \"describe\"]).strip().decode(encoding='UTF-8')\nsplit_label = label.split(\"-\")\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
Doc: fix "readthedocs.org" compilation error.
|
8,490 |
17.11.2020 09:48:08
| -3,600 |
c071b1d1cd8b1b850374836a4380b94d0a7b0e07
|
Doc: fix "readthedocs.org" compilation error (again -.-).
|
[
{
"change_type": "MODIFY",
"old_path": "doc/source/conf.py",
"new_path": "doc/source/conf.py",
"diff": "@@ -40,7 +40,7 @@ copyright = '2020, AFF3CT team'\nauthor = 'AFF3CT team'\n# get the AFF3CT version from Git\n-subprocess.call('git fetch --all --tags', shell=True)\n+subprocess.call('git fetch origin', shell=True)\nlabel = subprocess.check_output([\"git\", \"describe\"]).strip().decode(encoding='UTF-8')\nsplit_label = label.split(\"-\")\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
Doc: fix "readthedocs.org" compilation error (again -.-).
|
8,490 |
17.11.2020 10:05:20
| -3,600 |
5d5b756743d96bfda1c01fe5f8067cf683d1d312
|
Doc: fix "readthedocs.org" compilation error (again -.- and last?).
|
[
{
"change_type": "MODIFY",
"old_path": "doc/source/conf.py",
"new_path": "doc/source/conf.py",
"diff": "@@ -40,7 +40,8 @@ copyright = '2020, AFF3CT team'\nauthor = 'AFF3CT team'\n# get the AFF3CT version from Git\n-subprocess.call('git fetch origin', shell=True)\n+if (read_the_docs_build):\n+ subprocess.call('git fetch --unshallow', shell=True)\nlabel = subprocess.check_output([\"git\", \"describe\"]).strip().decode(encoding='UTF-8')\nsplit_label = label.split(\"-\")\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
Doc: fix "readthedocs.org" compilation error (again -.- and last?).
|
8,490 |
18.11.2020 15:22:23
| -3,600 |
8bc75dc5a99acf61136b6f2abe45a7e9afd2d0a5
|
Add a new interface: "tools::Interface_get_set_n_frames".
|
[
{
"change_type": "MODIFY",
"old_path": "include/Module/Module.hpp",
"new_path": "include/Module/Module.hpp",
"diff": "#include <string>\n#include \"Tools/Interface/Interface_clone.hpp\"\n+#include \"Tools/Interface/Interface_get_set_n_frames.hpp\"\n#include \"Module/Task.hpp\"\n#include \"Module/Socket.hpp\"\n@@ -25,7 +26,7 @@ namespace module\n*\n* \\brief A Module is an abstract concept. Basically, all the objects used in a Simulation are a Module.\n*/\n-class Module : public tools::Interface_clone\n+class Module : public tools::Interface_clone, public tools::Interface_get_set_n_frames\n{\nprotected:\nsize_t n_frames; /*!< Number of frames to process in this Module */\n"
},
{
"change_type": "MODIFY",
"old_path": "include/Tools/Code/Turbo/Post_processing_SISO/Post_processing_SISO.hpp",
"new_path": "include/Tools/Code/Turbo/Post_processing_SISO/Post_processing_SISO.hpp",
"diff": "#include <mipp.h>\n#include \"Tools/Interface/Interface_clone.hpp\"\n+#include \"Tools/Interface/Interface_get_set_n_frames.hpp\"\nnamespace aff3ct\n{\nnamespace tools\n{\ntemplate <typename B = int, typename R = float>\n-class Post_processing_SISO : public Interface_clone\n+class Post_processing_SISO : public Interface_clone, public Interface_get_set_n_frames\n{\nprotected:\nsize_t n_frames;\n"
},
{
"change_type": "MODIFY",
"old_path": "include/Tools/Codec/Codec.hpp",
"new_path": "include/Tools/Codec/Codec.hpp",
"diff": "#include \"Tools/Interface/Interface_get_set_noise.hpp\"\n#include \"Tools/Interface/Interface_notify_noise_update.hpp\"\n+#include \"Tools/Interface/Interface_get_set_n_frames.hpp\"\n#ifndef _MSC_VER\n#include \"Tools/Interface/Interface_clone.hpp\"\n#endif\n@@ -29,9 +30,14 @@ namespace tools\ntemplate <typename B = int, typename Q = float>\n#ifdef _MSC_VER\n-class Codec : public Interface_get_set_noise, public Interface_notify_noise_update\n+class Codec : public Interface_get_set_noise,\n+ public Interface_notify_noise_update,\n+ public Interface_get_set_n_frames\n#else\n-class Codec : public Interface_get_set_noise, public Interface_notify_noise_update, public Interface_clone\n+class Codec : public Interface_get_set_noise,\n+ public Interface_notify_noise_update,\n+ public Interface_get_set_n_frames,\n+ public Interface_clone\n#endif\n{\nprivate:\n@@ -67,7 +73,7 @@ public:\nvirtual void notify_noise_update();\n- int get_n_frames() const;\n+ size_t get_n_frames() const;\nvirtual void set_n_frames(const size_t n_frames);\n"
},
{
"change_type": "MODIFY",
"old_path": "include/Tools/Codec/Codec.hxx",
"new_path": "include/Tools/Codec/Codec.hxx",
"diff": "@@ -154,10 +154,17 @@ void Codec<B,Q>\n}\ntemplate <typename B, typename Q>\n-int Codec<B,Q>\n+size_t Codec<B,Q>\n::get_n_frames() const\n{\n- return this->get_encoder().get_n_frames();\n+ if (this->encoder == nullptr)\n+ {\n+ std::stringstream message;\n+ message << \"'encoder' is NULL.\";\n+ throw runtime_error(__FILE__, __LINE__, __func__, message.str());\n+ }\n+\n+ return this->encoder->get_n_frames();\n}\ntemplate <typename B, typename Q>\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "include/Tools/Interface/Interface_get_set_n_frames.hpp",
"diff": "+/*!\n+ * \\file\n+ * \\brief Class tools::Interface_get_set_n_frames.\n+ */\n+#ifndef INTERFACE_GET_SET_N_FRAMES_HPP__\n+#define INTERFACE_GET_SET_N_FRAMES_HPP__\n+\n+#include <cstddef> // size_t\n+\n+namespace aff3ct\n+{\n+namespace tools\n+{\n+class Interface_get_set_n_frames\n+{\n+public:\n+ virtual size_t get_n_frames() const = 0;\n+ virtual void set_n_frames(const size_t n_frames) = 0;\n+};\n+\n+}\n+}\n+\n+#endif // INTERFACE_GET_SET_N_FRAMES_HPP__\n\\ No newline at end of file\n"
},
{
"change_type": "MODIFY",
"old_path": "include/Tools/Interleaver/Interleaver_core.hpp",
"new_path": "include/Tools/Interleaver/Interleaver_core.hpp",
"diff": "#include <vector>\n#include \"Tools/Interface/Interface_set_seed.hpp\"\n+#include \"Tools/Interface/Interface_get_set_n_frames.hpp\"\n#ifndef _MSC_VER\n#include \"Tools/Interface/Interface_clone.hpp\"\n#endif\n@@ -20,9 +21,9 @@ namespace tools\n{\ntemplate <typename T = uint32_t>\n#ifdef _MSC_VER\n-class Interleaver_core : public Interface_set_seed\n+class Interleaver_core : public Interface_set_seed, public Interface_get_set_n_frames\n#else\n-class Interleaver_core : public Interface_set_seed, public Interface_clone\n+class Interleaver_core : public Interface_set_seed, public Interface_get_set_n_frames, public Interface_clone\n#endif\n{\nprotected:\n"
},
{
"change_type": "MODIFY",
"old_path": "include/Tools/Sequence/Pipeline.hpp",
"new_path": "include/Tools/Sequence/Pipeline.hpp",
"diff": "#include <memory>\n#include <vector>\n-#include \"Tools/Interface/Interface_clone.hpp\"\n+#include \"Tools/Interface/Interface_get_set_n_frames.hpp\"\n#include \"Tools/Sequence/Sequence.hpp\"\nnamespace aff3ct\n@@ -19,7 +19,7 @@ namespace aff3ct\nnamespace tools\n{\n-class Pipeline\n+class Pipeline : public Interface_get_set_n_frames\n{\nprotected:\nSequence original_sequence;\n"
},
{
"change_type": "MODIFY",
"old_path": "include/Tools/Sequence/Sequence.hpp",
"new_path": "include/Tools/Sequence/Sequence.hpp",
"diff": "#include \"Module/Socket.hpp\"\n#include \"Tools/Interface/Interface_clone.hpp\"\n#include \"Tools/Algo/Tree/Generic/Generic_node.hpp\"\n+#include \"Tools/Interface/Interface_get_set_n_frames.hpp\"\nnamespace aff3ct\n{\n@@ -51,7 +52,7 @@ public:\nusing Sub_sequence = Sub_sequence_generic<std::vector< module::Task*>>;\nusing Sub_sequence_const = Sub_sequence_generic<std::vector<const module::Task*>>;\n-class Sequence : public Interface_clone\n+class Sequence : public Interface_clone, public Interface_get_set_n_frames\n{\nfriend Pipeline;\n"
},
{
"change_type": "MODIFY",
"old_path": "include/aff3ct.hpp",
"new_path": "include/aff3ct.hpp",
"diff": "#ifndef INTERFACE_CLONE_HPP__\n#include <Tools/Interface/Interface_clone.hpp>\n#endif\n+#ifndef INTERFACE_GET_SET_N_FRAMES_HPP__\n+#include <Tools/Interface/Interface_get_set_n_frames.hpp>\n+#endif\n#ifndef INTERFACE_GET_SET_NOISE_HPP__\n#include <Tools/Interface/Interface_get_set_noise.hpp>\n#endif\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
Add a new interface: "tools::Interface_get_set_n_frames".
|
8,486 |
20.11.2020 01:14:05
| -3,600 |
33f4a6b9a3a90b79c7406c51d9b1d71b677811de
|
Add default template value for typename R.
|
[
{
"change_type": "MODIFY",
"old_path": "include/Tools/Constellation/Constellation.hpp",
"new_path": "include/Tools/Constellation/Constellation.hpp",
"diff": "@@ -19,7 +19,7 @@ namespace tools\n* \\brief describe a constellation\n* \\param Symbol_type is the symbol type as a real or a complex\n*/\n-template <typename R>\n+template <typename R = float>\nclass Constellation\n{\npublic:\n"
},
{
"change_type": "MODIFY",
"old_path": "include/Tools/Constellation/PAM/Constellation_PAM.hpp",
"new_path": "include/Tools/Constellation/PAM/Constellation_PAM.hpp",
"diff": "@@ -13,7 +13,7 @@ namespace aff3ct\n{\nnamespace tools\n{\n-template <typename R>\n+template <typename R = float>\nclass Constellation_PAM : public Constellation<R>\n{\npublic:\n"
},
{
"change_type": "MODIFY",
"old_path": "include/Tools/Constellation/PSK/Constellation_PSK.hpp",
"new_path": "include/Tools/Constellation/PSK/Constellation_PSK.hpp",
"diff": "@@ -13,7 +13,7 @@ namespace aff3ct\n{\nnamespace tools\n{\n-template <typename R>\n+template <typename R = float>\nclass Constellation_PSK : public Constellation<R>\n{\npublic:\n"
},
{
"change_type": "MODIFY",
"old_path": "include/Tools/Constellation/QAM/Constellation_QAM.hpp",
"new_path": "include/Tools/Constellation/QAM/Constellation_QAM.hpp",
"diff": "@@ -13,7 +13,7 @@ namespace aff3ct\n{\nnamespace tools\n{\n-template <typename R>\n+template <typename R = float>\nclass Constellation_QAM : public Constellation<R>\n{\npublic:\n"
},
{
"change_type": "MODIFY",
"old_path": "include/Tools/Constellation/User/Constellation_user.hpp",
"new_path": "include/Tools/Constellation/User/Constellation_user.hpp",
"diff": "@@ -13,7 +13,7 @@ namespace aff3ct\n{\nnamespace tools\n{\n-template <typename R>\n+template <typename R = float>\nclass Constellation_user : public Constellation<R>\n{\npublic:\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
Add default template value for typename R.
|
8,486 |
20.11.2020 15:36:48
| -3,600 |
edb6c19562db58e2bde2231175c745bc83ac65e6
|
Add a variable name in 'Attributes& operator+=' declarations.
|
[
{
"change_type": "MODIFY",
"old_path": "include/Module/Monitor/BFER/Monitor_BFER.hpp",
"new_path": "include/Module/Monitor/BFER/Monitor_BFER.hpp",
"diff": "@@ -38,7 +38,7 @@ protected:\nAttributes();\nvoid reset();\n- Attributes& operator+=(const Attributes&);\n+ Attributes& operator+=(const Attributes& a);\n};\nprivate:\n"
},
{
"change_type": "MODIFY",
"old_path": "include/Module/Monitor/EXIT/Monitor_EXIT.hpp",
"new_path": "include/Module/Monitor/EXIT/Monitor_EXIT.hpp",
"diff": "@@ -34,7 +34,7 @@ protected:\nAttributes();\nvoid reset();\n- Attributes& operator+=(const Attributes&);\n+ Attributes& operator+=(const Attributes& a);\n};\nprivate:\n"
},
{
"change_type": "MODIFY",
"old_path": "include/Module/Monitor/MI/Monitor_MI.hpp",
"new_path": "include/Module/Monitor/MI/Monitor_MI.hpp",
"diff": "@@ -38,7 +38,7 @@ protected:\nAttributes();\nvoid reset();\n- Attributes& operator+=(const Attributes&);\n+ Attributes& operator+=(const Attributes& a);\n};\nprivate:\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
Add a variable name in 'Attributes& operator+=' declarations.
|
8,486 |
20.11.2020 16:11:52
| -3,600 |
b40c35643d7c4fb5f174ec74614699f49758d7bd
|
Change default of 'poly' in RSC encoders and 'standard' in RSC_DB encoder.
|
[
{
"change_type": "MODIFY",
"old_path": "include/Module/Encoder/RSC/Encoder_RSC_generic_json_sys.hpp",
"new_path": "include/Module/Encoder/RSC/Encoder_RSC_generic_json_sys.hpp",
"diff": "@@ -25,7 +25,7 @@ private:\npublic:\nEncoder_RSC_generic_json_sys(const int& K, const int& N,\n- const bool buffered_encoding = true, std::vector<int> poly = {5,7},\n+ const bool buffered_encoding = true, std::vector<int> poly = std::vector<int>({5,7}),\nstd::ostream &stream = std::cout);\nvirtual ~Encoder_RSC_generic_json_sys() = default;\n"
},
{
"change_type": "MODIFY",
"old_path": "include/Module/Encoder/RSC/Encoder_RSC_generic_sys.hpp",
"new_path": "include/Module/Encoder/RSC/Encoder_RSC_generic_sys.hpp",
"diff": "@@ -23,7 +23,7 @@ private:\npublic:\nEncoder_RSC_generic_sys(const int& K, const int& N, const bool buffered_encoding = true,\n- std::vector<int> poly = {5,7});\n+ std::vector<int> poly = std::vector<int>({5,7}));\nvirtual ~Encoder_RSC_generic_sys() = default;\nvirtual Encoder_RSC_generic_sys<B>* clone() const;\n"
},
{
"change_type": "MODIFY",
"old_path": "include/Module/Encoder/RSC_DB/Encoder_RSC_DB.hpp",
"new_path": "include/Module/Encoder/RSC_DB/Encoder_RSC_DB.hpp",
"diff": "@@ -26,8 +26,6 @@ class Encoder_RSC_DB: public Encoder<B>\n#endif\nprivate:\n- static const std::string default_std;\n-\nconst int n_ff; // number of D flip-flop\nconst int n_states; // number of states in the trellis\nconst bool buffered_encoding;\n@@ -40,7 +38,7 @@ private:\npublic:\nEncoder_RSC_DB(const int& K, const int& N,\n- const std::string &standard = default_std,\n+ const std::string standard = \"DVB-RCS1\",\nconst bool buffered_encoding = true);\nvirtual ~Encoder_RSC_DB() = default;\n"
},
{
"change_type": "MODIFY",
"old_path": "src/Module/Encoder/RSC_DB/Encoder_RSC_DB.cpp",
"new_path": "src/Module/Encoder/RSC_DB/Encoder_RSC_DB.cpp",
"diff": "using namespace aff3ct;\nusing namespace aff3ct::module;\n-template <typename B>\n-const std::string aff3ct::module::Encoder_RSC_DB<B>::default_std = \"DVB-RCS1\";\n-\ntemplate <typename B>\nEncoder_RSC_DB<B>\n-::Encoder_RSC_DB(const int& K, const int& N, const std::string &standard, const bool buffered_encoding)\n+::Encoder_RSC_DB(const int& K, const int& N, const std::string standard, const bool buffered_encoding)\n: Encoder<B> (K, N),\nn_ff (standard == \"DVB-RCS1\" ? 3 : 4),\nn_states (1 << n_ff),\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
Change default of 'poly' in RSC encoders and 'standard' in RSC_DB encoder.
|
8,490 |
28.11.2020 14:04:16
| -3,600 |
dc30617b9917815a583244e1ff9dfb59ff1836e0
|
Add 'tools::Interface_is_done' and manage it in 'tools::Sequence'.
|
[
{
"change_type": "MODIFY",
"old_path": "include/Module/Monitor/Monitor.hpp",
"new_path": "include/Module/Monitor/Monitor.hpp",
"diff": "#include <cstddef>\n#include \"Tools/Interface/Interface_reset.hpp\"\n+#include \"Tools/Interface/Interface_is_done.hpp\"\n#include \"Module/Module.hpp\"\nnamespace aff3ct\n@@ -35,7 +36,7 @@ namespace module\n*\n* Please use Monitor for inheritance (instead of Monitor).\n*/\n-class Monitor : public Module, public tools::Interface_reset\n+class Monitor : public Module, public tools::Interface_reset, public tools::Interface_is_done\n{\npublic:\n"
},
{
"change_type": "MODIFY",
"old_path": "include/Module/Source/Source.hpp",
"new_path": "include/Module/Source/Source.hpp",
"diff": "#include <vector>\n#include \"Tools/Interface/Interface_set_seed.hpp\"\n+#include \"Tools/Interface/Interface_is_done.hpp\"\n#include \"Tools/Interface/Interface_reset.hpp\"\n#include \"Module/Task.hpp\"\n#include \"Module/Socket.hpp\"\n@@ -39,7 +40,9 @@ namespace module\n* Please use Source for inheritance (instead of Source).\n*/\ntemplate <typename B = int>\n-class Source : public Module, public tools::Interface_set_seed, public tools::Interface_reset\n+class Source : public Module, public tools::Interface_set_seed,\n+ public tools::Interface_is_done,\n+ public tools::Interface_reset\n{\npublic:\ninline Task& operator[](const src::tsk t);\n@@ -77,7 +80,7 @@ public:\nvirtual void set_seed(const int seed);\n- virtual bool is_over() const;\n+ virtual bool is_done() const;\nvirtual void reset();\n"
},
{
"change_type": "MODIFY",
"old_path": "include/Module/Source/Source.hxx",
"new_path": "include/Module/Source/Source.hxx",
"diff": "@@ -98,7 +98,7 @@ void Source<B>\ntemplate <typename B>\nbool Source<B>\n-::is_over() const\n+::is_done() const\n{\nreturn false;\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "include/Module/Source/User/Source_user_binary.hpp",
"new_path": "include/Module/Source/User/Source_user_binary.hpp",
"diff": "@@ -19,7 +19,7 @@ private:\nstd::ifstream source_file;\nconst bool auto_reset;\nconst bool fifo_mode;\n- bool over;\n+ bool done;\nsize_t n_left;\nstd::vector<char> memblk;\nstd::vector<B> left_bits; // to store bits that are left by last call (n_left & n_completing)\n@@ -31,7 +31,7 @@ public:\nconst bool fifo_mode = false);\nvirtual ~Source_user_binary() = default;\n- virtual bool is_over() const;\n+ virtual bool is_done() const;\nvirtual void reset();\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "include/Tools/Interface/Interface_is_done.hpp",
"diff": "+/*!\n+ * \\file\n+ * \\brief Class tools::Interface_is_done.\n+ */\n+#ifndef INTERFACE_IS_DONE_HPP__\n+#define INTERFACE_IS_DONE_HPP__\n+\n+namespace aff3ct\n+{\n+namespace tools\n+{\n+class Interface_is_done\n+{\n+public:\n+ virtual bool is_done() const = 0;\n+};\n+\n+}\n+}\n+\n+#endif // INTERFACE_CLONE_HPP__\n\\ No newline at end of file\n"
},
{
"change_type": "MODIFY",
"old_path": "include/Tools/Sequence/Sequence.hpp",
"new_path": "include/Tools/Sequence/Sequence.hpp",
"diff": "#include \"Tools/Interface/Interface_clone.hpp\"\n#include \"Tools/Algo/Tree/Generic/Generic_node.hpp\"\n#include \"Tools/Interface/Interface_get_set_n_frames.hpp\"\n+#include \"Tools/Interface/Interface_is_done.hpp\"\nnamespace aff3ct\n{\n@@ -75,6 +76,7 @@ protected:\nstd::vector<size_t> puids;\nbool no_copy_mode;\nconst std::vector<const module::Task*> saved_exclusions;\n+ std::vector<tools::Interface_is_done*> donners;\npublic:\nSequence(const std::vector<const module::Task*> &firsts,\n@@ -140,7 +142,8 @@ public:\nvoid exec(std::function<bool(const std::vector<const int*>&)> stop_condition);\nvoid exec(std::function<bool( )> stop_condition);\n- void exec(const size_t tid = 0, const int frame_id = -1 );\n+ void exec( );\n+ void exec_seq(const size_t tid = 0, const int frame_id = -1);\ninline size_t get_n_threads() const;\ntemplate <class C = module::Module>\n"
},
{
"change_type": "MODIFY",
"old_path": "include/aff3ct.hpp",
"new_path": "include/aff3ct.hpp",
"diff": "#ifndef INTERFACE_GET_SET_NOISE_HPP__\n#include <Tools/Interface/Interface_get_set_noise.hpp>\n#endif\n+#ifndef INTERFACE_IS_DONE_HPP__\n+#include <Tools/Interface/Interface_is_done.hpp>\n+#endif\n#ifndef INTERFACE_NOTIFY_FROZENBITS_UPDATE_HPP__\n#include <Tools/Interface/Interface_notify_frozenbits_update.hpp>\n#endif\n"
},
{
"change_type": "MODIFY",
"old_path": "src/Module/Source/User/Source_user_binary.cpp",
"new_path": "src/Module/Source/User/Source_user_binary.cpp",
"diff": "@@ -15,7 +15,7 @@ Source_user_binary<B>\nsource_file(filename.c_str(), std::ios::in | std::ios::binary),\nauto_reset(fifo_mode ? true : auto_reset),\nfifo_mode(fifo_mode),\n- over(false),\n+ done(false),\nn_left(0),\nmemblk(K),\nleft_bits(CHAR_BIT)\n@@ -40,22 +40,22 @@ void Source_user_binary<B>\nsource_file.seekg(0, std::ios::beg);\nif (source_file.fail())\nthrow tools::runtime_error(__FILE__, __LINE__, __func__, \"Could not go back to the beginning of the file.\");\n- this->over = false;\n+ this->done = false;\nthis->n_left = 0;\n}\ntemplate <typename B>\nbool Source_user_binary<B>\n-::is_over() const\n+::is_done() const\n{\n- return this->over;\n+ return this->done;\n}\ntemplate <typename B>\nvoid Source_user_binary<B>\n::_generate(B *U_K, const size_t frame_id)\n{\n- if (this->is_over())\n+ if (this->is_done())\nstd::fill(U_K, U_K + this->K, (B)0);\nelse\n{\n@@ -93,7 +93,7 @@ void Source_user_binary<B>\nthis->n_left = tmp_n_left < 0 ? (size_t)0 : (size_t)tmp_n_left;\nif (!this->auto_reset && source_file.eof())\n- this->over = true;\n+ this->done = true;\n}\nelse\n{\n"
},
{
"change_type": "MODIFY",
"old_path": "src/Module/Subsequence/Subsequence.cpp",
"new_path": "src/Module/Subsequence/Subsequence.cpp",
"diff": "@@ -121,8 +121,8 @@ void Subsequence\n}\n}\n- // execute all frames\n- ss.get_sequence().exec();\n+ // execute all frames sequentially\n+ ss.get_sequence().exec_seq();\nreturn status_t::SUCCESS;\n});\n"
},
{
"change_type": "MODIFY",
"old_path": "src/Tools/Sequence/Sequence.cpp",
"new_path": "src/Tools/Sequence/Sequence.cpp",
"diff": "@@ -286,6 +286,7 @@ void Sequence\nthis->_init<SS>(root);\nthis->update_firsts_and_lasts_tasks();\nthis->gen_processes();\n+ this->donners = get_modules<tools::Interface_is_done>(true);\n}\nSequence* Sequence\n@@ -621,7 +622,19 @@ void Sequence\n}\nvoid Sequence\n-::exec(const size_t tid, const int frame_id)\n+::exec()\n+{\n+ this->exec([this]()\n+ {\n+ for (auto donner : this->donners)\n+ if (donner->is_done())\n+ return true;\n+ return false;\n+ });\n+}\n+\n+void Sequence\n+::exec_seq(const size_t tid, const int frame_id)\n{\nif (tid >= this->sequences.size())\n{\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
Add 'tools::Interface_is_done' and manage it in 'tools::Sequence'.
|
8,486 |
02.12.2020 23:49:31
| -3,600 |
0a3af3a84e0b22097684f68d9205dbfce1aca965
|
Remove reference for trellis attribute of Decoder_RSC_BCJR.
|
[
{
"change_type": "MODIFY",
"old_path": "include/Module/Decoder/RSC/BCJR/Decoder_RSC_BCJR.hpp",
"new_path": "include/Module/Decoder/RSC/BCJR/Decoder_RSC_BCJR.hpp",
"diff": "@@ -22,7 +22,7 @@ protected:\nconst int n_ff;\nconst bool buffered_encoding;\n- const std::vector<std::vector<int>> &trellis;\n+ const std::vector<std::vector<int>> trellis;\nmipp::vector<R> sys, par; // input LLR from the channel\nmipp::vector<R> ext; // extrinsic LLRs\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
Remove reference for trellis attribute of Decoder_RSC_BCJR.
|
8,486 |
04.12.2020 00:54:02
| -3,600 |
8a11f4275ad80ea82032b2f68e05544f605b6ce1
|
Fix notify_frozenbits_update declarations.
|
[
{
"change_type": "MODIFY",
"old_path": "include/Module/Decoder/Polar/ASCL/Decoder_polar_ASCL_MEM_fast_CA_sys.hpp",
"new_path": "include/Module/Decoder/Polar/ASCL/Decoder_polar_ASCL_MEM_fast_CA_sys.hpp",
"diff": "@@ -47,7 +47,7 @@ public:\nvirtual Decoder_polar_ASCL_MEM_fast_CA_sys<B,R,API_polar>* clone() const;\n- virtual void notify_frozenbits_update(const std::vector<bool>&);\n+ virtual void notify_frozenbits_update(const std::vector<bool>& frozen_bits);\nvirtual void set_n_frames(const size_t n_frames);\n"
},
{
"change_type": "MODIFY",
"old_path": "include/Module/Decoder/Polar/ASCL/Decoder_polar_ASCL_fast_CA_sys.hpp",
"new_path": "include/Module/Decoder/Polar/ASCL/Decoder_polar_ASCL_fast_CA_sys.hpp",
"diff": "@@ -45,7 +45,7 @@ public:\nvirtual Decoder_polar_ASCL_fast_CA_sys<B,R,API_polar>* clone() const;\n- virtual void notify_frozenbits_update(const std::vector<bool>&);\n+ virtual void notify_frozenbits_update(const std::vector<bool>& frozen_bits);\nvirtual void set_n_frames(const size_t n_frames);\n"
},
{
"change_type": "MODIFY",
"old_path": "include/Module/Decoder/Polar/SC/Decoder_polar_SC_fast_sys.hpp",
"new_path": "include/Module/Decoder/Polar/SC/Decoder_polar_SC_fast_sys.hpp",
"diff": "@@ -58,7 +58,7 @@ public:\nvirtual Decoder_polar_SC_fast_sys<B,R,API_polar>* clone() const;\n- virtual void notify_frozenbits_update(const std::vector<bool>&);\n+ virtual void notify_frozenbits_update(const std::vector<bool>& frozen_bits);\nprotected:\nvoid _load (const R *Y_N );\n"
},
{
"change_type": "MODIFY",
"old_path": "include/Module/Decoder/Polar/SC/Decoder_polar_SC_naive.hpp",
"new_path": "include/Module/Decoder/Polar/SC/Decoder_polar_SC_naive.hpp",
"diff": "@@ -46,7 +46,7 @@ public:\nvirtual Decoder_polar_SC_naive<B,R,F,G,H>* clone() const;\n- virtual void notify_frozenbits_update(const std::vector<bool>&);\n+ virtual void notify_frozenbits_update(const std::vector<bool>& frozen_bits);\nprotected:\nvirtual void deep_copy (const Decoder_polar_SC_naive<B,R,F,G,H>& m);\n"
},
{
"change_type": "MODIFY",
"old_path": "include/Module/Decoder/Polar/SCL/Decoder_polar_SCL_MEM_fast_sys.hpp",
"new_path": "include/Module/Decoder/Polar/SCL/Decoder_polar_SCL_MEM_fast_sys.hpp",
"diff": "@@ -72,7 +72,7 @@ public:\nvirtual Decoder_polar_SCL_MEM_fast_sys<B,R,API_polar>* clone() const;\n- virtual void notify_frozenbits_update(const std::vector<bool>&);\n+ virtual void notify_frozenbits_update(const std::vector<bool>& frozen_bits);\nprotected:\nvirtual void _decode (const R *Y_N );\n"
},
{
"change_type": "MODIFY",
"old_path": "include/Module/Decoder/Polar/SCL/Decoder_polar_SCL_fast_sys.hpp",
"new_path": "include/Module/Decoder/Polar/SCL/Decoder_polar_SCL_fast_sys.hpp",
"diff": "@@ -67,7 +67,7 @@ public:\nvirtual Decoder_polar_SCL_fast_sys<B,R,API_polar>* clone() const;\n- virtual void notify_frozenbits_update(const std::vector<bool>&);\n+ virtual void notify_frozenbits_update(const std::vector<bool>& frozen_bits);\nprotected:\nvirtual void _decode (const R *Y_N );\n"
},
{
"change_type": "MODIFY",
"old_path": "include/Module/Decoder/Polar/SCL/Decoder_polar_SCL_naive.hpp",
"new_path": "include/Module/Decoder/Polar/SCL/Decoder_polar_SCL_naive.hpp",
"diff": "@@ -52,7 +52,7 @@ public:\nvirtual Decoder_polar_SCL_naive<B,R,F,G>* clone() const;\n- virtual void notify_frozenbits_update(const std::vector<bool>&);\n+ virtual void notify_frozenbits_update(const std::vector<bool>& frozen_bits);\nprotected:\nvirtual void deep_copy (const Decoder_polar_SCL_naive<B,R,F,G>& m);\n"
},
{
"change_type": "MODIFY",
"old_path": "include/Module/Decoder/Polar_MK/SC/Decoder_polar_MK_SC_naive.hpp",
"new_path": "include/Module/Decoder/Polar_MK/SC/Decoder_polar_MK_SC_naive.hpp",
"diff": "@@ -73,7 +73,7 @@ public:\nvirtual Decoder_polar_MK_SC_naive<B,R>* clone() const;\n- virtual void notify_frozenbits_update(const std::vector<bool>&);\n+ virtual void notify_frozenbits_update(const std::vector<bool>& frozen_bits);\nprotected:\nvirtual void deep_copy (const Decoder_polar_MK_SC_naive<B,R>& m );\n"
},
{
"change_type": "MODIFY",
"old_path": "include/Module/Decoder/Polar_MK/SCL/Decoder_polar_MK_SCL_naive.hpp",
"new_path": "include/Module/Decoder/Polar_MK/SCL/Decoder_polar_MK_SCL_naive.hpp",
"diff": "@@ -71,7 +71,7 @@ public:\nvirtual Decoder_polar_MK_SCL_naive<B,R>* clone() const;\n- virtual void notify_frozenbits_update(const std::vector<bool>&);\n+ virtual void notify_frozenbits_update(const std::vector<bool>& frozen_bits);\nprotected:\nvirtual void deep_copy (const Decoder_polar_MK_SCL_naive<B,R>& m);\n"
},
{
"change_type": "MODIFY",
"old_path": "include/Tools/Interface/Interface_notify_frozenbits_update.hpp",
"new_path": "include/Tools/Interface/Interface_notify_frozenbits_update.hpp",
"diff": "@@ -14,7 +14,7 @@ namespace tools\nclass Interface_notify_frozenbits_update\n{\npublic:\n- virtual void notify_frozenbits_update(const std::vector<bool>&) = 0;\n+ virtual void notify_frozenbits_update(const std::vector<bool>& frozen_bits) = 0;\n};\n}\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
Fix notify_frozenbits_update declarations.
|
8,486 |
04.12.2020 17:10:35
| -3,600 |
c90ae5355c38323b5d4d3289a6e43b62a3a519f1
|
Update sequence for notifying clones.
|
[
{
"change_type": "MODIFY",
"old_path": "src/Simulation/Sequence/BFER/Iterative/Simulation_sequence_BFER_ite.cpp",
"new_path": "src/Simulation/Sequence/BFER/Iterative/Simulation_sequence_BFER_ite.cpp",
"diff": "@@ -664,8 +664,13 @@ void Simulation_sequence_BFER_ite<B,R,Q>\nm->set_seed(prng());\nauto fb_modules = this->sequence->template get_modules<tools::Interface_notify_frozenbits_update>();\n+ if (fb_modules.size())\n+ {\n+ this->noise->record_callback_update([fb_modules](){\nfor (auto &m : fb_modules)\nm->notify_frozenbits_update(fb_modules[0]->get_frozen_bits());\n+ });\n+ }\nthis->interleaver_core->set_seed(params_BFER_ite.itl->core->seed);\nif (this->interleaver_core->is_uniform())\n"
},
{
"change_type": "MODIFY",
"old_path": "src/Simulation/Sequence/BFER/Standard/Simulation_sequence_BFER_std.cpp",
"new_path": "src/Simulation/Sequence/BFER/Standard/Simulation_sequence_BFER_std.cpp",
"diff": "@@ -573,8 +573,13 @@ void Simulation_sequence_BFER_std<B,R,Q>\nm->set_seed(prng());\nauto fb_modules = this->sequence->template get_modules<tools::Interface_notify_frozenbits_update>();\n+ if (fb_modules.size())\n+ {\n+ this->noise->record_callback_update([fb_modules](){\nfor (auto &m : fb_modules)\nm->notify_frozenbits_update(fb_modules[0]->get_frozen_bits());\n+ });\n+ }\nbool is_interleaver = true;\ntry\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
Update sequence for notifying clones.
|
8,492 |
03.09.2019 18:05:06
| -7,200 |
ebad9f0e227375220bc137d2336ebda3f21dc028
|
remove throw clause on function declaration
|
[
{
"change_type": "MODIFY",
"old_path": "abi/02_aff3ct_read_clang_ast.py",
"new_path": "abi/02_aff3ct_read_clang_ast.py",
"diff": "@@ -629,7 +629,8 @@ def process_ast(ast_filename):\nmethod_suffix = m.group(2)\nelse:\n# special case for '= default' (no trailing ';' in Clang AST print)\n- m = re.match(r'(.*\\))[^)]*( = default)$', line)\n+ line_tmp = re.sub(r' throw\\(\\)', '', line)\n+ m = re.match(r'(.*\\))[^)]*( = default)$', line_tmp)\nif m is not None:\nmethod = m.group(1)\nmethod_suffix = m.group(2)\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
remove throw clause on function declaration
|
8,485 |
04.09.2019 17:18:05
| -7,200 |
8353cd45353c484f6560f78d85ea0f1e4477cc41
|
extract templates from method declarations
|
[
{
"change_type": "MODIFY",
"old_path": "abi/02_aff3ct_read_clang_ast.py",
"new_path": "abi/02_aff3ct_read_clang_ast.py",
"diff": "@@ -168,10 +168,117 @@ def split_args(arg_str):\nreturn args\n+# process one template arg, mainly to extract its default value if it has one\n+def process_template_arg(template_arg_signature, template_arg_rank):\n+ m = re.match(r'([^=]+)(?:=(.+))?', template_arg_signature)\n+ if m is None:\n+ sys.stderr.write('parse error: template arg name extraction failed')\n+ sys.exit(1)\n+ template_arg_name = m.group(1).strip()\n+ if m.group(2) is not None:\n+ template_arg_default = m.group(2).strip()\n+ else:\n+ template_arg_default = ''\n+\n+ template_arg_entry = dict()\n+ template_arg_entry['template_arg_signature'] = template_arg_signature\n+ template_arg_entry['template_arg_name'] = template_arg_name\n+ template_arg_entry['template_arg_default'] = template_arg_default\n+ return template_arg_entry\n+\n+# process a method template declaration\n+def process_template(template_signature, template_rank):\n+ template_entry = dict()\n+ template_entry['template_signature'] = template_signature\n+ template_entry['template_args'] = []\n+ template_args_str = re.sub(r'template *<(.*)>', r'\\1', template_signature)\n+ template_args = split_args(template_args_str)\n+\n+ template_arg_i = 0\n+ for template_arg in template_args:\n+ template_arg_entry = process_template_arg(template_arg, template_arg_i)\n+ template_arg_i = template_arg_i+1\n+ template_entry['template_args'].append(template_arg_entry)\n+ template_entry['template_nb_args'] = template_arg_i\n+\n+ return template_entry\n+\n+# process method templates declarations\n+def add_templates(method_entry, templates):\n+ template_i = 0\n+ for template in templates:\n+ template_entry = process_template(template, template_i)\n+ template_i = template_i+1\n+ method_entry['method_templates'].append(template_entry)\n+ method_entry['method_nb_templates'] = template_i\n+\n+# split the template declaration part of a method declaration\n+def split_templates(method_str):\n+ templates = []\n+ if not method_str.startswith('template'):\n+ return (method_str, templates)\n+ angle_brackets = 0\n+ square_brackets = 0\n+ curly_brackets = 0\n+ parenthesis = 0\n+ n = len(method_str)\n+ start_i = 0\n+ i = len('template')\n+ while i < n:\n+ c = method_str[i]\n+ if c == ' ':\n+ pass # nothing\n+\n+ elif c == r'[':\n+ square_brackets = square_brackets+1\n+ elif c == r']':\n+ square_brackets = square_brackets-1\n+\n+ elif c == r'<':\n+ angle_brackets = angle_brackets+1\n+ elif c == r'>':\n+ angle_brackets = angle_brackets-1\n+\n+ elif c == r'{':\n+ curly_brackets = curly_brackets+1\n+ elif c == r'}':\n+ curly_brackets = curly_brackets-1\n+\n+ elif c == r'(':\n+ parenthesis = parenthesis+1\n+ elif c == r')':\n+ parenthesis = parenthesis-1\n+\n+ elif method_str[i:].startswith('template'):\n+ if angle_brackets == 0 and square_brackets == 0 and curly_brackets == 0 and parenthesis == 0:\n+ if i <= start_i or i == n-1:\n+ sys.stderr.write('parse error: template list\\n')\n+ sys.exit(1)\n+ # found template prefix with no pending open bracket, extract the corresponding chunk\n+ template = method_str[start_i:i].strip()\n+ templates.append(template)\n+\n+ start_i = i\n+ i = i+len('template')\n+ else:\n+ if angle_brackets == 0 and square_brackets == 0 and curly_brackets == 0 and parenthesis == 0:\n+ if i <= start_i or i == n-1:\n+ sys.stderr.write('parse error: template list\\n')\n+ sys.exit(1)\n+ # found something that is not a template, stop here\n+ template = method_str[start_i:i].strip()\n+ templates.append(template)\n+ break\n+\n+ i = i+1\n+\n+ return (method_str[i:].strip(), templates)\n+\n+\n# detect a class method and record corresponding entry\n# - method_is_inline indicate whether the method is defined in the class (True) or just declared (False)\n# - method_suffix store trailing method declaration items (such as \"= 0\" for pure virtual methods)\n-def add_method(class_entry, method, method_is_inline, method_suffix):\n+def add_method(class_entry, method, method_is_inline, method_suffix, method_templates):\nmethod_entry = dict()\nclass_short_name = class_entry['class_short_name']\nmethod_is_virtual = False\n@@ -285,6 +392,10 @@ def add_method(class_entry, method, method_is_inline, method_suffix):\nargs = split_args(method_args)\nadd_args(method_entry, args)\n+ # process method templates\n+ method_entry['method_templates'] = []\n+ add_templates(method_entry, method_templates)\n+\n# process output\nif method_kind in [ 'static', 'method' ]:\n# skip operators for now\n@@ -522,6 +633,7 @@ def process_ast(ast_filename):\nscopes.append((scope, scope_entry, block_nest_level))\nprev_scope_entry = scope_entry\nmethod = m.group(1)\n+ (method, method_templates) = split_templates(method)\nif ' : ' in method:\n# remove any member initializer in constructor\nmethod = re.sub(' : .*$', '', method)\n@@ -532,7 +644,7 @@ def process_ast(ast_filename):\nif not filter_out:\n# only record public class members\nif previous_scope == 'class' and class_access == 'public':\n- method_entry = add_method(class_entry, method, True, '')\n+ method_entry = add_method(class_entry, method, True, '', method_templates)\nif method_entry is not None:\nmethod_unique_name = method_entry['method_unique_name']\nmethod_unique_short_name = method_entry['method_unique_short_name']\n@@ -622,21 +734,22 @@ def process_ast(ast_filename):\nif scope == 'class' and class_access == 'public':\nmethod = None\n+ (method_line_perhaps, method_templates) = split_templates(line.strip())\n# heuristic to match a method declaration\n- m = re.match(r'(.*\\))([^)]*);', line)\n+ m = re.match(r'(.*\\))([^)]*);', method_line_perhaps)\nif m is not None:\nmethod = m.group(1)\nmethod_suffix = m.group(2)\nelse:\n# special case for '= default' (no trailing ';' in Clang AST print)\n- line_tmp = re.sub(r' throw\\(\\)', '', line)\n- m = re.match(r'(.*\\))[^)]*( = default)$', line_tmp)\n+ method_line_perhaps = re.sub(r' throw\\(\\)', '', method_line_perhaps)\n+ m = re.match(r'(.*\\))[^)]*( = default)$', method_line_perhaps)\nif m is not None:\nmethod = m.group(1)\nmethod_suffix = m.group(2)\nif method is not None:\n# some method found, add it to db\n- method_entry = add_method(class_entry, method, False, method_suffix)\n+ method_entry = add_method(class_entry, method, False, method_suffix, method_templates)\nif method_entry is not None:\nmethod_unique_name = method_entry['method_unique_name']\nmethod_unique_short_name = method_entry['method_unique_short_name']\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
extract templates from method declarations
|
8,485 |
13.09.2019 17:21:20
| -7,200 |
8d5b2af368363e45e881cc0060caa11b74ebb010
|
keep class template informations
|
[
{
"change_type": "MODIFY",
"old_path": "abi/02_aff3ct_read_clang_ast.py",
"new_path": "abi/02_aff3ct_read_clang_ast.py",
"diff": "@@ -186,7 +186,7 @@ def process_template_arg(template_arg_signature, template_arg_rank):\ntemplate_arg_entry['template_arg_default'] = template_arg_default\nreturn template_arg_entry\n-# process a method template declaration\n+# process a template declaration\ndef process_template(template_signature, template_rank):\ntemplate_entry = dict()\ntemplate_entry['template_signature'] = template_signature\n@@ -204,7 +204,7 @@ def process_template(template_signature, template_rank):\nreturn template_entry\n# process method templates declarations\n-def add_templates(method_entry, templates):\n+def add_method_templates(method_entry, templates):\ntemplate_i = 0\nfor template in templates:\ntemplate_entry = process_template(template, template_i)\n@@ -212,20 +212,30 @@ def add_templates(method_entry, templates):\nmethod_entry['method_templates'].append(template_entry)\nmethod_entry['method_nb_templates'] = template_i\n-# split the template declaration part of a method declaration\n-def split_templates(method_str):\n+# process class templates declarations\n+def add_class_templates(class_entry, templates):\n+ template_i = 0\n+ for template in templates:\n+ template_entry = process_template(template, template_i)\n+ template_i = template_i+1\n+ class_entry['class_templates'].append(template_entry)\n+ class_entry['class_nb_templates'] = template_i\n+\n+# split the template part of a declaration\n+def split_templates(declaration_str):\ntemplates = []\n- if not method_str.startswith('template'):\n- return (method_str, templates)\n+ declaration_str = declaration_str.strip()\n+ if not declaration_str.startswith('template'):\n+ return (declaration_str, templates)\nangle_brackets = 0\nsquare_brackets = 0\ncurly_brackets = 0\nparenthesis = 0\n- n = len(method_str)\n+ n = len(declaration_str)\nstart_i = 0\ni = len('template')\nwhile i < n:\n- c = method_str[i]\n+ c = declaration_str[i]\nif c == ' ':\npass # nothing\n@@ -249,13 +259,13 @@ def split_templates(method_str):\nelif c == r')':\nparenthesis = parenthesis-1\n- elif method_str[i:].startswith('template'):\n+ elif declaration_str[i:].startswith('template'):\nif angle_brackets == 0 and square_brackets == 0 and curly_brackets == 0 and parenthesis == 0:\nif i <= start_i or i == n-1:\nsys.stderr.write('parse error: template list\\n')\nsys.exit(1)\n# found template prefix with no pending open bracket, extract the corresponding chunk\n- template = method_str[start_i:i].strip()\n+ template = declaration_str[start_i:i].strip()\ntemplates.append(template)\nstart_i = i\n@@ -266,13 +276,13 @@ def split_templates(method_str):\nsys.stderr.write('parse error: template list\\n')\nsys.exit(1)\n# found something that is not a template, stop here\n- template = method_str[start_i:i].strip()\n+ template = declaration_str[start_i:i].strip()\ntemplates.append(template)\nbreak\ni = i+1\n- return (method_str[i:].strip(), templates)\n+ return (declaration_str[i:].strip(), templates)\n# detect a class method and record corresponding entry\n@@ -394,7 +404,7 @@ def add_method(class_entry, method, method_is_inline, method_suffix, method_temp\n# process method templates\nmethod_entry['method_templates'] = []\n- add_templates(method_entry, method_templates)\n+ add_method_templates(method_entry, method_templates)\n# process output\nif method_kind in [ 'static', 'method' ]:\n@@ -429,7 +439,7 @@ def add_method(class_entry, method, method_is_inline, method_suffix, method_temp\n# add a new class to the db\n# - name_path_str is the full qualified name including namespace(s)\n# - class_inheritence is the right hand side of the class declaration, stating base class(es)\n-def add_class(db, name_path_str, class_short_name, class_inheritence):\n+def add_class(db, name_path_str, class_short_name, class_inheritence, class_template_part):\n# initialize a class entry\nclass_entry = dict()\nclass_entry['class_name'] = name_path_str\n@@ -446,6 +456,9 @@ def add_class(db, name_path_str, class_short_name, class_inheritence):\nclass_entry['class_fixme_methods'] = dict()\nclass_entry['class_is_abstract'] = False\nclass_entry['class_is_module'] = False\n+ class_entry['class_templates'] = []\n+ (_,class_templates) = split_templates(class_template_part+' dummy')\n+ add_class_templates(class_entry, class_templates)\ndb[name_path_str] = class_entry\nreturn class_entry\n@@ -600,7 +613,7 @@ def process_ast(ast_filename):\nscopes.append((scope, scope_entry, block_nest_level))\n# entering class\n- template_part = m.group(1).strip()\n+ class_template_part = m.group(1).strip()\nclass_short_name = m.group(2)\nclass_inheritence = m.group(3)\nclass_access = default_class_access\n@@ -610,7 +623,7 @@ def process_ast(ast_filename):\n# if class not already known, add it to 'db'\nif name_path_str not in db:\n- add_class(db, name_path_str, class_short_name, class_inheritence)\n+ add_class(db, name_path_str, class_short_name, class_inheritence, class_template_part)\nclass_entry = db[name_path_str]\nscope = 'class'\n@@ -620,9 +633,9 @@ def process_ast(ast_filename):\nif not filter_out:\nif debug_mode:\nprint('==> class_name:', class_name)\n- if template_part != '':\n+ if class_template_part != '':\nif debug_mode:\n- print('=== template part:', template_part)\n+ print('=== class template part:', class_template_part)\ncontinue\n# try to match a method definition (e.g. with associated block of code)\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
keep class template informations
|
8,492 |
17.09.2019 11:33:51
| -7,200 |
07229cf3f836065599c9ee5a87f4952b7003ae5c
|
handle default arg values in task detection
|
[
{
"change_type": "MODIFY",
"old_path": "abi/02_aff3ct_read_clang_ast.py",
"new_path": "abi/02_aff3ct_read_clang_ast.py",
"diff": "@@ -813,16 +813,23 @@ def find_task_method(class_entry, module_task_entry):\n# lookup all methods\nfor method, method_entry in class_entry['class_all_methods_index'].items():\n# early filter out unlikely candidates\n- if ('method_output' not in method_entry or method_entry['method_output'] is None) and method_entry['method_short_name'] == module_task_name and method_entry['method_nb_arguments'] == module_task_nb_sockets:\n+ if 'method_output' in method_entry and method_entry['method_output'] is not None:\n+ continue\n+ if method_entry['method_short_name'] != module_task_name:\n+ continue\nmethod_args = method_entry['method_arguments']\nmethod_is_task = True\n# also check that the number of arguments and their type match the task sockets\n- for i in range(module_task_nb_sockets):\n+ j = 0\n+ for i in range(method_entry['method_nb_arguments']):\nmethod_arg = method_args[i]\n- method_task_socket = module_task_sockets[i]\n+ if '=' in method_arg:\n+ continue\n+ method_task_socket = module_task_sockets[j]\nif method_task_socket['soc_type']+' []' != method_arg['arg_type']:\nmethod_is_task = False\nbreak\n+ j = j+1\nif method_is_task:\nreturn method_entry\nreturn None\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
handle default arg values in task detection
|
8,492 |
18.09.2019 14:47:16
| -7,200 |
9a2510aafde9409c7601b46e05f72add69b0a598
|
skip arguments with default values in socket generation
|
[
{
"change_type": "MODIFY",
"old_path": "abi/02_aff3ct_read_clang_ast.py",
"new_path": "abi/02_aff3ct_read_clang_ast.py",
"diff": "@@ -10,6 +10,8 @@ import sys\n# enable additional output and dump internal_db\ndebug_mode = False\n+setting_keep_task_method = True\n+\n# process one method argument\ndef process_arg(arg_signature, arg_rank):\narg_is_const = False\n@@ -826,10 +828,16 @@ def find_task_method(class_entry, module_task_entry):\nif '=' in method_arg:\ncontinue\nmethod_task_socket = module_task_sockets[j]\n- if method_task_socket['soc_type']+' []' != method_arg['arg_type']:\n+ method_arg_type = method_arg['arg_type']\n+ if method_arg_type.endswith(']') and method_task_socket['soc_type']+' []' != method_arg_type:\n+ method_is_task = False\n+ break\n+ elif method_arg_type.endswith(('*','&')) and method_task_socket['soc_type'] != method_arg_type:\nmethod_is_task = False\nbreak\nj = j+1\n+ if j >= module_task_nb_sockets:\n+ break\nif method_is_task:\nreturn method_entry\nreturn None\n@@ -844,13 +852,21 @@ def make_task(class_entry, method_entry, module_task_entry):\n# change method kind into 'task'\nmethod_entry['method_kind'] = 'task'\n+ socket_nb = 0\nfor socket in method_entry['method_arguments']:\n+ if '=' in socket['arg_signature']:\n+ continue\n# copy() is mandatory here, as keys() aliases the dict keys list which will be modified\nold_keys = socket.copy().keys()\nfor old_key in old_keys:\nnew_key = 'soc'+old_key[3:]\n+ if setting_keep_task_method:\n+ socket[new_key] = socket[old_key]\n+ else:\nsocket[new_key] = socket.pop(old_key)\n- module_task_socket = module_task_entry['sockets'][socket['soc_rank']]\n+ socket_rank = socket['soc_rank']\n+ socket_nb = socket_nb+1\n+ module_task_socket = module_task_entry['sockets'][socket_rank]\nif socket['soc_shape'] != '<fixme>':\nsys.stderr.write(\"invalid socket shape\" + \"\\n\")\nsys.exit(1)\n@@ -870,8 +886,14 @@ def make_task(class_entry, method_entry, module_task_entry):\nsys.exit(1)\nsocket['soc_dir'] = socket_dir\nsocket['soc_fixme'] = False\n+\n+ method_entry['method_nb_sockets'] = socket_nb\n+ if setting_keep_task_method:\n+ method_entry['method_sockets'] = method_entry['method_arguments']\n+ class_entry['class_tasks'][method] = method_entry\n+ else:\nmethod_entry['method_fixme'] = False\n- method_entry['method_nb_sockets'] = method_entry.pop('method_nb_arguments')\n+ method_entry.pop('method_nb_arguments')\nmethod_entry['method_sockets'] = method_entry.pop('method_arguments')\nclass_entry['class_tasks'][method] = class_entry['class_methods'].pop(method)\ndel class_entry['class_fixme_methods'][method]\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
skip arguments with default values in socket generation
|
8,485 |
11.10.2019 11:02:56
| -7,200 |
26dc003a8405ce83a3fd3a78a4cbaf8ccef3f536
|
detect virtual class inheritence
|
[
{
"change_type": "MODIFY",
"old_path": "abi/02_aff3ct_read_clang_ast.py",
"new_path": "abi/02_aff3ct_read_clang_ast.py",
"diff": "@@ -608,7 +608,7 @@ def process_ast(ast_filename):\n# ignore 'enum classes' for now\nif not filter_out and (scope == 'namespace' or scope == '<toplevel>') and not line.startswith('enum class '):\n# try to match a class\n- m = re.match(r'^(.*)class ([_a-zA-Z][_a-zA-Z0-9]*)(?: : ((?:public )?(?:[_a-zA-Z][_a-zA-Z0-9]*::)*[_a-zA-Z][_a-zA-Z0-9]*(?:<[^{]+>)?))? {', line)\n+ m = re.match(r'^(.*)class ([_a-zA-Z][_a-zA-Z0-9]*)(?: : ((?:(?:virtual )?public )?(?:[_a-zA-Z][_a-zA-Z0-9]*::)*[_a-zA-Z][_a-zA-Z0-9]*(?:<[^{]+>)?))? {', line)\nif m is not None:\n# push previous class on the class stack\nclass_stack.append((class_name, class_access, class_entry))\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
detect virtual class inheritence
|
8,485 |
11.10.2019 15:45:24
| -7,200 |
0d3421fb4bc3f6226c328e6799313477aa9a6308
|
add aff3ct::tools lookup
|
[
{
"change_type": "MODIFY",
"old_path": "abi/02_aff3ct_read_clang_ast.py",
"new_path": "abi/02_aff3ct_read_clang_ast.py",
"diff": "@@ -595,7 +595,10 @@ def process_ast(ast_filename):\n# - currently supported:\n# - alt3r::module namespace\n# - aff3ct::module namespace\n- if filter_out and (name_path_str == 'alt3r::module' or name_path_str == 'aff3ct::module'):\n+ if filter_out and (name_path_str == 'alt3r::module' or name_path_str == 'aff3ct::module' or name_path_str == 'aff3ct::tools'):\n+ # wanted namespace found\n+ filter_out_threshold = len(namespace_stack) # record nesting level\n+ filter_out = False # disable filtering until nesting level is left):\n# wanted namespace found\nfilter_out_threshold = len(namespace_stack) # record nesting level\nfilter_out = False # disable filtering until nesting level is left\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
add aff3ct::tools lookup
|
8,490 |
15.10.2019 16:50:26
| -7,200 |
ce377c745f565b9509cdebc1f6418d1944937ac1
|
Add missing 'cli' include dir.
|
[
{
"change_type": "MODIFY",
"old_path": "abi/01_aff3ct_dump_clang_ast.sh",
"new_path": "abi/01_aff3ct_dump_clang_ast.sh",
"diff": "#!/bin/bash\nrootdir='..'\n-cmd=$(clang++ -### -c -I${rootdir}/src -I${rootdir}/lib/MIPP/src -I${rootdir}/lib/rang/include -I${rootdir}/lib/date/include/date -std=gnu++11 ${rootdir}/src/aff3ct.hpp 2>&1 |tail -1|sed 's/^ //;s/emit-pch/ast-print/;s/\"-o\" \"[^\"]*\"/\"-o\" \"aff3ct_ast.txt\"/');\n+cmd=$(clang++ -### -c -I${rootdir}/src -I${rootdir}/lib/MIPP/src -I${rootdir}/lib/cli/src -I${rootdir}/lib/rang/include -I${rootdir}/lib/date/include/date -std=gnu++11 ${rootdir}/src/aff3ct.hpp 2>&1 |tail -1|sed 's/^ //;s/emit-pch/ast-print/;s/\"-o\" \"[^\"]*\"/\"-o\" \"aff3ct_ast.txt\"/');\neval \"$cmd\"\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
Add missing 'cli' include dir.
|
8,485 |
15.10.2019 17:48:18
| -7,200 |
25690e85c7c78537725a2e02bafe1d82dd387fd0
|
add support for parsing tools subdir AST elements
|
[
{
"change_type": "MODIFY",
"old_path": "abi/02_aff3ct_read_clang_ast.py",
"new_path": "abi/02_aff3ct_read_clang_ast.py",
"diff": "@@ -12,6 +12,7 @@ debug_mode = False\nsetting_keep_task_method = True\n+reserved_keywords = [ 'class', 'enum', 'exception', 'for', 'if', 'public', 'protected', 'private', 'struct', 'throw', 'throws', 'union', 'virtual', 'while' ]\n# process one method argument\ndef process_arg(arg_signature, arg_rank):\narg_is_const = False\n@@ -295,6 +296,8 @@ def add_method(class_entry, method, method_is_inline, method_suffix, method_temp\nclass_short_name = class_entry['class_short_name']\nmethod_is_virtual = False\nmethod_is_pure_virtual = False\n+ method_has_throw = False\n+ method_output = None\n# apply some heuristics to detect method kind\nif method.startswith('static '):\n@@ -348,19 +351,29 @@ def add_method(class_entry, method, method_is_inline, method_suffix, method_temp\nmethod_is_inline = True\nmethod_str = re.sub(r'\\binline\\b ', '', method_str)\n+ # record and remove throw keyword\n+ m = re.search(r'\\bthrow\\b', method_str)\n+ if m is not None:\n+ method_has_throw = True\n+ method_str = re.sub(r'\\bthrow(?:\\([^)]*\\))?', '', method_str)\n+\n# extract method components (output, name, args) according to kind\nif method_kind == 'constructor':\nmethod_short_name = class_short_name\nm = re.match(r'(?:explicit )?[_a-zA-Z][_a-zA-Z0-9]*(?: *<[^<>]*>)?[^()]*\\((.*)\\)$', method_str)\nif m is not None:\nmethod_args = m.group(1).strip()\n+ else:\n+ return None\nelif method_kind == 'destructor':\nmethod_short_name = '~'+class_short_name\nm = re.match(r'~[_a-zA-Z][_a-zA-Z0-9]*(?: *<[^<>]>)?[^()]*\\((.*)\\)(?: *noexcept)?(?: *= default)? *$', method_str)\nif m is not None:\nmethod_args = m.group(1).strip()\n+ else:\n+ return None\nelif method_kind == 'operator':\n- m = re.match(r'(.*)(operator(?:(?:\\(\\))|(?:\\[\\])|(?:[^(]=?))) *\\((.*)\\)$', method_str)\n+ m = re.match(r'(.*)(operator(?:(?:\\(\\))|(?:\\[\\])|(?:->)|(?:[^(]=?))) *\\((.*)\\)$', method_str)\nmethod_short_name = None\nif m is not None:\nmethod_output = m.group(1).strip()\n@@ -373,7 +386,7 @@ def add_method(class_entry, method, method_is_inline, method_suffix, method_temp\nif method_kind == 'static':\nmethod_str = re.sub(r'\\bstatic\\b ', '', method_str)\n# method_str or static method_str\n- m = re.match(r'(.*[^_a-zA-Z])([_a-zA-Z][_a-zA-Z0-9]*)\\((.*)\\)$', method_str)\n+ m = re.match(r'(.*[^_a-zA-Z])([_a-zA-Z][_a-zA-Z0-9]*)\\(((?:.*[_a-zA-Z].*)?)\\)$', method_str)\nif m is not None:\nmethod_output = m.group(1).strip()\nmethod_short_name = m.group(2)\n@@ -382,12 +395,16 @@ def add_method(class_entry, method, method_is_inline, method_suffix, method_temp\n# skip, did not recognize a method\nreturn None\n+ if method_short_name in reserved_keywords:\n+ return None\n+\n# record all method infos in a method_entry\nmethod_entry['method_signature'] = method\nmethod_entry['method_kind'] = method_kind\nmethod_entry['method_is_virtual'] = method_is_virtual\nmethod_entry['method_is_pure_virtual'] = method_is_pure_virtual\nmethod_entry['method_is_inline'] = method_is_inline\n+ method_entry['method_has_throw'] = method_has_throw\nmethod_entry['method_short_name'] = method_short_name\nmethod_entry['method_name'] = class_entry['class_name']+'::'+method_short_name\nif method_short_name in class_entry['class_name_accounting']:\n@@ -535,7 +552,18 @@ def process_ast(ast_filename):\n# Main loop processing the pretty-printed AST\nwith fileinput.input(ast_filename) as finput:\n- for line in finput:\n+ for l in finput:\n+ # workaround on merged lines ending with '= default'\n+ last_l = False\n+ while not last_l:\n+ line_array = l.split(' = default ', 1)\n+ if len(line_array) > 1:\n+ line = line_array[0]+ ' = default '\n+ l = line_array[1]\n+ else:\n+ line = line_array[0]\n+ last_l = True\n+\n# if debugging, print the line being processed\nif debug_mode:\nsys.stdout.write('# '+line)\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
add support for parsing tools subdir AST elements
|
8,485 |
15.10.2019 17:54:59
| -7,200 |
ec6a8d9b0dfebc3baf983e18f0160882389924c5
|
add command line debug flag
|
[
{
"change_type": "MODIFY",
"old_path": "abi/02_aff3ct_read_clang_ast.py",
"new_path": "abi/02_aff3ct_read_clang_ast.py",
"diff": "@@ -1082,10 +1082,13 @@ ast_filename = 'aff3ct_ast.txt'\nargparser = argparse.ArgumentParser(description='Build json database from Clang AST, and optional additional sources.')\nargparser.add_argument('-m', '--modules', metavar='MODULE_JSON', help='specify a .json file listing module tasks and sockets')\nargparser.add_argument('-f', '--fixes', metavar='FIXES_JSON', help='specify a .json file containing manual fixes')\n+argparser.add_argument('-d', '--debug', help='enable debug mode', action='store_true')\nargparser.add_argument('ast_filename', metavar='AST', nargs=argparse.REMAINDER, help='Clang AST obtained from @PROJECT_NAME@_dump_clang_ast.sh')\n# parse command line args\nargs = argparser.parse_args()\n+if args.debug:\n+ debug_mode = True\n# the first positional arg, if any, should be an alternate Clang AST print file\nif len(args.ast_filename) > 0:\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
add command line debug flag
|
8,485 |
16.10.2019 14:25:14
| -7,200 |
901055355820846651540aee45a80d2d405dc36b
|
add some more c++ keywords, sort db_summary methods
|
[
{
"change_type": "MODIFY",
"old_path": "abi/02_aff3ct_read_clang_ast.py",
"new_path": "abi/02_aff3ct_read_clang_ast.py",
"diff": "@@ -12,7 +12,17 @@ debug_mode = False\nsetting_keep_task_method = True\n-reserved_keywords = [ 'class', 'enum', 'exception', 'for', 'if', 'public', 'protected', 'private', 'struct', 'throw', 'throws', 'union', 'virtual', 'while' ]\n+reserved_keywords_list = [ 'auto', 'bool', 'break', 'case', 'catch', 'char', 'class', 'const', 'continue',\n+ 'default', 'delete', 'double', 'else' 'enum', 'exception', 'explicit', 'export', 'extern',\n+ 'false', 'float', 'for', 'friend', 'goto', 'if', 'inline', 'int', 'long', 'namespace', 'new',\n+ 'private', 'protected', 'public', 'register', 'return', 'short', 'signed', 'sizeof', 'static', 'struct', 'switch',\n+ 'throw', 'true', 'try', 'typedef', 'typename', 'union', 'unsigned', 'using', 'virtual', 'void', 'while'\n+ ]\n+\n+reserved_keywords = dict()\n+for keyword in reserved_keywords_list:\n+ reserved_keywords[keyword] = True\n+\n# process one method argument\ndef process_arg(arg_signature, arg_rank):\narg_is_const = False\n@@ -1040,15 +1050,15 @@ def dump_db(db, output_filename, summary_output_filename):\n# remove name accounting dict to avoid dumping it in the json db\ndel class_entry['class_name_accounting']\n- for method in class_entry['class_constructors'].keys():\n+ for method in sorted(class_entry['class_constructors'].keys()):\nwrite_method(fsummary_output, class_entry['class_constructors'][method], True)\n- for method in class_entry['class_destructors'].keys():\n+ for method in sorted(class_entry['class_destructors'].keys()):\nwrite_method(fsummary_output, class_entry['class_destructors'][method], True)\n- for method in class_entry['class_methods'].keys():\n+ for method in sorted(class_entry['class_methods'].keys()):\nwrite_method(fsummary_output, class_entry['class_methods'][method], True)\n- for method in class_entry['class_static_methods'].keys():\n+ for method in sorted(class_entry['class_static_methods'].keys()):\nwrite_method(fsummary_output, class_entry['class_static_methods'][method], True)\n- for method in class_entry['class_operators'].keys():\n+ for method in sorted(class_entry['class_operators'].keys()):\nwrite_method(fsummary_output, class_entry['class_operators'][method], True)\n# list unresolved issues separately\nfirst = True\n@@ -1064,7 +1074,7 @@ def dump_db(db, output_filename, summary_output_filename):\nfsummary_output.write('=======================\\n')\nfsummary_output.write('Warning, fixme methods:\\n')\nfsummary_output.write('%s\\n' % (class_name))\n- for method in class_entry['class_fixme_methods'].keys():\n+ for method in sorted(class_entry['class_fixme_methods'].keys()):\nwrite_method(fsummary_output, class_entry['class_fixme_methods'][method], False)\n# dump db into a .json file\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
add some more c++ keywords, sort db_summary methods
|
8,485 |
16.10.2019 14:31:30
| -7,200 |
0b3f9e8b0157a4621a8fd56deb36c719a4dd546c
|
sort json keys
|
[
{
"change_type": "MODIFY",
"old_path": "abi/02_aff3ct_read_clang_ast.py",
"new_path": "abi/02_aff3ct_read_clang_ast.py",
"diff": "@@ -825,7 +825,7 @@ def process_ast(ast_filename):\ninternal_db_filename = 'internal_db.json'\nwith open(internal_db_filename, 'w') as foutput:\nprint(\"[debug mode] dumping internal_db to '%s'\" % (internal_db_filename))\n- json.dump(internal_db, foutput)\n+ json.dump(internal_db, foutput, sort_keys=True)\nreturn db\n@@ -1080,7 +1080,7 @@ def dump_db(db, output_filename, summary_output_filename):\n# dump db into a .json file\nprint(\"dumping db to '%s'\" % (output_filename))\nwith open(output_filename, 'w') as foutput:\n- json.dump(db, foutput)\n+ json.dump(db, foutput, sort_keys=True)\n#-------------\n# main program\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
sort json keys
|
8,485 |
31.10.2019 13:28:58
| -3,600 |
97b0f7b87b46be7ae0bc94aa4b27455d7ee103b4
|
extract structs as classes, add a class_kind field to distinguish between classes and structs
|
[
{
"change_type": "MODIFY",
"old_path": "abi/02_aff3ct_read_clang_ast.py",
"new_path": "abi/02_aff3ct_read_clang_ast.py",
"diff": "@@ -468,9 +468,10 @@ def add_method(class_entry, method, method_is_inline, method_suffix, method_temp\n# add a new class to the db\n# - name_path_str is the full qualified name including namespace(s)\n# - class_inheritence is the right hand side of the class declaration, stating base class(es)\n-def add_class(db, name_path_str, class_short_name, class_inheritence, class_template_part):\n+def add_class(db, name_path_str, class_short_name, class_inheritence, class_template_part, class_kind):\n# initialize a class entry\nclass_entry = dict()\n+ class_entry['class_kind'] = class_kind\nclass_entry['class_name'] = name_path_str\nclass_entry['class_short_name'] = class_short_name\nif class_inheritence:\n@@ -649,7 +650,7 @@ def process_ast(ast_filename):\n# ignore 'enum classes' for now\nif not filter_out and (scope == 'namespace' or scope == '<toplevel>') and not line.startswith('enum class '):\n# try to match a class\n- m = re.match(r'^(.*)class ([_a-zA-Z][_a-zA-Z0-9]*)(?: : ((?:(?:virtual )?public )?(?:[_a-zA-Z][_a-zA-Z0-9]*::)*[_a-zA-Z][_a-zA-Z0-9]*(?:<[^{]+>)?))? {', line)\n+ m = re.match(r'^(.*)(class|struct) ([_a-zA-Z][_a-zA-Z0-9]*)(?: : ((?:(?:virtual )?public )?(?:[_a-zA-Z][_a-zA-Z0-9]*::)*[_a-zA-Z][_a-zA-Z0-9]*(?:<[^{]+>)?))? {', line)\nif m is not None:\n# push previous class on the class stack\nclass_stack.append((class_name, class_access, class_entry))\n@@ -657,8 +658,9 @@ def process_ast(ast_filename):\n# entering class\nclass_template_part = m.group(1).strip()\n- class_short_name = m.group(2)\n- class_inheritence = m.group(3)\n+ class_kind = m.group(2)\n+ class_short_name = m.group(3)\n+ class_inheritence = m.group(4)\nclass_access = default_class_access\nname_path.append(class_short_name)\nname_path_str = '::'.join(name_path)\n@@ -666,7 +668,7 @@ def process_ast(ast_filename):\n# if class not already known, add it to 'db'\nif name_path_str not in db:\n- add_class(db, name_path_str, class_short_name, class_inheritence, class_template_part)\n+ add_class(db, name_path_str, class_short_name, class_inheritence, class_template_part, class_kind)\nclass_entry = db[name_path_str]\nscope = 'class'\n@@ -1043,9 +1045,9 @@ def dump_db(db, output_filename, summary_output_filename):\nif class_entry['class_is_abstract']:\nclass_name = '['+class_name+']'\nif 'inheritence' in class_entry:\n- fsummary_output.write('class %s - inheritence: %s\\n' % (class_name, class_entry['class_inheritence']))\n+ fsummary_output.write('%s %s - inheritence: %s\\n' % (class_entry['class_kind'], class_name, class_entry['class_inheritence']))\nelse:\n- fsummary_output.write('class %s\\n' % (class_name))\n+ fsummary_output.write('%s %s\\n' % (class_entry['class_kind'], class_name))\n# remove name accounting dict to avoid dumping it in the json db\ndel class_entry['class_name_accounting']\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
extract structs as classes, add a class_kind field to distinguish between classes and structs
|
8,492 |
15.11.2019 15:49:53
| -3,600 |
3ec3e9e87ab3da26e9de994542904b8311fb6a92
|
fix processing of tasks with duplicate names
|
[
{
"change_type": "MODIFY",
"old_path": "abi/02_aff3ct_read_clang_ast.py",
"new_path": "abi/02_aff3ct_read_clang_ast.py",
"diff": "@@ -858,6 +858,8 @@ def find_task_method(class_entry, module_task_entry):\n# lookup all methods\nfor method, method_entry in class_entry['class_all_methods_index'].items():\n# early filter out unlikely candidates\n+ if method_entry['method_kind'] == 'task':\n+ continue\nif 'method_output' in method_entry and method_entry['method_output'] is not None:\ncontinue\nif method_entry['method_short_name'] != module_task_name:\n@@ -888,9 +890,12 @@ def find_task_method(class_entry, module_task_entry):\n# change a class method into a module task\ndef make_task(class_entry, method_entry, module_task_entry):\nmethod = method_entry['method_signature']\n+ # check if the class method has not already been changed into a module task\n+ if method_entry['method_kind'] == 'task':\n+ return\n# sanity check\nif method_entry['method_kind'] != 'method':\n- sys.stderr.write(\"invalid task kind\" + \"\\n\")\n+ sys.stderr.write(\"invalid task kind (method_kind = \"+method_entry['method_kind']+\")\" + \"\\n\")\nsys.exit(1)\n# change method kind into 'task'\n@@ -899,6 +904,8 @@ def make_task(class_entry, method_entry, module_task_entry):\nfor socket in method_entry['method_arguments']:\nif '=' in socket['arg_signature']:\ncontinue\n+ socket_rank = socket['arg_rank']\n+ if socket_rank < len(module_task_entry['sockets']):\n# copy() is mandatory here, as keys() aliases the dict keys list which will be modified\nold_keys = socket.copy().keys()\nfor old_key in old_keys:\n@@ -907,7 +914,6 @@ def make_task(class_entry, method_entry, module_task_entry):\nsocket[new_key] = socket[old_key]\nelse:\nsocket[new_key] = socket.pop(old_key)\n- socket_rank = socket['soc_rank']\nsocket_nb = socket_nb+1\nmodule_task_socket = module_task_entry['sockets'][socket_rank]\nif socket['soc_shape'] != '<fixme>':\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
fix processing of tasks with duplicate names
|
8,492 |
29.11.2019 14:30:35
| -3,600 |
79f5e947ffbc23ef9db3792fd84023df7fc18845
|
check all homonym methods when looking for tasks
|
[
{
"change_type": "MODIFY",
"old_path": "abi/02_aff3ct_read_clang_ast.py",
"new_path": "abi/02_aff3ct_read_clang_ast.py",
"diff": "@@ -855,6 +855,7 @@ def find_task_method(class_entry, module_task_entry):\nmodule_task_name = module_task_entry['task_name']\nmodule_task_sockets = module_task_entry['sockets']\nmodule_task_nb_sockets = len(module_task_sockets)\n+ task_methods = []\n# lookup all methods\nfor method, method_entry in class_entry['class_all_methods_index'].items():\n# early filter out unlikely candidates\n@@ -884,8 +885,8 @@ def find_task_method(class_entry, module_task_entry):\nif j >= module_task_nb_sockets:\nbreak\nif method_is_task:\n- return method_entry\n- return None\n+ task_methods.append(method_entry)\n+ return task_methods\n# change a class method into a module task\ndef make_task(class_entry, method_entry, module_task_entry):\n@@ -898,6 +899,16 @@ def make_task(class_entry, method_entry, module_task_entry):\nsys.stderr.write(\"invalid task kind (method_kind = \"+method_entry['method_kind']+\")\" + \"\\n\")\nsys.exit(1)\n+ # check if number of sockets is ok\n+ test_socket_nb = 0\n+ for socket in method_entry['method_arguments']:\n+ if '=' in socket['arg_signature']:\n+ continue\n+ test_socket_nb = test_socket_nb + 1\n+\n+ if test_socket_nb != len(module_task_entry['sockets']):\n+ return\n+\n# change method kind into 'task'\nmethod_entry['method_kind'] = 'task'\nsocket_nb = 0\n@@ -931,7 +942,7 @@ def make_task(class_entry, method_entry, module_task_entry):\nsocket_dir = 'output'\nif socket['soc_dir'] != '<fixme>' and socket['soc_dir'] != socket_dir:\n- sys.stderr.write(\"invalid socket direction: \" + socket['soc_dir'] + \"\\n\")\n+ sys.stderr.write(\"method \"+method+\"\\ninvalid socket \"+str(socket_rank)+\" direction: \" + socket['soc_dir'] + \" vs \" + socket_dir + \"\\n\")\nsys.exit(1)\nsocket['soc_dir'] = socket_dir\nsocket['soc_fixme'] = False\n@@ -966,10 +977,11 @@ def process_modules(json_modules_filename):\nclass_entry['class_tasks'] = dict()\nfor module_task_name, module_task_entry in module_entry['tasks'].items():\n# for each module task, find a corresponding method in the class\n- task_method_entry = find_task_method(class_entry, module_task_entry)\n- if task_method_entry is None:\n+ task_method_entries = find_task_method(class_entry, module_task_entry)\n+ if len(task_method_entries) == 0:\nsys.stderr.write('warning: no matching method found for task %s in module %s\\n' % (module_task_name, class_name))\ncontinue\n+ for task_method_entry in task_method_entries:\n# transform the method into a task\nmake_task(class_entry, task_method_entry, module_task_entry)\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
check all homonym methods when looking for tasks
|
8,492 |
10.12.2019 13:47:24
| -3,600 |
3ea5a4c0a3bbe568a3c4ef58a6d1f18de5baaf8e
|
allow tasks with non-void return types, add debug messages about task detection process
|
[
{
"change_type": "MODIFY",
"old_path": "abi/02_aff3ct_read_clang_ast.py",
"new_path": "abi/02_aff3ct_read_clang_ast.py",
"diff": "@@ -902,12 +902,20 @@ def find_task_method(class_entry, module_task_entry):\ntask_methods = []\n# lookup all methods\nfor method, method_entry in class_entry['class_all_methods_index'].items():\n+ if debug_mode:\n+ print(\"task?: \"+method)\n# early filter out unlikely candidates\nif method_entry['method_kind'] == 'task':\n+ if debug_mode:\n+ print(\"already a task\")\ncontinue\n- if 'method_output' in method_entry and method_entry['method_output'] is not None:\n- continue\n+ # tasks appear to be allowed to have a non-void return type\n+ #if 'method_output' in method_entry and method_entry['method_output'] is not None:\n+ # print(\"expect an output\")\n+ # continue\nif method_entry['method_short_name'] != module_task_name:\n+ if debug_mode:\n+ print(\"name mismatch\")\ncontinue\nmethod_args = method_entry['method_arguments']\nmethod_is_task = True\n@@ -916,17 +924,25 @@ def find_task_method(class_entry, module_task_entry):\nfor i in range(method_entry['method_nb_arguments']):\nmethod_arg = method_args[i]\nif '=' in method_arg:\n+ if debug_mode:\n+ print(\". arg with default value\")\ncontinue\nmethod_task_socket = module_task_sockets[j]\nmethod_arg_type = method_arg['arg_type']\nif method_arg_type.endswith(']') and method_task_socket['soc_type']+' []' != method_arg_type:\n+ if debug_mode:\n+ print(\"unexpected array arg\")\nmethod_is_task = False\nbreak\nelif method_arg_type.endswith(('*','&')) and method_task_socket['soc_type'] != method_arg_type:\n+ if debug_mode:\n+ print(\"unexpected ptr/ref arg\")\nmethod_is_task = False\nbreak\nj = j+1\nif j >= module_task_nb_sockets:\n+ if debug_mode:\n+ print(\"socket number mismatch\")\nbreak\nif method_is_task:\ntask_methods.append(method_entry)\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
allow tasks with non-void return types, add debug messages about task detection process
|
8,492 |
11.12.2019 14:52:14
| -3,600 |
8ac155c52fec814be8e01d65d6abf84a8d1e221c
|
add realtype attribute for args and output when enum type
|
[
{
"change_type": "MODIFY",
"old_path": "abi/02_aff3ct_read_clang_ast.py",
"new_path": "abi/02_aff3ct_read_clang_ast.py",
"diff": "@@ -866,6 +866,28 @@ def process_ast(ast_filename):\n# only consider class members, and only public ones\nif debug_mode:\nprint(line)\n+\n+ enum_classes = dict()\n+ for class_name in sorted(db.keys()):\n+ class_entry = db[class_name]\n+ if class_entry['class_kind'] == 'enum_class':\n+ enum_classes[class_name] = class_entry\n+ for class_name in sorted(db.keys()):\n+ class_entry = db[class_name]\n+ if class_entry['class_kind'] == 'enum_class':\n+ continue\n+ for method, method_entry in class_entry['class_all_methods_index'].items():\n+ method_args = method_entry['method_arguments']\n+ for i in range(method_entry['method_nb_arguments']):\n+ method_arg = method_args[i]\n+ if method_arg['arg_type'] in enum_classes:\n+ method_arg['arg_realtype'] = enum_classes[method_arg['arg_type']]['class_enum_type']\n+ if 'method_output' in method_entry:\n+ method_output = method_entry['method_output']\n+ if method_output is not None and method_output['out_type'] in enum_classes:\n+ method_output['out_realtype'] = enum_classes[method_output['out_type']]['class_enum_type']\n+\n+\nif debug_mode:\n# if debug_mode, dump internal_db\ninternal_db_filename = 'internal_db.json'\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
add realtype attribute for args and output when enum type
|
8,485 |
11.12.2019 15:56:34
| -3,600 |
25c1aa79cd7e2575afb4e7e035aa40681bc51397
|
enhance debug output
|
[
{
"change_type": "MODIFY",
"old_path": "abi/02_aff3ct_read_clang_ast.py",
"new_path": "abi/02_aff3ct_read_clang_ast.py",
"diff": "@@ -925,11 +925,11 @@ def find_task_method(class_entry, module_task_entry):\n# lookup all methods\nfor method, method_entry in class_entry['class_all_methods_index'].items():\nif debug_mode:\n- print(\"task?: \"+method)\n+ print(\"checking if method '\"+method+\"' can be elected as a task\")\n# early filter out unlikely candidates\nif method_entry['method_kind'] == 'task':\nif debug_mode:\n- print(\"already a task\")\n+ print(\"- no: already a task\")\ncontinue\n# tasks appear to be allowed to have a non-void return type\n#if 'method_output' in method_entry and method_entry['method_output'] is not None:\n@@ -937,7 +937,7 @@ def find_task_method(class_entry, module_task_entry):\n# continue\nif method_entry['method_short_name'] != module_task_name:\nif debug_mode:\n- print(\"name mismatch\")\n+ print(\"- no: name mismatch\")\ncontinue\nmethod_args = method_entry['method_arguments']\nmethod_is_task = True\n@@ -945,26 +945,28 @@ def find_task_method(class_entry, module_task_entry):\nj = 0\nfor i in range(method_entry['method_nb_arguments']):\nmethod_arg = method_args[i]\n+ if debug_mode:\n+ print(\". checking arg %2d: '%s'\" % (i, method_arg['arg_name']))\nif '=' in method_arg:\nif debug_mode:\n- print(\". arg with default value\")\n+ print(\" . skip arg with default value\")\ncontinue\nmethod_task_socket = module_task_sockets[j]\nmethod_arg_type = method_arg['arg_type']\nif method_arg_type.endswith(']') and method_task_socket['soc_type']+' []' != method_arg_type:\nif debug_mode:\n- print(\"unexpected array arg\")\n+ print(\" - no: unexpected array arg\")\nmethod_is_task = False\nbreak\nelif method_arg_type.endswith(('*','&')) and method_task_socket['soc_type'] != method_arg_type:\nif debug_mode:\n- print(\"unexpected ptr/ref arg\")\n+ print(\" - no: unexpected ptr/ref arg\")\nmethod_is_task = False\nbreak\nj = j+1\nif j >= module_task_nb_sockets:\nif debug_mode:\n- print(\"socket number mismatch\")\n+ print(\" - no: socket number mismatch\")\nbreak\nif method_is_task:\ntask_methods.append(method_entry)\n@@ -992,6 +994,8 @@ def make_task(class_entry, method_entry, module_task_entry):\nreturn\n# change method kind into 'task'\n+ if debug_mode:\n+ print(\"electing '\"+method+\"' as task\")\nmethod_entry['method_kind'] = 'task'\nsocket_nb = 0\nfor socket in method_entry['method_arguments']:\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
enhance debug output
|
8,485 |
18.12.2019 16:00:00
| -3,600 |
9bbdb30fef45a6a56401f657dd216349e04301c1
|
support lists of inherited classes
|
[
{
"change_type": "MODIFY",
"old_path": "abi/02_aff3ct_read_clang_ast.py",
"new_path": "abi/02_aff3ct_read_clang_ast.py",
"diff": "@@ -475,7 +475,7 @@ def add_class(db, name_path_str, class_short_name, class_inheritence, class_temp\nclass_entry['class_name'] = name_path_str\nclass_entry['class_short_name'] = class_short_name\nif class_inheritence:\n- class_entry['class_inheritence'] = class_inheritence\n+ class_entry['class_inheritence'] = re.split(r',\\s*', class_inheritence)\nclass_entry['class_constructors'] = dict()\nclass_entry['class_destructors'] = dict()\nclass_entry['class_static_methods'] = dict()\n@@ -682,7 +682,7 @@ def process_ast(ast_filename):\ncontinue\nelse:\n# try to match a class\n- m = re.match(r'^(.*)(class|struct) ([_a-zA-Z][_a-zA-Z0-9]*)(?: : ((?:(?:virtual )?public )?(?:[_a-zA-Z][_a-zA-Z0-9]*::)*[_a-zA-Z][_a-zA-Z0-9]*(?:<[^{]+>)?))? {', line)\n+ m = re.match(r'^(.*)(class|struct) ([_a-zA-Z][_a-zA-Z0-9]*)(?: : ((?:(?:virtual )?public )?(?:[_a-zA-Z][_a-zA-Z0-9]*::)*[_a-zA-Z][_a-zA-Z0-9]*(?:<[^{]+>)?(?:, (?:(?:virtual )?public )?(?:[_a-zA-Z][_a-zA-Z0-9]*::)*[_a-zA-Z][_a-zA-Z0-9]*(?:<[^{]+>)?)*))? {', line)\nif m is not None:\n# push previous class on the class stack\nclass_stack.append((class_name, class_access, class_entry))\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
support lists of inherited classes
|
8,485 |
09.01.2020 11:07:59
| -3,600 |
f3278427956189ad9bb0238f5e55fe6d92c1a31a
|
fix splitting the inheritence string when some parent classes are multi-parameter templates
|
[
{
"change_type": "MODIFY",
"old_path": "abi/02_aff3ct_read_clang_ast.py",
"new_path": "abi/02_aff3ct_read_clang_ast.py",
"diff": "@@ -475,7 +475,7 @@ def add_class(db, name_path_str, class_short_name, class_inheritence, class_temp\nclass_entry['class_name'] = name_path_str\nclass_entry['class_short_name'] = class_short_name\nif class_inheritence:\n- class_entry['class_inheritence'] = re.split(r',\\s*', class_inheritence)\n+ class_entry['class_inheritence'] = split_args(class_inheritence)\nclass_entry['class_constructors'] = dict()\nclass_entry['class_destructors'] = dict()\nclass_entry['class_static_methods'] = dict()\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
fix splitting the inheritence string when some parent classes are multi-parameter templates
|
8,492 |
29.11.2019 14:35:32
| -3,600 |
48800684590e1ddce7d5b7199757a4f849603b0c
|
update aff3ct.hpp path
|
[
{
"change_type": "MODIFY",
"old_path": "abi/01_aff3ct_dump_clang_ast.sh",
"new_path": "abi/01_aff3ct_dump_clang_ast.sh",
"diff": "#!/bin/bash\nrootdir='..'\n-cmd=$(clang++ -### -c -I${rootdir}/src -I${rootdir}/lib/MIPP/src -I${rootdir}/lib/cli/src -I${rootdir}/lib/rang/include -I${rootdir}/lib/date/include/date -std=gnu++11 ${rootdir}/src/aff3ct.hpp 2>&1 |tail -1|sed 's/^ //;s/emit-pch/ast-print/;s/\"-o\" \"[^\"]*\"/\"-o\" \"aff3ct_ast.txt\"/');\n+cmd=$(clang++ -### -c -I${rootdir}/include -I${rootdir}/src -I${rootdir}/lib/MIPP/src -I${rootdir}/lib/cli/src -I${rootdir}/lib/rang/include -I${rootdir}/lib/date/include/date -std=gnu++11 ${rootdir}/include/aff3ct.hpp 2>&1 |tail -1|sed 's/^ //;s/emit-pch/ast-print/;s/\"-o\" \"[^\"]*\"/\"-o\" \"aff3ct_ast.txt\"/');\neval \"$cmd\"\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
update aff3ct.hpp path
|
8,486 |
20.11.2020 15:37:37
| -3,600 |
deff352b77c843dd73bec4e4dba55696b385546c
|
Include protected members in the JSON file.
|
[
{
"change_type": "MODIFY",
"old_path": "abi/02_aff3ct_read_clang_ast.py",
"new_path": "abi/02_aff3ct_read_clang_ast.py",
"diff": "@@ -301,7 +301,7 @@ def split_templates(declaration_str):\n# detect a class method and record corresponding entry\n# - method_is_inline indicate whether the method is defined in the class (True) or just declared (False)\n# - method_suffix store trailing method declaration items (such as \"= 0\" for pure virtual methods)\n-def add_method(class_entry, method, method_is_inline, method_suffix, method_templates):\n+def add_method(class_entry, method, method_is_inline, method_suffix, method_templates, method_access):\nmethod_entry = dict()\nclass_short_name = class_entry['class_short_name']\nmethod_is_virtual = False\n@@ -409,6 +409,7 @@ def add_method(class_entry, method, method_is_inline, method_suffix, method_temp\nreturn None\n# record all method infos in a method_entry\n+ method_entry['method_access'] = method_access\nmethod_entry['method_signature'] = method\nmethod_entry['method_kind'] = method_kind\nmethod_entry['method_is_virtual'] = method_is_virtual\n@@ -733,8 +734,8 @@ def process_ast(ast_filename):\nscope_entry = None\nif not filter_out:\n# only record public class members\n- if previous_scope == 'class' and class_access == 'public':\n- method_entry = add_method(class_entry, method, True, '', method_templates)\n+ if previous_scope == 'class' and (class_access == 'public' or class_access == 'protected'):\n+ method_entry = add_method(class_entry, method, True, '', method_templates, class_access)\nif method_entry is not None:\nmethod_unique_name = method_entry['method_unique_name']\nmethod_unique_short_name = method_entry['method_unique_short_name']\n@@ -833,7 +834,7 @@ def process_ast(ast_filename):\ncontinue\n# detect method declarations in classes\n- if scope == 'class' and class_access == 'public':\n+ if scope == 'class' and (class_access == 'public' or class_access == 'protected'):\nmethod = None\n(method_line_perhaps, method_templates) = split_templates(line.strip())\n@@ -851,7 +852,7 @@ def process_ast(ast_filename):\nmethod_suffix = m.group(2)\nif method is not None:\n# some method found, add it to db\n- method_entry = add_method(class_entry, method, False, method_suffix, method_templates)\n+ method_entry = add_method(class_entry, method, False, method_suffix, method_templates, class_access)\nif method_entry is not None:\nmethod_unique_name = method_entry['method_unique_name']\nmethod_unique_short_name = method_entry['method_unique_short_name']\n@@ -862,7 +863,7 @@ def process_ast(ast_filename):\ncontinue\nif not filter_out:\n- if scope == 'class' and class_access == 'public':\n+ if scope == 'class' and (class_access == 'public' or class_access == 'protected'):\n# only consider class members, and only public ones\nif debug_mode:\nprint(line)\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
Include protected members in the JSON file.
|
8,490 |
21.01.2021 11:02:31
| -3,600 |
7669e3d6400b958c8c31a8204a992aef1b7e4e9e
|
Add a readme for the ABI scripts.
|
[
{
"change_type": "MODIFY",
"old_path": ".gitignore",
"new_path": ".gitignore",
"diff": "@@ -26,5 +26,8 @@ code_coverage_report/\ndoc/build/\ndoc/source/api/\ndoc/output/\n+scripts/abi/aff3ct_ast.txt\n+scripts/abi/db.json\n+scripts/abi/db_summary.txt\n__pycache__/\n"
},
{
"change_type": "MODIFY",
"old_path": "scripts/abi/01_aff3ct_dump_clang_ast.sh",
"new_path": "scripts/abi/01_aff3ct_dump_clang_ast.sh",
"diff": "#!/bin/bash\n-rootdir='..'\n+rootdir='../..'\ncmd=$(clang++ -### -c -I${rootdir}/include -I${rootdir}/src -I${rootdir}/lib/MIPP/src -I${rootdir}/lib/cli/src -I${rootdir}/lib/rang/include -I${rootdir}/lib/date/include/date -std=gnu++11 ${rootdir}/include/aff3ct.hpp 2>&1 |tail -1|sed 's/^ //;s/emit-pch/ast-print/;s/\"-o\" \"[^\"]*\"/\"-o\" \"aff3ct_ast.txt\"/');\neval \"$cmd\"\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "scripts/abi/README.md",
"diff": "+# Application Binary Interface (ABI)\n+\n+This directory contains some scripts to generate a JSON interface that describes\n+the AFF3CT C++ headers. This JSON interface can facilitate the creation of\n+AFF3CT wrappers for high level languages (Python, MATLAB, Julia, ...) that need\n+the AFF3CT headers information to be generated.\n+\n+## Dump the Abstract Syntax Tree (AST)\n+\n+The first operation consists in dumping the AFF3CT AST. To do this, we rely on\n+the [Clang](https://clang.llvm.org/) compiler.\n+\n+Install Clang on Ubuntu 20.04 LTS:\n+\n+```bash\n+sudo apt install clang\n+```\n+\n+Then you can generate the AST:\n+\n+```bash\n+./01_aff3ct_dump_clang_ast.sh\n+```\n+\n+This last command should generate an `aff3ct_ast.txt` file in the current\n+directory.\n+\n+## Convert the AST in JSON\n+\n+In order to facilitate the manipulation of the AFF3CT AST, we propose to\n+generate a more structured file from the previously generated `aff3ct_ast.txt`\n+file. We choose to use the JSON format as it is highly democratized.\n+\n+The conversion script is written in [Python](https://www.python.org/) version 3,\n+so on Ubuntu 20.04 LTS you should install it as follow :\n+\n+```bash\n+sudo apt install python3\n+```\n+\n+Finally you can convert the `aff3ct_ast.txt` raw AST file into the JSON format:\n+\n+```bash\n+./02_aff3ct_read_clang_ast.py\n+```\n+\n+This last command should generate a `db.json` file in the current directory.\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
Add a readme for the ABI scripts.
|
8,490 |
21.01.2021 13:05:10
| -3,600 |
1a2fd0a0e52831faab6429ac41586e712fb51fb7
|
CI: disable Windows 32-bit build for SSE4.2.
|
[
{
"change_type": "MODIFY",
"old_path": ".gitlab-ci.yml",
"new_path": ".gitlab-ci.yml",
"diff": "@@ -363,13 +363,13 @@ build-windows-gcc-x86-sse4.2:\n- gcc\n- cmake\n- x86\n- - 32-bit\n+ - 64-bit\nartifacts:\nname: build-windows-gcc-x86-sse4.2\npaths:\n- build_windows_gcc_x86_sse4.2\nscript:\n- - set \"CFLAGS=-Wall -funroll-loops -m32 -msse4.2\"\n+ - set \"CFLAGS=-Wall -funroll-loops -m64 -msse4.2\"\n- set \"LFLAGS=-static -static-libgcc -static-libstdc++\"\n- set \"CMAKE_OPT=-DAFF3CT_COMPILE_EXE=ON -DAFF3CT_COMPILE_STATIC_LIB=ON -DAFF3CT_COMPILE_SHARED_LIB=ON -DAFF3CT_PREC=MULTI -DAFF3CT_EXT_STRINGS=OFF\"\n- set \"NAME=build_windows_gcc_x86_sse4.2\"\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
CI: disable Windows 32-bit build for SSE4.2.
|
8,490 |
21.01.2021 14:36:27
| -3,600 |
7113bf890ec6711529ec14a13df11bc05fbc455d
|
Doc: fix the refs to the `-F` parameter.
|
[
{
"change_type": "MODIFY",
"old_path": "doc/source/user/simulation/parameters/codec/bch/encoder.rst",
"new_path": "doc/source/user/simulation/parameters/codec/bch/encoder.rst",
"diff": "@@ -83,7 +83,7 @@ Description of the allowed values:\n.. |dec-simd_descr_inter| replace:: Select the inter-frame strategy.\n-.. note:: Be aware that running the simulator with the :ref:`src-src-fra`\n+.. note:: Be aware that running the simulator with the :ref:`sim-sim-inter-fra`\nparameter set to 1 and the :ref:`dec-polar-dec-simd` parameter set to\n``INTER`` will completely be counterproductive and will lead to no throughput\nimprovements.\n\\ No newline at end of file\n"
},
{
"change_type": "MODIFY",
"old_path": "doc/source/user/simulation/parameters/codec/ldpc/decoder.rst",
"new_path": "doc/source/user/simulation/parameters/codec/ldpc/decoder.rst",
"diff": "@@ -247,10 +247,10 @@ Description of the allowed values:\n.. note:: When the inter-frame |SIMD| strategy is set, the simulator will run\nwith the right number of frames depending on the |SIMD| length. This number\n- of frames can be manually set with the :ref:`src-src-fra` parameter. Be aware\n- that running the simulator with the :ref:`src-src-fra` parameter set to 1 and\n- the :ref:`dec-polar-dec-simd` parameter set to ``INTER`` will completely be\n- counterproductive and will lead to no throughput improvements.\n+ of frames can be manually set with the :ref:`sim-sim-inter-fra` parameter. Be\n+ aware that running the simulator with the :ref:`sim-sim-inter-fra` parameter\n+ set to 1 and the :ref:`dec-polar-dec-simd` parameter set to ``INTER`` will\n+ completely be counterproductive and will lead to no throughput improvements.\n.. _dec-ldpc-dec-h-reorder:\n"
},
{
"change_type": "MODIFY",
"old_path": "doc/source/user/simulation/parameters/codec/polar/decoder.rst",
"new_path": "doc/source/user/simulation/parameters/codec/polar/decoder.rst",
"diff": "@@ -120,10 +120,10 @@ Description of the allowed values:\n.. note:: When the inter-frame |SIMD| strategy is set, the simulator will run\nwith the right number of frames depending on the |SIMD| length. This number\n- of frames can be manually set with the :ref:`src-src-fra` parameter. Be aware\n- that running the simulator with the :ref:`src-src-fra` parameter set to 1 and\n- the :ref:`dec-polar-dec-simd` parameter set to ``INTER`` will completely be\n- counterproductive and will lead to no throughput improvements.\n+ of frames can be manually set with the :ref:`sim-sim-inter-fra` parameter. Be\n+ aware that running the simulator with the :ref:`sim-sim-inter-fra` parameter\n+ set to 1 and the :ref:`dec-polar-dec-simd` parameter set to ``INTER`` will\n+ completely be counterproductive and will lead to no throughput improvements.\n.. _dec-polar-dec-ite:\n"
},
{
"change_type": "MODIFY",
"old_path": "doc/source/user/simulation/parameters/codec/rsc/decoder.rst",
"new_path": "doc/source/user/simulation/parameters/codec/rsc/decoder.rst",
"diff": "@@ -92,10 +92,10 @@ Description of the allowed values:\n.. note:: When the inter-frame |SIMD| strategy is set, the simulator will run\nwith the right number of frames depending on the |SIMD| length. This number\n- of frames can be manually set with the :ref:`src-src-fra` parameter. Be aware\n- that running the simulator with the :ref:`src-src-fra` parameter set to 1 and\n- the :ref:`dec-polar-dec-simd` parameter set to ``INTER`` will completely be\n- counterproductive and will lead to no throughput improvements.\n+ of frames can be manually set with the :ref:`sim-sim-inter-fra` parameter. Be\n+ aware that running the simulator with the :ref:`sim-sim-inter-fra` parameter\n+ set to 1 and the :ref:`dec-polar-dec-simd` parameter set to ``INTER`` will\n+ completely be counterproductive and will lead to no throughput improvements.\n.. _dec-rsc-dec-max:\n"
},
{
"change_type": "MODIFY",
"old_path": "doc/source/user/simulation/parameters/simulation/simulation.rst",
"new_path": "doc/source/user/simulation/parameters/simulation/simulation.rst",
"diff": "@@ -446,9 +446,9 @@ when a bit is 1, then the corresponding output bit is flipped.\n|factory::Simulation::p+dbg-fra|\n-This behavior can be overridden with the :ref:`src-src-fra` parameter and a task\n-can be executed on many frames. In that case, you may want to reduce the number\n-of displayed frames on screen:\n+This behavior can be overridden with the :ref:`sim-sim-inter-fra` parameter and\n+a task can be executed on many frames. In that case, you may want to reduce the\n+number of displayed frames on screen:\n.. code-block:: bash\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
Doc: fix the refs to the `-F` parameter.
|
8,486 |
17.11.2020 10:25:07
| -3,600 |
27188fc61c30f09df569515b93d1fd3a3ae882a3
|
Add new Module () and [] operators.
|
[
{
"change_type": "MODIFY",
"old_path": "include/Module/Module.hpp",
"new_path": "include/Module/Module.hpp",
"diff": "@@ -82,9 +82,10 @@ public:\nvoid remove_custom_name();\ninline Task& operator[](const size_t id );\n+ inline Socket& operator[](const std::string &tsk_sck );\n+ inline Task& operator()(const std::string &tsk_name);\nvoid set_fast(const bool fast);\n-\nprotected:\nvirtual void deep_copy(const Module &m);\n"
},
{
"change_type": "MODIFY",
"old_path": "include/Module/Module.hxx",
"new_path": "include/Module/Module.hxx",
"diff": "#include <cassert>\n+#include <sstream>\n+#include <algorithm>\n+#include <exception>\n#include \"Module/Module.hpp\"\n@@ -15,6 +18,51 @@ Task& Module\nreturn *this->tasks_with_nullptr[id];\n}\n+Socket& Module\n+::operator[](const std::string &tsk_sck)\n+{\n+ size_t pos = tsk_sck.find(\"::\", 0);\n+ if ((int)pos < 0)\n+ {\n+ std::stringstream message;\n+ message << \"Invalid socket name, it should be of the form task::socket.\";\n+ throw tools::invalid_argument(__FILE__, __LINE__, __func__, message.str());\n+ }\n+ std::string tsk_name = tsk_sck.substr(0, pos);\n+ tsk_name.erase(remove(tsk_name.begin(), tsk_name.end(), ' '), tsk_name.end());\n+ std::string sck_name = tsk_sck.substr(pos+2, tsk_sck.size());\n+ sck_name.erase(remove(sck_name.begin(), sck_name.end(), ' '), sck_name.end());\n+ auto &cur_tsk = this->operator()(tsk_name);\n+\n+ auto it = find_if(cur_tsk.sockets.begin(), cur_tsk.sockets.end(),\n+ [sck_name](std::shared_ptr<Socket> s){return s->get_name()==sck_name;});\n+\n+ if (it == cur_tsk.sockets.end())\n+ {\n+ std::stringstream message;\n+ message << \"Socket '\" << sck_name << \"' not found for task '\" << tsk_name << \"'.\";\n+ throw tools::invalid_argument(__FILE__, __LINE__, __func__, message.str());\n+ }\n+\n+ return *it->get();\n+}\n+\n+Task& Module\n+::operator()(const std::string &tsk_name)\n+{\n+ auto it = find_if(this->tasks.begin(), this->tasks.end(),\n+ [tsk_name](std::shared_ptr<Task> t){return t->get_name()==tsk_name;});\n+\n+ if (it == this->tasks.end())\n+ {\n+ std::stringstream message;\n+ message << \"Task '\" << tsk_name << \"' not found.\";\n+ throw tools::invalid_argument(__FILE__, __LINE__, __func__, message.str());\n+ }\n+\n+ return *it->get();\n+}\n+\ntemplate <typename T>\ninline size_t Module\n::create_socket_in(Task& task, const std::string &name, const size_t n_elmts)\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
Add new Module () and [] operators.
|
8,490 |
24.01.2021 10:39:24
| -3,600 |
14cf9060d59f176e6b1f21d8dfd6eafb43dab3c9
|
Update the current year: 2020 -> 2021.
|
[
{
"change_type": "MODIFY",
"old_path": "LICENSE",
"new_path": "LICENSE",
"diff": "MIT License\n-Copyright (c) 2017-2019 aff3ct\n+Copyright (c) 2017-2021 aff3ct\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\n"
},
{
"change_type": "MODIFY",
"old_path": "doc/source/conf.py",
"new_path": "doc/source/conf.py",
"diff": "@@ -36,7 +36,7 @@ if (read_the_docs_build):\n# -- Project information -----------------------------------------------------\nproject = 'AFF3CT'\n-copyright = '2020, AFF3CT team'\n+copyright = '2021, AFF3CT team'\nauthor = 'AFF3CT team'\n# get the AFF3CT version from Git\n"
},
{
"change_type": "MODIFY",
"old_path": "src/main.cpp",
"new_path": "src/main.cpp",
"diff": "@@ -138,7 +138,7 @@ void print_version()\nstd::cout << \" - MPI: \" << mpi << std::endl;\nstd::cout << \" - GSL: \" << gsl << std::endl;\nstd::cout << \" - MKL: \" << mkl << std::endl;\n- std::cout << \"Copyright (c) 2016-2020 - MIT license.\" << std::endl;\n+ std::cout << \"Copyright (c) 2016-2021 - MIT license.\" << std::endl;\nstd::cout << \"This is free software; see the source for copying conditions. There is NO\" << std::endl;\nstd::cout << \"warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\" << std::endl;\nexit(EXIT_SUCCESS);\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
Update the current year: 2020 -> 2021.
|
8,490 |
24.01.2021 11:39:19
| -3,600 |
b3470f07e8e57aeeb47e42a10ae39addeaa131ab
|
Fix Galois field related segfault.
|
[
{
"change_type": "MODIFY",
"old_path": "src/Tools/Math/Galois.cpp",
"new_path": "src/Tools/Math/Galois.cpp",
"diff": "@@ -40,6 +40,14 @@ Galois<I>\nthrow invalid_argument(__FILE__, __LINE__, __func__, message.str());\n}\n+ if ((size_t)m > sizeof(I) * 8)\n+ {\n+ std::stringstream message;\n+ message << \"'m' can't be higher than 'sizeof(I) * 8' ('m' = \" << m << \", 'sizeof(I) * 8' = \"\n+ << (sizeof(I) * 8) << \").\";\n+ throw invalid_argument(__FILE__, __LINE__, __func__, message.str());\n+ }\n+\nif (N != ((1 << m) -1))\n{\nstd::stringstream message;\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
Fix Galois field related segfault.
|
8,486 |
30.01.2021 23:38:39
| -3,600 |
d2b1cec23def9d09aa2aa4d5e4c4e07fc07488f2
|
Add assert_frozen_bits to Interface_get_set_frozen_bits for checking frozen bits validity.
|
[
{
"change_type": "MODIFY",
"old_path": "include/Module/Decoder/Polar/SC/Decoder_polar_SC_fast_sys.hxx",
"new_path": "include/Module/Decoder/Polar/SC/Decoder_polar_SC_fast_sys.hxx",
"diff": "@@ -228,6 +228,7 @@ template <typename B, typename R, class API_polar>\nvoid Decoder_polar_SC_fast_sys<B,R,API_polar>\n::set_frozen_bits(const std::vector<bool>& fb)\n{\n+ aff3ct::tools::Interface_get_set_frozen_bits::assert_frozen_bits(fb, this->K, this->N);\nstd::copy(fb.begin(), fb.end(), this->frozen_bits.begin());\npolar_patterns.set_frozen_bits(this->frozen_bits);\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "include/Module/Decoder/Polar/SC/Decoder_polar_SC_naive.hxx",
"new_path": "include/Module/Decoder/Polar/SC/Decoder_polar_SC_naive.hxx",
"diff": "@@ -97,6 +97,7 @@ template <typename B, typename R, tools::proto_f<R> F, tools::proto_g<B,R> G, to\nvoid Decoder_polar_SC_naive<B,R,F,G,H>\n::set_frozen_bits(const std::vector<bool>& fb)\n{\n+ aff3ct::tools::Interface_get_set_frozen_bits::assert_frozen_bits(fb, this->K, this->N);\nstd::copy(fb.begin(), fb.end(), this->frozen_bits.begin());\nthis->recursive_initialize_frozen_bits(this->polar_tree.get_root(), fb);\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "include/Module/Decoder/Polar/SCAN/Decoder_polar_SCAN_naive.hpp",
"new_path": "include/Module/Decoder/Polar/SCAN/Decoder_polar_SCAN_naive.hpp",
"diff": "#include \"Tools/Code/Polar/decoder_polar_functions.h\"\n#include \"Module/Decoder/Decoder_SISO.hpp\"\n+#include \"Tools/Interface/Interface_get_set_frozen_bits.hpp\"\nnamespace aff3ct\n{\n@@ -19,14 +20,14 @@ template <typename B = int, typename R = float, tools::proto_f< R> F = &tools::\ntools::proto_h<B,R> H = &tools::h_LLR,\ntools::proto_i< R> I = &tools::init_LLR,\ntools::proto_s< R> S = &tools::sat_val>\n-class Decoder_polar_SCAN_naive : public Decoder_SISO<B,R>\n+class Decoder_polar_SCAN_naive : public Decoder_SISO<B,R>, public tools::Interface_get_set_frozen_bits\n{\nprotected:\nconst int m; // coded bits log-length\nconst int max_iter;\nconst int layers_count; // number of layers in the graph = m+1\n- const std::vector<bool>& frozen_bits;\n+ std::vector<bool> frozen_bits;\nstd::vector<std::vector<R>> feedback_graph;\nstd::vector<std::vector<R>> soft_graph;\n@@ -38,6 +39,9 @@ public:\nvirtual void set_n_frames(const size_t n_frames);\n+ virtual void set_frozen_bits(const std::vector<bool>& frozen_bits);\n+ virtual const std::vector<bool>& get_frozen_bits() const;\n+\nprotected:\nvoid _reset(const size_t frame_id);\n"
},
{
"change_type": "MODIFY",
"old_path": "include/Module/Decoder/Polar/SCAN/Decoder_polar_SCAN_naive.hxx",
"new_path": "include/Module/Decoder/Polar/SCAN/Decoder_polar_SCAN_naive.hxx",
"diff": "@@ -310,5 +310,22 @@ void Decoder_polar_SCAN_naive<B,R,F,V,H,I,S>\nDecoder_SISO<B,R>::set_n_frames(n_frames);\n}\n+template <typename B, typename R,\n+ tools::proto_f<R> F, tools::proto_v<R> V, tools::proto_h<B,R> H, tools::proto_i<R> I, tools::proto_s<R> S>\n+void Decoder_polar_SCAN_naive<B,R,F,V,H,I,S>\n+::set_frozen_bits(const std::vector<bool>& fb)\n+{\n+ aff3ct::tools::Interface_get_set_frozen_bits::assert_frozen_bits(fb, this->K, this->N);\n+ std::copy(fb.begin(), fb.end(), this->frozen_bits.begin());\n+}\n+\n+template <typename B, typename R,\n+ tools::proto_f<R> F, tools::proto_v<R> V, tools::proto_h<B,R> H, tools::proto_i<R> I, tools::proto_s<R> S>\n+const std::vector<bool>& Decoder_polar_SCAN_naive<B,R,F,V,H,I,S>\n+::get_frozen_bits() const\n+{\n+ return this->frozen_bits;\n+}\n+\n}\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "include/Module/Decoder/Polar/SCL/Decoder_polar_SCL_MEM_fast_sys.hxx",
"new_path": "include/Module/Decoder/Polar/SCL/Decoder_polar_SCL_MEM_fast_sys.hxx",
"diff": "@@ -221,6 +221,7 @@ template <typename B, typename R, class API_polar>\nvoid Decoder_polar_SCL_MEM_fast_sys<B,R,API_polar>\n::set_frozen_bits(const std::vector<bool>& fb)\n{\n+ aff3ct::tools::Interface_get_set_frozen_bits::assert_frozen_bits(fb, this->K, this->N);\nstd::copy(fb.begin(), fb.end(), this->frozen_bits.begin());\npolar_patterns.set_frozen_bits(fb);\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "include/Module/Decoder/Polar/SCL/Decoder_polar_SCL_fast_sys.hxx",
"new_path": "include/Module/Decoder/Polar/SCL/Decoder_polar_SCL_fast_sys.hxx",
"diff": "@@ -244,6 +244,7 @@ template <typename B, typename R, class API_polar>\nvoid Decoder_polar_SCL_fast_sys<B,R,API_polar>\n::set_frozen_bits(const std::vector<bool>& fb)\n{\n+ aff3ct::tools::Interface_get_set_frozen_bits::assert_frozen_bits(fb, this->K, this->N);\nstd::copy(fb.begin(), fb.end(), this->frozen_bits.begin());\npolar_patterns.set_frozen_bits(fb);\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "include/Module/Decoder/Polar/SCL/Decoder_polar_SCL_naive.hxx",
"new_path": "include/Module/Decoder/Polar/SCL/Decoder_polar_SCL_naive.hxx",
"diff": "@@ -121,6 +121,7 @@ template <typename B, typename R, tools::proto_f<R> F, tools::proto_g<B,R> G>\nvoid Decoder_polar_SCL_naive<B,R,F,G>\n::set_frozen_bits(const std::vector<bool>& fb)\n{\n+ aff3ct::tools::Interface_get_set_frozen_bits::assert_frozen_bits(fb, this->K, this->N);\nstd::copy(fb.begin(), fb.end(), this->frozen_bits.begin());\nfor (auto i = 0; i < L; i++)\nthis->recursive_initialize_frozen_bits(this->polar_trees[i].get_root(), frozen_bits);\n"
},
{
"change_type": "MODIFY",
"old_path": "include/Tools/Interface/Interface_get_set_frozen_bits.hpp",
"new_path": "include/Tools/Interface/Interface_get_set_frozen_bits.hpp",
"diff": "@@ -16,8 +16,10 @@ class Interface_get_set_frozen_bits\npublic:\nvirtual void set_frozen_bits(const std::vector<bool>& frozen_bits) = 0;\nvirtual const std::vector<bool>& get_frozen_bits() const = 0;\n-};\n+protected:\n+ static void assert_frozen_bits(const std::vector<bool>& frozen_bits, const int K, const int N);\n+};\n}\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "src/Module/Decoder/Polar_MK/SC/Decoder_polar_MK_SC_naive.cpp",
"new_path": "src/Module/Decoder/Polar_MK/SC/Decoder_polar_MK_SC_naive.cpp",
"diff": "@@ -166,6 +166,7 @@ template <typename B, typename R>\nvoid Decoder_polar_MK_SC_naive<B,R>\n::set_frozen_bits(const std::vector<bool>& fb)\n{\n+ aff3ct::tools::Interface_get_set_frozen_bits::assert_frozen_bits(fb, this->K, this->N);\nstd::copy(fb.begin(), fb.end(), this->frozen_bits.begin());\nthis->recursive_initialize_frozen_bits(this->polar_tree.get_root(), fb);\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "src/Module/Decoder/Polar_MK/SCL/Decoder_polar_MK_SCL_naive.cpp",
"new_path": "src/Module/Decoder/Polar_MK/SCL/Decoder_polar_MK_SCL_naive.cpp",
"diff": "@@ -190,6 +190,7 @@ template <typename B, typename R>\nvoid Decoder_polar_MK_SCL_naive<B,R>\n::set_frozen_bits(const std::vector<bool>& fb)\n{\n+ aff3ct::tools::Interface_get_set_frozen_bits::assert_frozen_bits(fb, this->K, this->N);\nstd::copy(fb.begin(), fb.end(), this->frozen_bits.begin());\nfor (auto i = 0; i < L; i++)\nthis->recursive_initialize_frozen_bits(this->polar_trees[i].get_root(), fb);\n"
},
{
"change_type": "MODIFY",
"old_path": "src/Module/Encoder/Polar/Encoder_polar.cpp",
"new_path": "src/Module/Encoder/Polar/Encoder_polar.cpp",
"diff": "@@ -25,15 +25,6 @@ Encoder_polar<B>\nthrow tools::length_error(__FILE__, __LINE__, __func__, message.str());\n}\n- auto k = 0; for (auto i = 0; i < this->N; i++) if (frozen_bits[i] == 0) k++;\n- if (this->K != k)\n- {\n- std::stringstream message;\n- message << \"The number of information bits in the frozen_bits is invalid ('K' = \" << K << \", 'k' = \"\n- << k << \").\";\n- throw tools::runtime_error(__FILE__, __LINE__, __func__, message.str());\n- }\n-\nthis->set_frozen_bits(frozen_bits);\n}\n@@ -108,6 +99,7 @@ template <typename B>\nvoid Encoder_polar<B>\n::set_frozen_bits(const std::vector<bool>& frozen_bits)\n{\n+ aff3ct::tools::Interface_get_set_frozen_bits::assert_frozen_bits(frozen_bits, this->K, this->N);\nstd::copy(frozen_bits.begin(), frozen_bits.end(), this->frozen_bits.begin());\nauto k = 0;\nfor (auto n = 0; n < this->N; n++)\n"
},
{
"change_type": "MODIFY",
"old_path": "src/Module/Encoder/Polar_MK/Encoder_polar_MK.cpp",
"new_path": "src/Module/Encoder/Polar_MK/Encoder_polar_MK.cpp",
"diff": "@@ -161,6 +161,7 @@ template <typename B>\nvoid Encoder_polar_MK<B>\n::set_frozen_bits(const std::vector<bool>& frozen_bits)\n{\n+ aff3ct::tools::Interface_get_set_frozen_bits::assert_frozen_bits(frozen_bits, this->K, this->N);\nstd::copy(frozen_bits.begin(), frozen_bits.end(), this->frozen_bits.begin());\nauto k = 0;\nfor (auto n = 0; n < this->N; n++)\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "src/Tools/Interface/Interface_get_set_frozen_bits.cpp",
"diff": "+#include \"Tools/Interface/Interface_get_set_frozen_bits.hpp\"\n+\n+#include <sstream>\n+#include \"Tools/Exception/exception.hpp\"\n+\n+using namespace aff3ct::tools;\n+\n+void Interface_get_set_frozen_bits\n+::assert_frozen_bits(const std::vector<bool>& frozen_bits, const int K, const int N)\n+{\n+ if (frozen_bits.size() != N)\n+ {\n+ std::stringstream message;\n+ message << \"The frozen_bits size is invalid ('N' = \" << N << \", 'Size' = \"\n+ << frozen_bits.size() << \").\";\n+ throw tools::runtime_error(__FILE__, __LINE__, __func__, message.str());\n+ }\n+\n+ auto k = 0;\n+ for (auto i = 0; i < N; i++) if (frozen_bits[i] == 0) k++;\n+\n+ if (K != k)\n+ {\n+ std::stringstream message;\n+ message << \"The number of information bits in the frozen_bits is invalid ('K' = \" << K << \", 'k' = \"\n+ << k << \").\";\n+ throw tools::runtime_error(__FILE__, __LINE__, __func__, message.str());\n+ }\n+}\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
Add assert_frozen_bits to Interface_get_set_frozen_bits for checking frozen bits validity.
|
8,486 |
31.01.2021 16:47:18
| -3,600 |
3dd91ca432c26695b502a1e66084efe2c200ea86
|
Create a new tool fb_assert for replacing assert_frozen_bits.
|
[
{
"change_type": "MODIFY",
"old_path": "include/Module/Decoder/Polar/SC/Decoder_polar_SC_fast_sys.hxx",
"new_path": "include/Module/Decoder/Polar/SC/Decoder_polar_SC_fast_sys.hxx",
"diff": "#include \"Tools/Code/Polar/Patterns/Pattern_polar_spc.hpp\"\n#include \"Tools/Code/Polar/Patterns/Pattern_polar_std.hpp\"\n#include \"Tools/Code/Polar/fb_extract.h\"\n+#include \"Tools/Code/Polar/fb_assert.h\"\n#include \"Module/Decoder/Polar/SC/Decoder_polar_SC_fast_sys.hpp\"\nnamespace aff3ct\n@@ -228,7 +229,7 @@ template <typename B, typename R, class API_polar>\nvoid Decoder_polar_SC_fast_sys<B,R,API_polar>\n::set_frozen_bits(const std::vector<bool>& fb)\n{\n- aff3ct::tools::Interface_get_set_frozen_bits::assert_frozen_bits(fb, this->K, this->N);\n+ aff3ct::tools::fb_assert(frozen_bits, this->K, this->N);\nstd::copy(fb.begin(), fb.end(), this->frozen_bits.begin());\npolar_patterns.set_frozen_bits(this->frozen_bits);\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "include/Module/Decoder/Polar/SC/Decoder_polar_SC_naive.hxx",
"new_path": "include/Module/Decoder/Polar/SC/Decoder_polar_SC_naive.hxx",
"diff": "#include \"Tools/Exception/exception.hpp\"\n#include \"Tools/Math/utils.h\"\n+#include \"Tools/Code/Polar/fb_assert.h\"\n#include \"Module/Decoder/Polar/SC/Decoder_polar_SC_naive.hpp\"\nnamespace aff3ct\n@@ -97,7 +98,7 @@ template <typename B, typename R, tools::proto_f<R> F, tools::proto_g<B,R> G, to\nvoid Decoder_polar_SC_naive<B,R,F,G,H>\n::set_frozen_bits(const std::vector<bool>& fb)\n{\n- aff3ct::tools::Interface_get_set_frozen_bits::assert_frozen_bits(fb, this->K, this->N);\n+ aff3ct::tools::fb_assert(fb, this->K, this->N);\nstd::copy(fb.begin(), fb.end(), this->frozen_bits.begin());\nthis->recursive_initialize_frozen_bits(this->polar_tree.get_root(), fb);\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "include/Module/Decoder/Polar/SCAN/Decoder_polar_SCAN_naive.hxx",
"new_path": "include/Module/Decoder/Polar/SCAN/Decoder_polar_SCAN_naive.hxx",
"diff": "#include \"Tools/Exception/exception.hpp\"\n#include \"Tools/Math/utils.h\"\n+#include \"Tools/Code/Polar/fb_assert.h\"\n#include \"Module/Decoder/Polar/SCAN/Decoder_polar_SCAN_naive.hpp\"\nnamespace aff3ct\n@@ -315,7 +316,7 @@ template <typename B, typename R,\nvoid Decoder_polar_SCAN_naive<B,R,F,V,H,I,S>\n::set_frozen_bits(const std::vector<bool>& fb)\n{\n- aff3ct::tools::Interface_get_set_frozen_bits::assert_frozen_bits(fb, this->K, this->N);\n+ aff3ct::tools::fb_assert(frozen_bits, this->K, this->N);\nstd::copy(fb.begin(), fb.end(), this->frozen_bits.begin());\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "include/Module/Decoder/Polar/SCL/Decoder_polar_SCL_MEM_fast_sys.hxx",
"new_path": "include/Module/Decoder/Polar/SCL/Decoder_polar_SCL_MEM_fast_sys.hxx",
"diff": "#include \"Tools/Code/Polar/Patterns/Pattern_polar_std.hpp\"\n#include \"Tools/Code/Polar/Pattern_polar_parser.hpp\"\n#include \"Tools/Code/Polar/fb_extract.h\"\n+#include \"Tools/Code/Polar/fb_assert.h\"\n#include \"Module/Decoder/Polar/SCL/Decoder_polar_SCL_fast_sys.hpp\"\n#include \"Module/Decoder/Polar/SCL/Decoder_polar_SCL_MEM_fast_sys.hpp\"\n@@ -221,7 +222,7 @@ template <typename B, typename R, class API_polar>\nvoid Decoder_polar_SCL_MEM_fast_sys<B,R,API_polar>\n::set_frozen_bits(const std::vector<bool>& fb)\n{\n- aff3ct::tools::Interface_get_set_frozen_bits::assert_frozen_bits(fb, this->K, this->N);\n+ aff3ct::tools::fb_assert(frozen_bits, this->K, this->N);\nstd::copy(fb.begin(), fb.end(), this->frozen_bits.begin());\npolar_patterns.set_frozen_bits(fb);\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "include/Module/Decoder/Polar/SCL/Decoder_polar_SCL_fast_sys.hxx",
"new_path": "include/Module/Decoder/Polar/SCL/Decoder_polar_SCL_fast_sys.hxx",
"diff": "#include \"Tools/Code/Polar/Patterns/Pattern_polar_std.hpp\"\n#include \"Tools/Code/Polar/Pattern_polar_parser.hpp\"\n#include \"Tools/Code/Polar/fb_extract.h\"\n+#include \"Tools/Code/Polar/fb_assert.h\"\n#include \"Module/Decoder/Polar/SCL/Decoder_polar_SCL_fast_sys.hpp\"\nnamespace aff3ct\n@@ -244,7 +245,7 @@ template <typename B, typename R, class API_polar>\nvoid Decoder_polar_SCL_fast_sys<B,R,API_polar>\n::set_frozen_bits(const std::vector<bool>& fb)\n{\n- aff3ct::tools::Interface_get_set_frozen_bits::assert_frozen_bits(fb, this->K, this->N);\n+ aff3ct::tools::fb_assert(frozen_bits, this->K, this->N);\nstd::copy(fb.begin(), fb.end(), this->frozen_bits.begin());\npolar_patterns.set_frozen_bits(fb);\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "include/Module/Decoder/Polar/SCL/Decoder_polar_SCL_naive.hxx",
"new_path": "include/Module/Decoder/Polar/SCL/Decoder_polar_SCL_naive.hxx",
"diff": "#include \"Tools/Exception/exception.hpp\"\n#include \"Tools/Math/utils.h\"\n+#include \"Tools/Code/Polar/fb_assert.h\"\n#include \"Module/Decoder/Polar/SCL/Decoder_polar_SCL_naive.hpp\"\nnamespace aff3ct\n@@ -121,7 +122,7 @@ template <typename B, typename R, tools::proto_f<R> F, tools::proto_g<B,R> G>\nvoid Decoder_polar_SCL_naive<B,R,F,G>\n::set_frozen_bits(const std::vector<bool>& fb)\n{\n- aff3ct::tools::Interface_get_set_frozen_bits::assert_frozen_bits(fb, this->K, this->N);\n+ aff3ct::tools::fb_assert(frozen_bits, this->K, this->N);\nstd::copy(fb.begin(), fb.end(), this->frozen_bits.begin());\nfor (auto i = 0; i < L; i++)\nthis->recursive_initialize_frozen_bits(this->polar_trees[i].get_root(), frozen_bits);\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "include/Tools/Code/Polar/fb_assert.h",
"diff": "+/*!\n+ * \\file\n+ * \\brief Class tools::Interface_get_set_frozen_bits.\n+ */\n+#ifndef fb_assert_h__\n+#define fb_assert_h__\n+\n+#include <vector>\n+\n+namespace aff3ct\n+{\n+namespace tools\n+{\n+inline void fb_assert(const std::vector<bool>& frozen_bits, const int K, const int N);\n+}\n+}\n+\n+#include \"Tools/Code/Polar/fb_assert.hxx\"\n+#endif // fb_assert_h__\n\\ No newline at end of file\n"
},
{
"change_type": "RENAME",
"old_path": "src/Tools/Interface/Interface_get_set_frozen_bits.cpp",
"new_path": "include/Tools/Code/Polar/fb_assert.hxx",
"diff": "-#include \"Tools/Interface/Interface_get_set_frozen_bits.hpp\"\n+#include \"Tools/Code/Polar/fb_assert.h\"\n#include <sstream>\n#include \"Tools/Exception/exception.hpp\"\n-using namespace aff3ct::tools;\n-\n-void Interface_get_set_frozen_bits\n-::assert_frozen_bits(const std::vector<bool>& frozen_bits, const int K, const int N)\n+namespace aff3ct\n+{\n+namespace tools\n+{\n+void fb_assert(const std::vector<bool>& frozen_bits, const int K, const int N)\n{\nif (frozen_bits.size() != N)\n{\n@@ -27,3 +28,5 @@ void Interface_get_set_frozen_bits\nthrow tools::runtime_error(__FILE__, __LINE__, __func__, message.str());\n}\n}\n+}\n+}\n\\ No newline at end of file\n"
},
{
"change_type": "MODIFY",
"old_path": "include/Tools/Interface/Interface_get_set_frozen_bits.hpp",
"new_path": "include/Tools/Interface/Interface_get_set_frozen_bits.hpp",
"diff": "@@ -16,9 +16,6 @@ class Interface_get_set_frozen_bits\npublic:\nvirtual void set_frozen_bits(const std::vector<bool>& frozen_bits) = 0;\nvirtual const std::vector<bool>& get_frozen_bits() const = 0;\n-\n-protected:\n- static void assert_frozen_bits(const std::vector<bool>& frozen_bits, const int K, const int N);\n};\n}\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "src/Module/Decoder/Polar_MK/SC/Decoder_polar_MK_SC_naive.cpp",
"new_path": "src/Module/Decoder/Polar_MK/SC/Decoder_polar_MK_SC_naive.cpp",
"diff": "#include \"Tools/Code/Polar/decoder_polar_functions.h\"\n#include \"Tools/Exception/exception.hpp\"\n+#include \"Tools/Code/Polar/fb_assert.h\"\n#include \"Module/Decoder/Polar_MK/SC/Decoder_polar_MK_SC_naive.hpp\"\nusing namespace aff3ct;\n@@ -166,7 +167,7 @@ template <typename B, typename R>\nvoid Decoder_polar_MK_SC_naive<B,R>\n::set_frozen_bits(const std::vector<bool>& fb)\n{\n- aff3ct::tools::Interface_get_set_frozen_bits::assert_frozen_bits(fb, this->K, this->N);\n+ aff3ct::tools::fb_assert(frozen_bits, this->K, this->N);\nstd::copy(fb.begin(), fb.end(), this->frozen_bits.begin());\nthis->recursive_initialize_frozen_bits(this->polar_tree.get_root(), fb);\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "src/Module/Decoder/Polar_MK/SCL/Decoder_polar_MK_SCL_naive.cpp",
"new_path": "src/Module/Decoder/Polar_MK/SCL/Decoder_polar_MK_SCL_naive.cpp",
"diff": "#include \"Tools/Code/Polar/decoder_polar_functions.h\"\n#include \"Tools/Exception/exception.hpp\"\n#include \"Tools/Math/utils.h\"\n+#include \"Tools/Code/Polar/fb_assert.h\"\n#include \"Module/Decoder/Polar_MK/SCL/Decoder_polar_MK_SCL_naive.hpp\"\nusing namespace aff3ct;\n@@ -190,7 +191,7 @@ template <typename B, typename R>\nvoid Decoder_polar_MK_SCL_naive<B,R>\n::set_frozen_bits(const std::vector<bool>& fb)\n{\n- aff3ct::tools::Interface_get_set_frozen_bits::assert_frozen_bits(fb, this->K, this->N);\n+ aff3ct::tools::fb_assert(frozen_bits, this->K, this->N);\nstd::copy(fb.begin(), fb.end(), this->frozen_bits.begin());\nfor (auto i = 0; i < L; i++)\nthis->recursive_initialize_frozen_bits(this->polar_trees[i].get_root(), fb);\n"
},
{
"change_type": "MODIFY",
"old_path": "src/Module/Encoder/Polar/Encoder_polar.cpp",
"new_path": "src/Module/Encoder/Polar/Encoder_polar.cpp",
"diff": "#include <algorithm>\n#include \"Tools/Exception/exception.hpp\"\n+#include \"Tools/Code/Polar/fb_assert.h\"\n#include \"Module/Encoder/Polar/Encoder_polar.hpp\"\nusing namespace aff3ct::module;\n@@ -99,7 +100,7 @@ template <typename B>\nvoid Encoder_polar<B>\n::set_frozen_bits(const std::vector<bool>& frozen_bits)\n{\n- aff3ct::tools::Interface_get_set_frozen_bits::assert_frozen_bits(frozen_bits, this->K, this->N);\n+ aff3ct::tools::fb_assert(frozen_bits, this->K, this->N);\nstd::copy(frozen_bits.begin(), frozen_bits.end(), this->frozen_bits.begin());\nauto k = 0;\nfor (auto n = 0; n < this->N; n++)\n"
},
{
"change_type": "MODIFY",
"old_path": "src/Module/Encoder/Polar_MK/Encoder_polar_MK.cpp",
"new_path": "src/Module/Encoder/Polar_MK/Encoder_polar_MK.cpp",
"diff": "#include <string>\n#include \"Tools/Exception/exception.hpp\"\n+#include \"Tools/Code/Polar/fb_assert.h\"\n#include \"Module/Encoder/Polar_MK/Encoder_polar_MK.hpp\"\nusing namespace aff3ct;\n@@ -161,7 +162,7 @@ template <typename B>\nvoid Encoder_polar_MK<B>\n::set_frozen_bits(const std::vector<bool>& frozen_bits)\n{\n- aff3ct::tools::Interface_get_set_frozen_bits::assert_frozen_bits(frozen_bits, this->K, this->N);\n+ aff3ct::tools::fb_assert(frozen_bits, this->K, this->N);\nstd::copy(frozen_bits.begin(), frozen_bits.end(), this->frozen_bits.begin());\nauto k = 0;\nfor (auto n = 0; n < this->N; n++)\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
Create a new tool fb_assert for replacing assert_frozen_bits.
|
8,490 |
29.01.2021 18:16:42
| -3,600 |
b394a7eb39827d306cd976b07ab0c967e8522856
|
Doc: improve the README to compile Doxygen separately from Sphinx.
|
[
{
"change_type": "MODIFY",
"old_path": "doc/README.md",
"new_path": "doc/README.md",
"diff": "@@ -25,3 +25,19 @@ make latexpdf\nThe last command will create a new folder: `build/html`.\nIn the `html` folder you just have to open the `index.html` file to read the generated documentation.\n+\n+# Generating Only the Doxygen Documentation\n+\n+Install Doxygen:\n+\n+```bash\n+sudo apt install doxygen\n+```\n+\n+Generate the documentation:\n+\n+```bash\n+mkdir build\n+cd source\n+doxygen Doxyfile\n+```\n\\ No newline at end of file\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
Doc: improve the README to compile Doxygen separately from Sphinx.
|
8,490 |
08.02.2021 21:55:47
| -3,600 |
a0be52fc50affeb88dd9c9d5ce96ec64c65947f4
|
Add a new `tools::Interface_get_trellis` class for RSC encoders.
|
[
{
"change_type": "MODIFY",
"old_path": "include/Module/Encoder/RSC/Encoder_RSC_sys.hpp",
"new_path": "include/Module/Encoder/RSC/Encoder_RSC_sys.hpp",
"diff": "#include <vector>\n#include \"Module/Encoder/Encoder.hpp\"\n+#include \"Tools/Interface/Interface_get_trellis.hpp\"\nnamespace aff3ct\n{\nnamespace module\n{\ntemplate <typename B = int>\n-class Encoder_RSC_sys : public Encoder<B>\n+class Encoder_RSC_sys : public Encoder<B>, public tools::Interface_get_trellis\n{\nprotected:\nconst int n_ff; // number of D flip-flop\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "include/Tools/Interface/Interface_get_trellis.hpp",
"diff": "+/*!\n+ * \\file\n+ * \\brief Class tools::Interface_get_trellis.\n+ */\n+#ifndef Interface_get_trellis_HPP__\n+#define Interface_get_trellis_HPP__\n+\n+#include <vector>\n+\n+namespace aff3ct\n+{\n+namespace tools\n+{\n+class Interface_get_trellis\n+{\n+public:\n+ virtual std::vector<std::vector<int>> get_trellis() = 0;\n+\n+};\n+}\n+}\n+\n+#endif // Interface_get_trellis_HPP__\n\\ No newline at end of file\n"
},
{
"change_type": "MODIFY",
"old_path": "include/aff3ct.hpp",
"new_path": "include/aff3ct.hpp",
"diff": "#ifndef INTERFACE_GET_SET_NOISE_HPP__\n#include <Tools/Interface/Interface_get_set_noise.hpp>\n#endif\n+#ifndef Interface_get_trellis_HPP__\n+#include <Tools/Interface/Interface_get_trellis.hpp>\n+#endif\n#ifndef INTERFACE_IS_DONE_HPP__\n#include <Tools/Interface/Interface_is_done.hpp>\n#endif\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
Add a new `tools::Interface_get_trellis` class for RSC encoders.
|
8,490 |
23.02.2021 09:37:33
| -3,600 |
7cb7f6713ec83843e5e242c9924653fcc943aaea
|
Add a new method in 'tools::Sequence' to get the cloned modules.
|
[
{
"change_type": "MODIFY",
"old_path": "include/Tools/Sequence/Sequence.hpp",
"new_path": "include/Tools/Sequence/Sequence.hpp",
"diff": "@@ -148,6 +148,9 @@ public:\ntemplate <class C = module::Module>\nstd::vector<C*> get_modules(const bool subsequence_modules = true) const;\n+ template <class C = module::Module>\n+ std::vector<C*> get_cloned_modules(const C &module) const;\n+\nstd::vector<std::vector<module::Module*>> get_modules_per_threads() const;\nstd::vector<std::vector<module::Module*>> get_modules_per_types () const;\n"
},
{
"change_type": "MODIFY",
"old_path": "include/Tools/Sequence/Sequence.hxx",
"new_path": "include/Tools/Sequence/Sequence.hxx",
"diff": "@@ -51,6 +51,34 @@ std::vector<C*> Sequence\nreturn ret;\n}\n+template <class C>\n+std::vector<C*> Sequence\n+::get_cloned_modules(const C &module) const\n+{\n+ std::vector<C*> cloned_modules(this->all_modules[0].size());\n+ for (auto &e : this->all_modules)\n+ {\n+ auto c = dynamic_cast<C*>(e[0]);\n+ if (c == &module)\n+ {\n+ cloned_modules[0] = c;\n+ for (size_t m = 1; m < cloned_modules.size(); m++)\n+ {\n+ c = dynamic_cast<C*>(e[m]);\n+ if (c == nullptr)\n+ {\n+ std::stringstream message;\n+ message << \"'c' can't be 'nullptr', this should never happen.\";\n+ throw tools::runtime_error(__FILE__, __LINE__, __func__, message.str());\n+ }\n+ cloned_modules[m] = c;\n+ }\n+ break;\n+ }\n+ }\n+ return cloned_modules;\n+}\n+\ntemplate <class SS>\ninline void Sequence\n::_init(Generic_node<SS> *root)\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
Add a new method in 'tools::Sequence' to get the cloned modules.
|
8,490 |
23.02.2021 10:47:24
| -3,600 |
2d488b77faeb026b65a656f296afdc3438503af1
|
Fix the `tools::Sequence::get_cloned_modules()` implementation.
|
[
{
"change_type": "MODIFY",
"old_path": "include/Tools/Sequence/Sequence.hxx",
"new_path": "include/Tools/Sequence/Sequence.hxx",
"diff": "@@ -55,26 +55,32 @@ template <class C>\nstd::vector<C*> Sequence\n::get_cloned_modules(const C &module_ref) const\n{\n- std::vector<C*> cloned_modules(this->all_modules[0].size());\n- for (auto &e : this->all_modules)\n- {\n- auto c = dynamic_cast<C*>(e[0]);\n- if (c == &module_ref)\n+ bool found = false;\n+ size_t mid = 0;\n+ while (mid < this->all_modules[0].size() && !found)\n+ if (dynamic_cast<C*>(this->all_modules[0][mid]) == &module_ref)\n+ found = true;\n+ else\n+ mid++;\n+\n+ if (!found)\n{\n- cloned_modules[0] = c;\n- for (size_t m = 1; m < cloned_modules.size(); m++)\n+ std::stringstream message;\n+ message << \"'module_ref' can't be found in the sequence.\";\n+ throw tools::runtime_error(__FILE__, __LINE__, __func__, message.str());\n+ }\n+\n+ std::vector<C*> cloned_modules(this->all_modules.size());\n+ for (size_t tid = 0; tid < this->all_modules.size(); tid++)\n{\n- c = dynamic_cast<C*>(e[m]);\n+ auto c = dynamic_cast<C*>(this->all_modules[tid][mid]);\nif (c == nullptr)\n{\nstd::stringstream message;\nmessage << \"'c' can't be 'nullptr', this should never happen.\";\nthrow tools::runtime_error(__FILE__, __LINE__, __func__, message.str());\n}\n- cloned_modules[m] = c;\n- }\n- break;\n- }\n+ cloned_modules[tid] = c;\n}\nreturn cloned_modules;\n}\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
Fix the `tools::Sequence::get_cloned_modules()` implementation.
|
8,490 |
23.02.2021 12:45:44
| -3,600 |
30b63065043382960f4f652ccfc334b0bbc2cc20
|
CI: temporally disable the Intel compiler build test.
|
[
{
"change_type": "MODIFY",
"old_path": ".gitlab-ci.yml",
"new_path": ".gitlab-ci.yml",
"diff": "@@ -313,37 +313,37 @@ build-linux-gcc-4.8:\n- source ./ci/tools/threads.sh\n- ./ci/build-linux-macos.sh\n-build-linux-icpc:\n- stage: build\n- variables:\n- GIT_SUBMODULE_STRATEGY: recursive\n- except:\n- - schedules\n- needs:\n- - job: analysis-cppcheck\n- artifacts: false\n- - job: analysis-headers\n- artifacts: false\n- tags:\n- - linux\n- - icpc\n- - cmake\n- - mkl\n- - gsl\n- - x86\n- artifacts:\n- name: build-linux-icpc\n- paths:\n- - build_linux_icpc\n- script:\n- - source /opt/intel/vars-intel.sh\n- - export CC=\"icc\"\n- - export CXX=\"icpc\"\n- - export CFLAGS=\"-Wall -funroll-loops -march=native -std=c++11\"\n- - export CMAKE_OPT=\"-DAFF3CT_COMPILE_EXE=ON -DAFF3CT_COMPILE_STATIC_LIB=ON -DAFF3CT_COMPILE_SHARED_LIB=ON -DAFF3CT_PREC=MULTI -DAFF3CT_EXT_STRINGS=OFF -DAFF3CT_LINK_GSL=ON -DAFF3CT_LINK_MKL=ON\"\n- - export NAME=\"build_linux_icpc\"\n- - source ./ci/tools/threads.sh\n- - ./ci/build-linux-macos.sh\n+# build-linux-icpc:\n+# stage: build\n+# variables:\n+# GIT_SUBMODULE_STRATEGY: recursive\n+# except:\n+# - schedules\n+# needs:\n+# - job: analysis-cppcheck\n+# artifacts: false\n+# - job: analysis-headers\n+# artifacts: false\n+# tags:\n+# - linux\n+# - icpc\n+# - cmake\n+# - mkl\n+# - gsl\n+# - x86\n+# artifacts:\n+# name: build-linux-icpc\n+# paths:\n+# - build_linux_icpc\n+# script:\n+# - source /opt/intel/vars-intel.sh\n+# - export CC=\"icc\"\n+# - export CXX=\"icpc\"\n+# - export CFLAGS=\"-Wall -funroll-loops -march=native -std=c++11\"\n+# - export CMAKE_OPT=\"-DAFF3CT_COMPILE_EXE=ON -DAFF3CT_COMPILE_STATIC_LIB=ON -DAFF3CT_COMPILE_SHARED_LIB=ON -DAFF3CT_PREC=MULTI -DAFF3CT_EXT_STRINGS=OFF -DAFF3CT_LINK_GSL=ON -DAFF3CT_LINK_MKL=ON\"\n+# - export NAME=\"build_linux_icpc\"\n+# - source ./ci/tools/threads.sh\n+# - ./ci/build-linux-macos.sh\nbuild-windows-gcc-x86-sse4.2:\nstage: build\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
CI: temporally disable the Intel compiler build test.
|
8,490 |
08.03.2021 22:18:18
| -3,600 |
555c2397d9d2368bc6966a7bb5d38b09d651d7cd
|
Add auto stop mechanism to `tools::Sequence` and `tools::Pipeline`.
|
[
{
"change_type": "MODIFY",
"old_path": "include/Tools/Sequence/Pipeline.hpp",
"new_path": "include/Tools/Sequence/Pipeline.hpp",
"diff": "@@ -39,6 +39,7 @@ protected:\nstd::vector<std::vector<size_t>> saved_lasts_tasks_id;\nbool bound_adaptors;\n+ bool auto_stop;\npublic:\n// Pipeline(const module::Task &first,\n@@ -115,6 +116,7 @@ public:\nvoid exec(std::function<bool(const std::vector<const int*>&)> stop_condition);\nvoid exec(std::function<bool( )> stop_condition);\n+ void exec( );\nstd::vector<Sequence*> get_stages();\nSequence& operator[](const size_t stage_id);\n@@ -136,6 +138,9 @@ public:\nvoid unbind_adaptors();\nbool is_bound_adaptors() const;\n+ void set_auto_stop(const bool auto_stop);\n+ bool is_auto_stop() const;\n+\nsize_t get_n_frames() const;\nvoid set_n_frames(const size_t n_frames);\n"
},
{
"change_type": "MODIFY",
"old_path": "include/Tools/Sequence/Sequence.hpp",
"new_path": "include/Tools/Sequence/Sequence.hpp",
"diff": "@@ -77,6 +77,7 @@ protected:\nbool no_copy_mode;\nconst std::vector<const module::Task*> saved_exclusions;\nstd::vector<tools::Interface_is_done*> donners;\n+ bool auto_stop;\npublic:\nSequence(const std::vector<const module::Task*> &firsts,\n@@ -165,6 +166,9 @@ public:\nvoid set_no_copy_mode(const bool no_copy_mode);\nbool is_no_copy_mode() const;\n+ void set_auto_stop(const bool auto_stop);\n+ bool is_auto_stop() const;\n+\ninline size_t get_n_frames() const;\nvoid set_n_frames(const size_t n_frames);\n"
},
{
"change_type": "MODIFY",
"old_path": "src/Tools/Sequence/Pipeline.cpp",
"new_path": "src/Tools/Sequence/Pipeline.cpp",
"diff": "@@ -81,7 +81,8 @@ Pipeline\nadaptors(sep_stages.size() -1),\nsaved_firsts_tasks_id(sep_stages.size()),\nsaved_lasts_tasks_id(sep_stages.size()),\n- bound_adaptors(false)\n+ bound_adaptors(false),\n+ auto_stop(true)\n{\nthis->init<module::Task>(firsts,\nlasts,\n@@ -108,7 +109,8 @@ Pipeline\nadaptors(sep_stages.size() -1),\nsaved_firsts_tasks_id(sep_stages.size()),\nsaved_lasts_tasks_id(sep_stages.size()),\n- bound_adaptors(false)\n+ bound_adaptors(false),\n+ auto_stop(true)\n{\nstd::vector<std::tuple<std::vector<module::Task*>,\nstd::vector<module::Task*>,\n@@ -1030,6 +1032,12 @@ void Pipeline\nthis->exec(std::vector<std::function<bool()>>(this->stages.size(), stop_condition));\n}\n+void Pipeline\n+::exec()\n+{\n+ this->exec([]() { return false; });\n+}\n+\nconst std::vector<std::vector<module::Task*>>& Pipeline\n::get_firsts_tasks() const\n{\n@@ -1196,6 +1204,20 @@ bool Pipeline\nreturn this->bound_adaptors;\n}\n+void Pipeline\n+::set_auto_stop(const bool auto_stop)\n+{\n+ this->auto_stop = auto_stop;\n+ for (auto stage : this->stages)\n+ stage->set_auto_stop(auto_stop);\n+}\n+\n+bool Pipeline\n+::is_auto_stop() const\n+{\n+ return this->auto_stop;\n+}\n+\nsize_t Pipeline\n::get_n_frames() const\n{\n"
},
{
"change_type": "MODIFY",
"old_path": "src/Tools/Sequence/Sequence.cpp",
"new_path": "src/Tools/Sequence/Sequence.cpp",
"diff": "@@ -40,7 +40,8 @@ Sequence\nthread_pinning(thread_pinning),\npuids(puids),\nno_copy_mode(true),\n- saved_exclusions(exclusions)\n+ saved_exclusions(exclusions),\n+ auto_stop(true)\n{\n#ifndef AFF3CT_HWLOC\nif (thread_pinning)\n@@ -568,11 +569,25 @@ void Sequence\nif (this->is_no_copy_mode())\nthis->gen_processes(true);\n+ std::function<bool(const std::vector<const int*>&)> real_stop_condition;\n+ if (this->auto_stop)\n+ real_stop_condition = [this, stop_condition](const std::vector<const int*>& statuses)\n+ {\n+ bool res = stop_condition(statuses);\n+ for (auto donner : this->donners)\n+ if (donner->is_done())\n+ return true;\n+ return res;\n+ };\n+ else\n+ real_stop_condition = stop_condition;\n+\nstd::vector<std::thread> threads(n_threads);\nfor (size_t tid = 1; tid < n_threads; tid++)\n- threads[tid] = std::thread(&Sequence::_exec, this, tid, std::ref(stop_condition), std::ref(this->sequences[tid]));\n+ threads[tid] = std::thread(&Sequence::_exec, this, tid, std::ref(real_stop_condition),\n+ std::ref(this->sequences[tid]));\n- this->_exec(0, stop_condition, this->sequences[0]);\n+ this->_exec(0, real_stop_condition, this->sequences[0]);\nfor (size_t tid = 1; tid < n_threads; tid++)\nthreads[tid].join();\n@@ -596,14 +611,27 @@ void Sequence\nif (this->is_no_copy_mode())\nthis->gen_processes(true);\n+ std::function<bool()> real_stop_condition;\n+ if (this->auto_stop)\n+ real_stop_condition = [this, stop_condition]()\n+ {\n+ bool res = stop_condition();\n+ for (auto donner : this->donners)\n+ if (donner->is_done())\n+ return true;\n+ return res;\n+ };\n+ else\n+ real_stop_condition = stop_condition;\n+\nstd::vector<std::thread> threads(n_threads);\nfor (size_t tid = 1; tid < n_threads; tid++)\n{\n- threads[tid] = std::thread(&Sequence::_exec_without_statuses, this, tid, std::ref(stop_condition),\n+ threads[tid] = std::thread(&Sequence::_exec_without_statuses, this, tid, std::ref(real_stop_condition),\nstd::ref(this->sequences[tid]));\n}\n- this->_exec_without_statuses(0, stop_condition, this->sequences[0]);\n+ this->_exec_without_statuses(0, real_stop_condition, this->sequences[0]);\nfor (size_t tid = 1; tid < n_threads; tid++)\nthreads[tid].join();\n@@ -624,13 +652,7 @@ void Sequence\nvoid Sequence\n::exec()\n{\n- this->exec([this]()\n- {\n- for (auto donner : this->donners)\n- if (donner->is_done())\n- return true;\n- return false;\n- });\n+ this->exec([]() { return false; });\n}\nvoid Sequence\n@@ -1427,6 +1449,18 @@ bool Sequence\nreturn this->no_copy_mode;\n}\n+void Sequence\n+::set_auto_stop(const bool auto_stop)\n+{\n+ this->auto_stop = auto_stop;\n+}\n+\n+bool Sequence\n+::is_auto_stop() const\n+{\n+ return this->auto_stop;\n+}\n+\nSub_sequence* Sequence\n::get_last_subsequence(const size_t tid)\n{\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
Add auto stop mechanism to `tools::Sequence` and `tools::Pipeline`.
|
8,490 |
11.03.2021 14:35:27
| -3,600 |
0d087a8aea21f77e42a5f8bd19f7c5cfd241a8e2
|
Fix the missing initialization of the `auto_stop` boolean.
|
[
{
"change_type": "MODIFY",
"old_path": "src/Tools/Sequence/Sequence.cpp",
"new_path": "src/Tools/Sequence/Sequence.cpp",
"diff": "@@ -124,7 +124,8 @@ Sequence\nthread_pinning(thread_pinning),\npuids(puids),\nno_copy_mode(true),\n- saved_exclusions(exclusions_convert_to_const(exclusions))\n+ saved_exclusions(exclusions_convert_to_const(exclusions)),\n+ auto_stop(true)\n{\nif (thread_pinning && puids.size() < n_threads)\n{\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
Fix the missing initialization of the `auto_stop` boolean.
|
8,490 |
14.03.2021 19:01:44
| -3,600 |
743e003aa9c40ef1758bb5aa9b9fcae64182178c
|
Create "module::Switch" and "module::Multiplexer" + code factorization.
|
[
{
"change_type": "MODIFY",
"old_path": "include/Module/Adaptor/Adaptor.hpp",
"new_path": "include/Module/Adaptor/Adaptor.hpp",
"diff": "@@ -28,10 +28,10 @@ namespace module\nnamespace sck\n{\n- enum class push_1 : size_t { in1, in2, in3, in4, status };\n- enum class pull_n : size_t { out1, out2, out3, out4, status };\n- enum class push_n : size_t { in1, in2, in3, in4, status };\n- enum class pull_1 : size_t { out1, out2, out3, out4, status };\n+ enum class push_1 : size_t { in0, in1, in2, in3, status };\n+ enum class pull_n : size_t { out0, out1, out2, out3, status };\n+ enum class push_n : size_t { in0, in1, in2, in3, status };\n+ enum class pull_1 : size_t { out0, out1, out2, out3, status };\n}\n}\n@@ -94,10 +94,6 @@ protected:\nvirtual void* get_filled_buffer(const size_t sid, void* swap_buffer) = 0;\nvirtual void wake_up_pusher() = 0;\nvirtual void wake_up_puller() = 0;\n-\n-private:\n- static size_t compute_bytes(const size_t n_elmts, const std::type_index type);\n- static std::vector<size_t> compute_bytes(const std::vector<size_t> &n_elmts, const std::vector<std::type_index> &type);\n};\n}\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "include/Module/Adaptor/Adaptor.hxx",
"new_path": "include/Module/Adaptor/Adaptor.hxx",
"diff": "#include <string>\n#include <sstream>\n+#include \"Tools/general_utils.h\"\n#include \"Tools/Exception/exception.hpp\"\n#include \"Module/Adaptor/Adaptor.hpp\"\n@@ -16,7 +17,7 @@ Adaptor\nconst size_t buffer_size)\n: Module(),\nn_elmts(1, n_elmts),\n- n_bytes(1, compute_bytes(n_elmts, datatype)),\n+ n_bytes(1, tools::compute_bytes(n_elmts, datatype)),\ndatatype(1, datatype),\nbuffer_size(buffer_size),\nn_sockets(1),\n@@ -68,7 +69,7 @@ Adaptor\nconst size_t buffer_size)\n: Module(),\nn_elmts(n_elmts),\n- n_bytes(compute_bytes(n_elmts, datatype)),\n+ n_bytes(tools::compute_bytes(n_elmts, datatype)),\ndatatype(datatype),\nbuffer_size(buffer_size),\nn_sockets(n_elmts.size()),\n"
},
{
"change_type": "MODIFY",
"old_path": "include/Module/Adaptor/Adaptor_1_to_n.hxx",
"new_path": "include/Module/Adaptor/Adaptor_1_to_n.hxx",
"diff": "@@ -65,44 +65,10 @@ void Adaptor_1_to_n\nthis->set_short_name(name);\nthis->set_single_wave(true);\n- std::function<size_t(Task&, const size_t, const std::type_index&, const std::string&)> create_socket_in =\n- [this](Task& p, const size_t n_elmts, const std::type_index& datatype, const std::string& n)\n- {\n- if (datatype == typeid(int8_t )) return this->template create_socket_in<int8_t >(p, n, n_elmts);\n- else if (datatype == typeid(int16_t)) return this->template create_socket_in<int16_t>(p, n, n_elmts);\n- else if (datatype == typeid(int32_t)) return this->template create_socket_in<int32_t>(p, n, n_elmts);\n- else if (datatype == typeid(int64_t)) return this->template create_socket_in<int64_t>(p, n, n_elmts);\n- else if (datatype == typeid(float )) return this->template create_socket_in<float >(p, n, n_elmts);\n- else if (datatype == typeid(double )) return this->template create_socket_in<double >(p, n, n_elmts);\n- else\n- {\n- std::stringstream message;\n- message << \"This should never happen.\";\n- throw tools::runtime_error(__FILE__, __LINE__, __func__, message.str());\n- }\n- };\n-\n- std::function<size_t(Task&, const size_t, const std::type_index&, const std::string&)> create_socket_out =\n- [this](Task& p, const size_t n_elmts, const std::type_index& datatype, const std::string& n)\n- {\n- if (datatype == typeid(int8_t )) return this->template create_socket_out<int8_t >(p, n, n_elmts);\n- else if (datatype == typeid(int16_t)) return this->template create_socket_out<int16_t>(p, n, n_elmts);\n- else if (datatype == typeid(int32_t)) return this->template create_socket_out<int32_t>(p, n, n_elmts);\n- else if (datatype == typeid(int64_t)) return this->template create_socket_out<int64_t>(p, n, n_elmts);\n- else if (datatype == typeid(float )) return this->template create_socket_out<float >(p, n, n_elmts);\n- else if (datatype == typeid(double )) return this->template create_socket_out<double >(p, n, n_elmts);\n- else\n- {\n- std::stringstream message;\n- message << \"This should never happen.\";\n- throw tools::runtime_error(__FILE__, __LINE__, __func__, message.str());\n- }\n- };\n-\nauto &p1 = this->create_task(\"push_1\", (int)adp::tsk::push_1);\nstd::vector<size_t> p1s_in;\nfor (size_t s = 0; s < this->n_sockets; s++)\n- p1s_in.push_back(create_socket_in(p1, this->n_elmts[s], this->datatype[s], \"in\" + std::to_string(s+1)));\n+ p1s_in.push_back(this->create_socket_in(p1, \"in\" + std::to_string(s), this->n_elmts[s], this->datatype[s]));\nthis->create_codelet(p1, [p1s_in](Module &m, Task &t, const size_t frame_id) -> int\n{\n@@ -127,7 +93,7 @@ void Adaptor_1_to_n\nauto &p2 = this->create_task(\"pull_n\", (int)adp::tsk::pull_n);\nstd::vector<size_t> p2s_out;\nfor (size_t s = 0; s < this->n_sockets; s++)\n- p2s_out.push_back(create_socket_out(p2, this->n_elmts[s], this->datatype[s], \"out\" + std::to_string(s+1)));\n+ p2s_out.push_back(this->create_socket_out(p2, \"out\" + std::to_string(s), this->n_elmts[s], this->datatype[s]));\nthis->create_codelet(p2, [p2s_out](Module &m, Task &t, const size_t frame_id) -> int\n{\n"
},
{
"change_type": "MODIFY",
"old_path": "include/Module/Adaptor/Adaptor_n_to_1.hxx",
"new_path": "include/Module/Adaptor/Adaptor_n_to_1.hxx",
"diff": "@@ -65,44 +65,10 @@ void Adaptor_n_to_1\nthis->set_short_name(name);\nthis->set_single_wave(true);\n- std::function<size_t(Task&, const size_t, const std::type_index&, const std::string&)> create_socket_in =\n- [this](Task& p, const size_t n_elmts, const std::type_index& datatype, const std::string& n)\n- {\n- if (datatype == typeid(int8_t )) return this->template create_socket_in<int8_t >(p, n, n_elmts);\n- else if (datatype == typeid(int16_t)) return this->template create_socket_in<int16_t>(p, n, n_elmts);\n- else if (datatype == typeid(int32_t)) return this->template create_socket_in<int32_t>(p, n, n_elmts);\n- else if (datatype == typeid(int64_t)) return this->template create_socket_in<int64_t>(p, n, n_elmts);\n- else if (datatype == typeid(float )) return this->template create_socket_in<float >(p, n, n_elmts);\n- else if (datatype == typeid(double )) return this->template create_socket_in<double >(p, n, n_elmts);\n- else\n- {\n- std::stringstream message;\n- message << \"This should never happen.\";\n- throw tools::runtime_error(__FILE__, __LINE__, __func__, message.str());\n- }\n- };\n-\n- std::function<size_t(Task&, const size_t, const std::type_index&, const std::string&)> create_socket_out =\n- [this](Task& p, const size_t n_elmts, const std::type_index& datatype, const std::string& n)\n- {\n- if (datatype == typeid(int8_t )) return this->template create_socket_out<int8_t >(p, n, n_elmts);\n- else if (datatype == typeid(int16_t)) return this->template create_socket_out<int16_t>(p, n, n_elmts);\n- else if (datatype == typeid(int32_t)) return this->template create_socket_out<int32_t>(p, n, n_elmts);\n- else if (datatype == typeid(int64_t)) return this->template create_socket_out<int64_t>(p, n, n_elmts);\n- else if (datatype == typeid(float )) return this->template create_socket_out<float >(p, n, n_elmts);\n- else if (datatype == typeid(double )) return this->template create_socket_out<double >(p, n, n_elmts);\n- else\n- {\n- std::stringstream message;\n- message << \"This should never happen.\";\n- throw tools::runtime_error(__FILE__, __LINE__, __func__, message.str());\n- }\n- };\n-\nauto &p1 = this->create_task(\"push_n\", (int)adp::tsk::push_n);\nstd::vector<size_t> p1s_in;\nfor (size_t s = 0; s < this->n_sockets; s++)\n- p1s_in.push_back(create_socket_in(p1, this->n_elmts[s], this->datatype[s], \"in\" + std::to_string(s+1)));\n+ p1s_in.push_back(this->create_socket_in(p1, \"in\" + std::to_string(s), this->n_elmts[s], this->datatype[s]));\nthis->create_codelet(p1, [p1s_in](Module &m, Task &t, const size_t frame_id) -> int\n{\n@@ -127,7 +93,7 @@ void Adaptor_n_to_1\nauto &p2 = this->create_task(\"pull_1\", (int)adp::tsk::pull_1);\nstd::vector<size_t> p2s_out;\nfor (size_t s = 0; s < this->n_sockets; s++)\n- p2s_out.push_back(create_socket_out(p2, this->n_elmts[s], this->datatype[s], \"out\" + std::to_string(s+1)));\n+ p2s_out.push_back(this->create_socket_out(p2, \"out\" + std::to_string(s), this->n_elmts[s], this->datatype[s]));\nthis->create_codelet(p2, [p2s_out](Module &m, Task &t, const size_t frame_id) -> int\n{\n"
},
{
"change_type": "MODIFY",
"old_path": "include/Module/Module.hpp",
"new_path": "include/Module/Module.hpp",
"diff": "@@ -97,12 +97,14 @@ protected:\ntemplate <typename T>\nsize_t create_socket_in(Task& task, const std::string &name, const size_t n_elmts);\n+ size_t create_socket_in(Task& task, const std::string &name, const size_t n_elmts, const std::type_index& datatype);\ntemplate <typename T>\nsize_t create_socket_in_out(Task& task, const std::string &name, const size_t n_elmts);\ntemplate <typename T>\nsize_t create_socket_out(Task& task, const std::string &name, const size_t n_elmts);\n+ size_t create_socket_out(Task& task, const std::string &name, const size_t n_elmts, const std::type_index& datatype);\nvoid create_codelet(Task& task, std::function<int(Module &m, Task &t, const size_t frame_id)> codelet);\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "include/Module/Multiplexer/Multiplexer.hpp",
"diff": "+/*!\n+ * \\file\n+ * \\brief Class module::Multiplexer.\n+ */\n+#ifndef MULTIPLEXER_HPP_\n+#define MULTIPLEXER_HPP_\n+\n+#include <cstddef>\n+#include <cstdint>\n+#include <memory>\n+#include <vector>\n+#include <typeindex>\n+\n+#include \"Module/Task.hpp\"\n+#include \"Module/Socket.hpp\"\n+#include \"Module/Module.hpp\"\n+\n+namespace aff3ct\n+{\n+namespace module\n+{\n+ namespace mux\n+ {\n+ enum class tsk : size_t { multiplex, SIZE };\n+ }\n+\n+class Multiplexer : public Module\n+{\n+public:\n+ inline Task& operator[](const mux::tsk t);\n+\n+protected:\n+ const size_t n_data_sockets;\n+ const size_t n_elmts;\n+ const size_t n_bytes;\n+ const std::type_index datatype;\n+\n+public:\n+ inline Multiplexer(const size_t n_data_sockets,\n+ const size_t n_elmts,\n+ const std::type_index datatype);\n+ virtual ~Multiplexer() = default;\n+\n+ inline size_t get_n_data_sockets() const;\n+ inline size_t get_n_elmts () const;\n+ inline size_t get_n_bytes () const;\n+ inline std::type_index get_datatype () const;\n+ inline size_t get_n_calls () const;\n+};\n+}\n+}\n+\n+#ifndef DOXYGEN_SHOULD_SKIP_THIS\n+#include \"Module/Multiplexer/Multiplexer.hxx\"\n+#endif\n+\n+#endif /* MULTIPLEXER_HPP_ */\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "include/Module/Multiplexer/Multiplexer.hxx",
"diff": "+#include <string>\n+#include <sstream>\n+#include <algorithm>\n+\n+#include \"Tools/general_utils.h\"\n+#include \"Tools/Exception/exception.hpp\"\n+#include \"Module/Multiplexer/Multiplexer.hpp\"\n+\n+namespace aff3ct\n+{\n+namespace module\n+{\n+\n+Task& Multiplexer\n+::operator[](const mux::tsk t)\n+{\n+ return Module::operator[]((size_t)t);\n+}\n+\n+Multiplexer\n+::Multiplexer(const size_t n_data_sockets,\n+ const size_t n_elmts,\n+ const std::type_index datatype)\n+: Module(),\n+ n_data_sockets(n_data_sockets),\n+ n_elmts(n_elmts),\n+ n_bytes(tools::compute_bytes(n_elmts, datatype)),\n+ datatype(datatype)\n+{\n+ const std::string name = \"Multiplexer\";\n+ this->set_name(name);\n+ this->set_short_name(name);\n+ this->set_single_wave(true);\n+\n+ if (n_data_sockets == 0)\n+ {\n+ std::stringstream message;\n+ message << \"'n_data_sockets' has to be greater than 0 ('n_data_sockets' = \" << n_data_sockets << \").\";\n+ throw tools::invalid_argument(__FILE__, __LINE__, __func__, message.str());\n+ }\n+\n+ if (n_elmts == 0)\n+ {\n+ std::stringstream message;\n+ message << \"'n_elmts' has to be greater than 0 ('n_elmts' = \" << n_elmts << \").\";\n+ throw tools::invalid_argument(__FILE__, __LINE__, __func__, message.str());\n+ }\n+\n+ auto &p = this->create_task(\"multiplex\");\n+ auto ps_in_ctrl = this->create_socket_in(p, \"in_ctrl\", 1, typeid(int8_t));\n+ std::vector<size_t> ps_in_data;\n+ for (size_t s = 0; s < this->n_data_sockets; s++)\n+ ps_in_data.push_back(this->create_socket_in(p, \"in_data\" + std::to_string(s), n_elmts, datatype));\n+ auto ps_out_data = this->create_socket_out(p, \"out_data\", n_elmts, datatype);\n+\n+ this->create_codelet(p, [ps_in_ctrl, ps_in_data, ps_out_data](Module &m, Task &t, const size_t frame_id) -> int\n+ {\n+ auto &mux = static_cast<Multiplexer&>(m);\n+\n+ const auto ctrl_socket_in = static_cast<const int8_t*>(t[ps_in_ctrl ].get_dataptr());\n+ const size_t ctrl = (size_t)ctrl_socket_in[0] % mux->get_n_data_sockets();\n+ const auto data_socket_in = static_cast<const int8_t*>(t[ps_in_data[ctrl]].get_dataptr());\n+ auto data_socket_out = static_cast< int8_t*>(t[ps_out_data ].get_dataptr());\n+\n+ std::copy(data_socket_in,\n+ data_socket_in + mux->get_n_frames() * mux->get_n_bytes(),\n+ data_socket_out);\n+\n+ return status_t::SUCCESS;\n+ });\n+}\n+\n+size_t Multiplexer\n+::get_n_data_sockets() const\n+{\n+ return this->n_data_sockets;\n+}\n+\n+size_t Multiplexer\n+::get_n_elmts() const\n+{\n+ return this->n_elmts;\n+}\n+\n+size_t Multiplexer\n+::get_n_bytes() const\n+{\n+ return this->n_bytes;\n+}\n+\n+std::type_index Multiplexer\n+::get_datatype() const\n+{\n+ return this->datatype;\n+}\n+\n+size_t Multiplexer\n+::get_n_calls() const\n+{\n+ return this->n_calls;\n+}\n+\n+}\n+}\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "include/Module/Switcher/Switcher.hpp",
"diff": "+/*!\n+ * \\file\n+ * \\brief Class module::Switcher.\n+ */\n+#ifndef SWITCHER_HPP_\n+#define SWITCHER_HPP_\n+\n+#include <cstddef>\n+#include <cstdint>\n+#include <memory>\n+#include <vector>\n+#include <typeindex>\n+\n+#include \"Module/Task.hpp\"\n+#include \"Module/Socket.hpp\"\n+#include \"Module/Module.hpp\"\n+\n+namespace aff3ct\n+{\n+namespace module\n+{\n+ namespace swi\n+ {\n+ enum class tsk : size_t { commute, SIZE };\n+ }\n+\n+class Switcher : public Module\n+{\n+public:\n+ inline Task& operator[](const swi::tsk t);\n+\n+protected:\n+ const size_t n_data_sockets;\n+ const size_t n_elmts;\n+ const size_t n_bytes;\n+ const std::type_index datatype;\n+\n+public:\n+ inline Switcher(const size_t n_data_sockets,\n+ const size_t n_elmts,\n+ const std::type_index datatype);\n+ virtual ~Switcher() = default;\n+\n+ inline size_t get_n_data_sockets() const;\n+ inline size_t get_n_elmts () const;\n+ inline size_t get_n_bytes () const;\n+ inline std::type_index get_datatype () const;\n+ inline size_t get_n_calls () const;\n+};\n+}\n+}\n+\n+#ifndef DOXYGEN_SHOULD_SKIP_THIS\n+#include \"Module/Switcher/Switcher.hxx\"\n+#endif\n+\n+#endif /* SWITCHER_HPP_ */\n"
},
{
"change_type": "ADD",
"old_path": null,
"new_path": "include/Module/Switcher/Switcher.hxx",
"diff": "+#include <string>\n+#include <sstream>\n+#include <algorithm>\n+\n+#include \"Tools/general_utils.h\"\n+#include \"Tools/Exception/exception.hpp\"\n+#include \"Module/Switcher/Switcher.hpp\"\n+\n+namespace aff3ct\n+{\n+namespace module\n+{\n+\n+Task& Switcher\n+::operator[](const swi::tsk t)\n+{\n+ return Module::operator[]((size_t)t);\n+}\n+\n+Switcher\n+::Switcher(const size_t n_data_sockets,\n+ const size_t n_elmts,\n+ const std::type_index datatype)\n+: Module(),\n+ n_data_sockets(n_data_sockets),\n+ n_elmts(n_elmts),\n+ n_bytes(tools::compute_bytes(n_elmts, datatype)),\n+ datatype(datatype)\n+{\n+ const std::string name = \"Switcher\";\n+ this->set_name(name);\n+ this->set_short_name(name);\n+ this->set_single_wave(true);\n+\n+ if (n_data_sockets == 0)\n+ {\n+ std::stringstream message;\n+ message << \"'n_data_sockets' has to be greater than 0 ('n_data_sockets' = \" << n_data_sockets << \").\";\n+ throw tools::invalid_argument(__FILE__, __LINE__, __func__, message.str());\n+ }\n+\n+ if (n_elmts == 0)\n+ {\n+ std::stringstream message;\n+ message << \"'n_elmts' has to be greater than 0 ('n_elmts' = \" << n_elmts << \").\";\n+ throw tools::invalid_argument(__FILE__, __LINE__, __func__, message.str());\n+ }\n+\n+ auto &p = this->create_task(\"commute\");\n+ const auto ps_in_ctrl = this->create_socket_in(p, \"in_ctrl\", 1, typeid(int8_t));\n+ const auto ps_in_data = this->create_socket_in(p, \"in_data\", n_elmts, datatype);\n+\n+ std::vector<size_t> ps_out_data;\n+ for (size_t s = 0; s < this->n_data_sockets; s++)\n+ ps_out_data.push_back(this->create_socket_in(p, \"out_data\" + std::to_string(s), n_elmts, datatype));\n+\n+ this->create_codelet(p, [ps_in_ctrl, ps_in_data, ps_out_data](Module &m, Task &t, const size_t frame_id) -> int\n+ {\n+ auto &swi = static_cast<Switcher&>(m);\n+\n+ const auto ctrl_socket_in = static_cast<const int8_t*>(t[ps_in_ctrl ].get_dataptr());\n+ const size_t ctrl = (size_t)ctrl_socket_in[0] % swi->get_n_data_sockets();\n+ const auto data_socket_in = static_cast<const int8_t*>(t[ps_in_data ].get_dataptr());\n+ auto data_socket_out = static_cast< int8_t*>(t[ps_out_data[ctrl]].get_dataptr());\n+\n+ std::copy(data_socket_in,\n+ data_socket_in + swi->get_n_frames() * swi->get_n_bytes(),\n+ data_socket_out);\n+\n+ return status_t::SUCCESS;\n+ });\n+}\n+\n+size_t Switcher\n+::get_n_data_sockets() const\n+{\n+ return this->n_data_sockets;\n+}\n+\n+size_t Switcher\n+::get_n_elmts() const\n+{\n+ return this->n_elmts;\n+}\n+\n+size_t Switcher\n+::get_n_bytes() const\n+{\n+ return this->n_bytes;\n+}\n+\n+std::type_index Switcher\n+::get_datatype() const\n+{\n+ return this->datatype;\n+}\n+\n+size_t Switcher\n+::get_n_calls() const\n+{\n+ return this->n_calls;\n+}\n+\n+}\n+}\n"
},
{
"change_type": "MODIFY",
"old_path": "include/Tools/general_utils.h",
"new_path": "include/Tools/general_utils.h",
"diff": "#include <vector>\n#include <string>\n#include <iostream>\n+#include <typeindex>\n#include <memory>\nnamespace aff3ct\n@@ -106,6 +107,9 @@ std::vector<T*> convert_to_ptr(const std::vector<std::shared_ptr<T>> &v);\ntemplate <typename T>\nvoid check_LUT(const std::vector<T> &LUT, const std::string &LUT_name = \"LUT\", const size_t LUT_size = 0);\n+size_t compute_bytes(const size_t n_elmts, const std::type_index type);\n+\n+std::vector<size_t> compute_bytes(const std::vector<size_t> &n_elmts, const std::vector<std::type_index> &type);\n}\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "include/aff3ct.hpp",
"new_path": "include/aff3ct.hpp",
"diff": "#ifndef MONITOR_HPP_\n#include <Module/Monitor/Monitor.hpp>\n#endif\n+#ifndef MULTIPLEXER_HPP_\n+#include <Module/Multiplexer/Multiplexer.hpp>\n+#endif\n#ifndef PROBE_LATENCY_HPP_\n#include <Module/Probe/Latency/Probe_latency.hpp>\n#endif\n#ifndef SUBSEQUENCE_HPP_\n#include <Module/Subsequence/Subsequence.hpp>\n#endif\n+#ifndef SWITCHER_HPP_\n+#include <Module/Switcher/Switcher.hpp>\n+#endif\n#ifndef TASK_HPP_\n#include <Module/Task.hpp>\n#endif\n"
},
{
"change_type": "MODIFY",
"old_path": "src/Module/Adaptor/Adaptor.cpp",
"new_path": "src/Module/Adaptor/Adaptor.cpp",
"diff": "@@ -61,40 +61,6 @@ void Adaptor\nthis->waiting_canceled.reset(new std::atomic<bool>(m.waiting_canceled->load()));\n}\n-size_t Adaptor\n-::compute_bytes(const size_t n_elmts, const std::type_index type)\n-{\n- if (type == typeid(int8_t )) return n_elmts * sizeof(int8_t );\n- else if (type == typeid(int16_t)) return n_elmts * sizeof(int16_t);\n- else if (type == typeid(int32_t)) return n_elmts * sizeof(int32_t);\n- else if (type == typeid(int64_t)) return n_elmts * sizeof(int64_t);\n- else if (type == typeid(float )) return n_elmts * sizeof(float );\n- else if (type == typeid(double )) return n_elmts * sizeof(double );\n- else\n- {\n- std::stringstream message;\n- message << \"This should never happen.\";\n- throw tools::runtime_error(__FILE__, __LINE__, __func__, message.str());\n- }\n-}\n-\n-std::vector<size_t> Adaptor\n-::compute_bytes(const std::vector<size_t> &n_elmts, const std::vector<std::type_index> &type)\n-{\n- if (n_elmts.size() != type.size())\n- {\n- std::stringstream message;\n- message << \"'n_elmts.size()' has to be equal to 'type.size()' ('n_elmts.size()' = \" << n_elmts.size()\n- << \", 'type.size()' = \" << type.size() << \").\";\n- throw tools::invalid_argument(__FILE__, __LINE__, __func__, message.str());\n- }\n-\n- std::vector<size_t> bytes(n_elmts.size());\n- for (size_t i = 0; i < n_elmts.size(); i++)\n- bytes[i] = Adaptor::compute_bytes(n_elmts[i], type[i]);\n- return bytes;\n-}\n-\nvoid Adaptor\n::send_cancel_signal()\n{\n"
},
{
"change_type": "MODIFY",
"old_path": "src/Module/Module.cpp",
"new_path": "src/Module/Module.cpp",
"diff": "@@ -185,6 +185,40 @@ void Module\ntask.create_codelet(codelet);\n}\n+size_t Module\n+::create_socket_in(Task& task, const std::string &name, const size_t n_elmts, const std::type_index& datatype)\n+{\n+ if (datatype == typeid(int8_t )) return this->template create_socket_in<int8_t >(task, name, n_elmts);\n+ else if (datatype == typeid(int16_t)) return this->template create_socket_in<int16_t>(task, name, n_elmts);\n+ else if (datatype == typeid(int32_t)) return this->template create_socket_in<int32_t>(task, name, n_elmts);\n+ else if (datatype == typeid(int64_t)) return this->template create_socket_in<int64_t>(task, name, n_elmts);\n+ else if (datatype == typeid(float )) return this->template create_socket_in<float >(task, name, n_elmts);\n+ else if (datatype == typeid(double )) return this->template create_socket_in<double >(task, name, n_elmts);\n+ else\n+ {\n+ std::stringstream message;\n+ message << \"This should never happen.\";\n+ throw tools::runtime_error(__FILE__, __LINE__, __func__, message.str());\n+ }\n+}\n+\n+size_t Module\n+::create_socket_out(Task& task, const std::string &name, const size_t n_elmts, const std::type_index& datatype)\n+{\n+ if (datatype == typeid(int8_t )) return this->template create_socket_out<int8_t >(task, name, n_elmts);\n+ else if (datatype == typeid(int16_t)) return this->template create_socket_out<int16_t>(task, name, n_elmts);\n+ else if (datatype == typeid(int32_t)) return this->template create_socket_out<int32_t>(task, name, n_elmts);\n+ else if (datatype == typeid(int64_t)) return this->template create_socket_out<int64_t>(task, name, n_elmts);\n+ else if (datatype == typeid(float )) return this->template create_socket_out<float >(task, name, n_elmts);\n+ else if (datatype == typeid(double )) return this->template create_socket_out<double >(task, name, n_elmts);\n+ else\n+ {\n+ std::stringstream message;\n+ message << \"This should never happen.\";\n+ throw tools::runtime_error(__FILE__, __LINE__, __func__, message.str());\n+ }\n+}\n+\nvoid Module\n::register_timer(Task& task, const std::string &key)\n{\n"
},
{
"change_type": "MODIFY",
"old_path": "src/Tools/general_utils.cpp",
"new_path": "src/Tools/general_utils.cpp",
"diff": "@@ -203,6 +203,39 @@ void aff3ct::tools::check_LUT(const std::vector<T> &LUT, const std::string &LUT_\n}\n}\n+size_t aff3ct::tools::compute_bytes(const size_t n_elmts, const std::type_index type)\n+{\n+ if (type == typeid(int8_t )) return n_elmts * sizeof(int8_t );\n+ else if (type == typeid(int16_t)) return n_elmts * sizeof(int16_t);\n+ else if (type == typeid(int32_t)) return n_elmts * sizeof(int32_t);\n+ else if (type == typeid(int64_t)) return n_elmts * sizeof(int64_t);\n+ else if (type == typeid(float )) return n_elmts * sizeof(float );\n+ else if (type == typeid(double )) return n_elmts * sizeof(double );\n+ else\n+ {\n+ std::stringstream message;\n+ message << \"This should never happen.\";\n+ throw tools::runtime_error(__FILE__, __LINE__, __func__, message.str());\n+ }\n+}\n+\n+std::vector<size_t> aff3ct::tools::compute_bytes(const std::vector<size_t> &n_elmts,\n+ const std::vector<std::type_index> &type)\n+{\n+ if (n_elmts.size() != type.size())\n+ {\n+ std::stringstream message;\n+ message << \"'n_elmts.size()' has to be equal to 'type.size()' ('n_elmts.size()' = \" << n_elmts.size()\n+ << \", 'type.size()' = \" << type.size() << \").\";\n+ throw tools::invalid_argument(__FILE__, __LINE__, __func__, message.str());\n+ }\n+\n+ std::vector<size_t> bytes(n_elmts.size());\n+ for (size_t i = 0; i < n_elmts.size(); i++)\n+ bytes[i] = aff3ct::tools::compute_bytes(n_elmts[i], type[i]);\n+ return bytes;\n+}\n+\n// ==================================================================================== explicit template instantiation\ntemplate float aff3ct::tools::sigma_to_esn0<float >(const float, const int);\ntemplate double aff3ct::tools::sigma_to_esn0<double>(const double, const int);\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
Create "module::Switch" and "module::Multiplexer" + code factorization.
|
8,490 |
05.04.2021 11:15:41
| -7,200 |
27ca6ddf90bdbb9645f389f007d3a37cd6ffc0c1
|
Add 0 copy mode in 'module::Switcher' when executing 'tools::Sequence'.
|
[
{
"change_type": "MODIFY",
"old_path": "include/Module/Switcher/Switcher.hpp",
"new_path": "include/Module/Switcher/Switcher.hpp",
"diff": "#include \"Module/Task.hpp\"\n#include \"Module/Socket.hpp\"\n#include \"Module/Module.hpp\"\n+#include \"Tools/Sequence/Sequence.hpp\"\nnamespace aff3ct\n{\n@@ -26,6 +27,8 @@ namespace module\nclass Switcher : public Module\n{\n+friend tools::Sequence; // Sequence is friend to enable the no copy mode (0 copy)\n+\npublic:\ninline Task& operator[](const swi::tsk t);\ninline const Task& operator[](const swi::tsk t) const;\n@@ -37,6 +40,9 @@ protected:\nconst std::type_index datatype;\nsize_t path;\n+ bool no_copy_commute;\n+ bool no_copy_select;\n+\npublic:\ninline Switcher(const size_t n_data_sockets,\nconst size_t n_elmts,\n@@ -51,8 +57,14 @@ public:\ninline std::type_index get_datatype () const;\ninline size_t get_path () const;\n+ inline bool is_no_copy_commute() const;\n+ inline bool is_no_copy_select () const;\n+\nprotected:\ninline void set_path(const size_t path);\n+ inline void set_no_copy_commute(const bool no_copy_commute);\n+ inline void set_no_copy_select (const bool no_copy_select );\n+\n};\n}\n}\n"
},
{
"change_type": "MODIFY",
"old_path": "include/Module/Switcher/Switcher.hxx",
"new_path": "include/Module/Switcher/Switcher.hxx",
"diff": "@@ -32,7 +32,9 @@ Switcher\nn_elmts(n_elmts),\nn_bytes(tools::compute_bytes(n_elmts, datatype)),\ndatatype(datatype),\n- path(n_data_sockets -1)\n+ path(n_data_sockets -1),\n+ no_copy_commute(false),\n+ no_copy_select (false)\n{\nconst std::string name = \"Switcher\";\nthis->set_name(name);\n@@ -69,12 +71,15 @@ Switcher\nswi.set_path((size_t)ctrl_socket_in[0]);\nconst size_t path = swi.get_path();\n+ if (!swi.is_no_copy_commute())\n+ {\nconst auto data_socket_in = static_cast<const int8_t*>(t[p1s_in_data ].get_dataptr());\nauto data_socket_out = static_cast< int8_t*>(t[p1s_out_data[path]].get_dataptr());\nstd::copy(data_socket_in,\ndata_socket_in + swi.get_n_frames() * swi.get_n_bytes(),\ndata_socket_out);\n+ }\nreturn (int)path;\n});\n@@ -88,6 +93,9 @@ Switcher\nthis->create_codelet(p2, [p2s_in_data, p2s_out_data](Module &m, Task &t, const size_t frame_id) -> int\n{\nauto &swi = static_cast<Switcher&>(m);\n+\n+ if (!swi.is_no_copy_select())\n+ {\nconst size_t path = swi.get_path();\nconst auto data_socket_in = static_cast<const int8_t*>(t[p2s_in_data[path]].get_dataptr());\n@@ -96,11 +104,36 @@ Switcher\nstd::copy(data_socket_in,\ndata_socket_in + swi.get_n_frames() * swi.get_n_bytes(),\ndata_socket_out);\n+ }\nreturn status_t::SUCCESS;\n});\n}\n+void Switcher\n+::set_no_copy_commute(const bool no_copy_commute)\n+{\n+ this->no_copy_commute = no_copy_commute;\n+}\n+\n+void Switcher\n+::set_no_copy_select(const bool no_copy_select)\n+{\n+ this->no_copy_select = no_copy_select;\n+}\n+\n+bool Switcher\n+::is_no_copy_commute() const\n+{\n+ return this->no_copy_commute;\n+}\n+\n+bool Switcher\n+::is_no_copy_select () const\n+{\n+ return this->no_copy_select;\n+}\n+\nsize_t Switcher\n::get_n_data_sockets() const\n{\n"
},
{
"change_type": "MODIFY",
"old_path": "src/Module/Incrementer/Incrementer.cpp",
"new_path": "src/Module/Incrementer/Incrementer.cpp",
"diff": "@@ -78,7 +78,6 @@ template <typename T>\nvoid Incrementer<T>\n::_increment(const T *in, T *out, const size_t frame_id)\n{\n- // std::cout << \"[\" << this->get_custom_name() << \"] - start\" << std::endl;\nstd::chrono::time_point<std::chrono::steady_clock> t_start;\nif (this->ns)\nt_start = std::chrono::steady_clock::now();\n@@ -92,7 +91,6 @@ void Incrementer<T>\nwhile ((size_t)duration.count() < this->ns) // active waiting\nduration = std::chrono::steady_clock::now() - t_start;\n}\n- // std::cout << \"[\" << this->get_custom_name() << \"] - stop\" << std::endl;\n}\n// ==================================================================================== explicit template instantiation\n"
},
{
"change_type": "MODIFY",
"old_path": "src/Tools/Sequence/Sequence.cpp",
"new_path": "src/Tools/Sequence/Sequence.cpp",
"diff": "@@ -1466,6 +1466,94 @@ void Sequence\ncontents->rebind_dataptrs.clear();\nfor (auto task : contents->tasks)\n{\n+ if (dynamic_cast<module::Switcher*>(&task->get_module()) &&\n+ task->get_name().find(\"select\") != std::string::npos && no_copy_mode)\n+ {\n+ auto select_task = task;\n+ auto switcher = dynamic_cast<module::Switcher*>(&select_task->get_module());\n+ switcher->set_no_copy_select(true);\n+\n+ const auto rebind_id = contents->rebind_sockets.size();\n+ contents->rebind_sockets.resize(rebind_id +1);\n+ contents->rebind_dataptrs.resize(rebind_id +1);\n+\n+ for (size_t s = 0; s < select_task->sockets.size() -1; s++)\n+ {\n+ if (select_task->get_socket_type(*select_task->sockets[s]) == module::socket_t::SOUT)\n+ {\n+ std::vector<module::Socket*> bound_sockets;\n+ std::vector<void*> dataptrs;\n+\n+ auto bs = select_task->sockets[s]->get_bound_sockets();\n+ bound_sockets.insert(bound_sockets.end(), bs.begin(), bs.end());\n+ for (auto sck : bs)\n+ dataptrs.push_back(sck->get_dataptr());\n+\n+ contents->rebind_sockets[rebind_id].push_back(bound_sockets);\n+ contents->rebind_dataptrs[rebind_id].push_back(dataptrs);\n+ }\n+ }\n+\n+ modified_tasks[select_task] = [contents, select_task, switcher, rebind_id]() -> const int*\n+ {\n+ select_task->exec();\n+ const int* status = (int*)select_task->sockets.back()->get_dataptr();\n+\n+ const auto path = switcher->get_path();\n+ const auto in_dataptr = select_task->sockets[path]->get_dataptr();\n+\n+ // rebind input sockets on the fly\n+ for (size_t sout_id = 0; sout_id < contents->rebind_sockets[rebind_id].size(); sout_id++)\n+ for (size_t sin_id = 0; sin_id < contents->rebind_sockets[rebind_id][sout_id].size(); sin_id++)\n+ contents->rebind_sockets[rebind_id][sout_id][sin_id]->dataptr = in_dataptr;\n+\n+ return status;\n+ };\n+ }\n+\n+ if (dynamic_cast<module::Switcher*>(&task->get_module()) &&\n+ task->get_name().find(\"commute\") != std::string::npos && no_copy_mode)\n+ {\n+ auto commute_task = task;\n+ auto switcher = dynamic_cast<module::Switcher*>(&commute_task->get_module());\n+ switcher->set_no_copy_commute(true);\n+\n+ const auto rebind_id = contents->rebind_sockets.size();\n+ contents->rebind_sockets.resize(rebind_id +1);\n+ contents->rebind_dataptrs.resize(rebind_id +1);\n+\n+ for (size_t s = 0; s < commute_task->sockets.size() -1; s++)\n+ {\n+ if (commute_task->get_socket_type(*commute_task->sockets[s]) == module::socket_t::SOUT)\n+ {\n+ std::vector<module::Socket*> bound_sockets;\n+ std::vector<void*> dataptrs;\n+\n+ auto bs = commute_task->sockets[s]->get_bound_sockets();\n+ bound_sockets.insert(bound_sockets.end(), bs.begin(), bs.end());\n+ for (auto sck : bs)\n+ dataptrs.push_back(sck->get_dataptr());\n+\n+ contents->rebind_sockets[rebind_id].push_back(bound_sockets);\n+ contents->rebind_dataptrs[rebind_id].push_back(dataptrs);\n+ }\n+ }\n+\n+ modified_tasks[commute_task] = [contents, commute_task, switcher, rebind_id]() -> const int*\n+ {\n+ commute_task->exec();\n+ const int* status = (int*)commute_task->sockets.back()->get_dataptr();\n+ const auto in_dataptr = commute_task->sockets[0]->get_dataptr();\n+\n+ // rebind input sockets on the fly\n+ for (size_t sout_id = 0; sout_id < contents->rebind_sockets[rebind_id].size(); sout_id++)\n+ for (size_t sin_id = 0; sin_id < contents->rebind_sockets[rebind_id][sout_id].size(); sin_id++)\n+ contents->rebind_sockets[rebind_id][sout_id][sin_id]->dataptr = in_dataptr;\n+\n+ return status;\n+ };\n+ }\n+\nif (dynamic_cast<module::Adaptor*>(&task->get_module()) &&\ntask->get_name().find(\"pull\") != std::string::npos && no_copy_mode)\n{\n@@ -1629,6 +1717,22 @@ void Sequence\nauto contents = cur_node->get_c();\nfor (auto task : contents->tasks)\n{\n+ if (dynamic_cast<module::Switcher*>(&task->get_module()) &&\n+ task->get_name().find(\"select\") != std::string::npos)\n+ {\n+ auto select_task = task;\n+ auto switcher = dynamic_cast<module::Switcher*>(&select_task->get_module());\n+ switcher->set_no_copy_select(false);\n+ }\n+\n+ if (dynamic_cast<module::Switcher*>(&task->get_module()) &&\n+ task->get_name().find(\"commute\") != std::string::npos)\n+ {\n+ auto commute_task = task;\n+ auto switcher = dynamic_cast<module::Switcher*>(&commute_task->get_module());\n+ switcher->set_no_copy_commute(false);\n+ }\n+\nif (dynamic_cast<module::Adaptor*>(&task->get_module()) &&\ntask->get_name().find(\"pull\") != std::string::npos)\n{\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
Add 0 copy mode in 'module::Switcher' when executing 'tools::Sequence'.
|
8,490 |
05.04.2021 11:58:59
| -7,200 |
92b89b7f12e9a628a6157f7df2f350e2dd764d10
|
Optimize the commute task "on the fly" binding.
|
[
{
"change_type": "MODIFY",
"old_path": "src/Tools/Sequence/Sequence.cpp",
"new_path": "src/Tools/Sequence/Sequence.cpp",
"diff": "@@ -1479,6 +1479,7 @@ void Sequence\nfor (size_t s = 0; s < select_task->sockets.size() -1; s++)\n{\n+ // there should be only one output socket at this time\nif (select_task->get_socket_type(*select_task->sockets[s]) == module::socket_t::SOUT)\n{\nstd::vector<module::Socket*> bound_sockets;\n@@ -1503,6 +1504,7 @@ void Sequence\nconst auto in_dataptr = select_task->sockets[path]->get_dataptr();\n// rebind input sockets on the fly\n+ // there should be only one output socket at this time (sout_id == 0)\nfor (size_t sout_id = 0; sout_id < contents->rebind_sockets[rebind_id].size(); sout_id++)\nfor (size_t sin_id = 0; sin_id < contents->rebind_sockets[rebind_id][sout_id].size(); sin_id++)\ncontents->rebind_sockets[rebind_id][sout_id][sin_id]->dataptr = in_dataptr;\n@@ -1544,11 +1546,11 @@ void Sequence\ncommute_task->exec();\nconst int* status = (int*)commute_task->sockets.back()->get_dataptr();\nconst auto in_dataptr = commute_task->sockets[0]->get_dataptr();\n+ const auto path = switcher->get_path();\n// rebind input sockets on the fly\n- for (size_t sout_id = 0; sout_id < contents->rebind_sockets[rebind_id].size(); sout_id++)\n- for (size_t sin_id = 0; sin_id < contents->rebind_sockets[rebind_id][sout_id].size(); sin_id++)\n- contents->rebind_sockets[rebind_id][sout_id][sin_id]->dataptr = in_dataptr;\n+ for (size_t sin_id = 0; sin_id < contents->rebind_sockets[rebind_id][path].size(); sin_id++)\n+ contents->rebind_sockets[rebind_id][path][sin_id]->dataptr = in_dataptr;\nreturn status;\n};\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
Optimize the commute task "on the fly" binding.
|
8,490 |
09.04.2021 17:21:13
| -7,200 |
f70d42e21fffcc86512fd81e73f1e0b02262ad31
|
Improve 'tools::Sequence'.
|
[
{
"change_type": "MODIFY",
"old_path": "include/Tools/Sequence/Sequence.hxx",
"new_path": "include/Tools/Sequence/Sequence.hxx",
"diff": "@@ -120,13 +120,16 @@ inline void Sequence\nauto node_contents = node->get_c();\nif (node->get_fathers ().size() == 1 &&\n- node->get_children().size() <= 1 &&\n+ node->get_children().size() == 1 &&\nnode_contents->tasks.size() == 0)\n{\n- auto father = node->get_fathers()[0];\n+ auto father = node->get_fathers ().size() ? node->get_fathers ()[0] : nullptr;\nauto child = node->get_children().size() ? node->get_children()[0] : nullptr;\n- auto child_pos = node->get_child_pos(*father);\n+ auto child_pos = -1;\n+ if (father != nullptr)\n+ {\n+ child_pos = node->get_child_pos(*father);\nif (child_pos == -1)\n{\nstd::stringstream message;\n@@ -140,6 +143,7 @@ inline void Sequence\nmessage << \"'father->cut_child(child_pos)' should return true ('child_pos' = \" << child_pos << \").\";\nthrow tools::runtime_error(__FILE__, __LINE__, __func__, message.str());\n}\n+ }\nauto father_pos = -1;\nif (child != nullptr)\n@@ -161,10 +165,13 @@ inline void Sequence\n}\n}\n+ if (node == root)\n+ root = child;\n+\ndelete node_contents;\ndelete node;\n- if (child != nullptr)\n+ if (child != nullptr && father != nullptr)\n{\nfather->add_child (child, child_pos );\nchild ->add_father(father, father_pos);\n"
},
{
"change_type": "MODIFY",
"old_path": "src/Tools/Sequence/Sequence.cpp",
"new_path": "src/Tools/Sequence/Sequence.cpp",
"diff": "@@ -448,6 +448,7 @@ void Sequence\n{\nstatuses[tasks_id[0]] = processes[0]();\nconst int path = statuses[tasks_id[0]][0];\n+ if (cur_ss->get_children().size() > (size_t)path)\nexec_sequence(cur_ss->get_children()[path], statuses);\n}\nelse\n@@ -524,6 +525,7 @@ void Sequence\nif (type == subseq_t::COMMUTE)\n{\nconst int path = processes[0]()[0];\n+ if (cur_ss->get_children().size() > (size_t)path)\nexec_sequence(cur_ss->get_children()[path]);\n}\nelse\n@@ -692,6 +694,7 @@ void Sequence\nif (type == subseq_t::COMMUTE)\n{\nconst int path = tasks[0]->exec(frame_id)[0];\n+ if (cur_ss->get_children().size() > (size_t)path)\nexec_sequence(cur_ss->get_children()[path]);\n}\nelse\n@@ -744,6 +747,12 @@ Digraph_node<SS>* Sequence\nreal_lasts_id.erase(real_lasts_id.begin() + dist);\n}\n+ if (cur_subseq->get_contents() == nullptr)\n+ {\n+ cur_subseq->set_contents(new SS());\n+ cur_subseq->get_c()->id = ssid++;\n+ }\n+\nbool is_last = true;\nDigraph_node<SS>* last_subseq = nullptr;\n@@ -921,11 +930,6 @@ Digraph_node<SS>* Sequence\n}\nelse\n{\n- if (cur_subseq->get_contents() == nullptr)\n- {\n- cur_subseq->set_contents(new SS());\n- cur_subseq->get_c()->id = ssid++;\n- }\ncur_subseq->get_c()->tasks.push_back(¤t_task);\ncur_subseq->get_c()->tasks_id.push_back(taid++);\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
Improve 'tools::Sequence'.
|
8,490 |
15.04.2021 11:39:09
| -7,200 |
50106bc0155a3de34f8032b11382efa3c5788be6
|
Rm useless files.
|
[
{
"change_type": "DELETE",
"old_path": "Simulation_BFER_ite.cpp",
"new_path": null,
"diff": "-#include <functional>\n-#include <algorithm>\n-#include <iostream>\n-#include <vector>\n-#include <random>\n-#include <string>\n-\n-#include \"Tools/Algo/Predicate_ite.hpp\"\n-#include \"Tools/Sequence/Sequence.hpp\"\n-#include \"Tools/Display/rang_format/rang_format.h\"\n-#include \"Tools/Interface/Interface_set_seed.hpp\"\n-#include \"Tools/Interface/Interface_get_set_noise.hpp\"\n-#include \"Tools/Interface/Interface_notify_noise_update.hpp\"\n-#include \"Tools/Interface/Interface_get_set_frozen_bits.hpp\"\n-#include \"Tools/Display/Dumper/Dumper.hpp\"\n-#include \"Tools/Exception/exception.hpp\"\n-#include \"Factory/Module/Coset/Coset.hpp\"\n-#include \"Factory/Tools/Codec/Codec.hpp\"\n-#include \"Factory/Tools/Codec/Codec_SIHO.hpp\"\n-#include \"Simulation/BFER/Iterative/Simulation_BFER_ite.hpp\"\n-\n-using namespace aff3ct;\n-using namespace aff3ct::simulation;\n-\n-template <typename B, typename R, typename Q>\n-Simulation_BFER_ite<B,R,Q>\n-::Simulation_BFER_ite(const factory::BFER_ite ¶ms_BFER_ite)\n-: Simulation_BFER<B,R>(params_BFER_ite),\n- params_BFER_ite(params_BFER_ite)\n-{\n- if (this->params_BFER_ite.err_track_revert && this->params_BFER_ite.n_threads != 1)\n- std::clog << rang::tag::warning << \"Multi-threading detected with error tracking revert feature! \"\n- \"Each thread will play the same frames. Please run with one thread.\"\n- << std::endl;\n-}\n-\n-template <typename B, typename R, typename Q>\n-std::unique_ptr<module::Source<B>> Simulation_BFER_ite<B,R,Q>\n-::build_source()\n-{\n- auto src = std::unique_ptr<module::Source<B>>(params_BFER_ite.src->build<B>());\n- src->set_n_frames(this->params.n_frames);\n- return src;\n-}\n-\n-template <typename B, typename R, typename Q>\n-std::unique_ptr<tools::Codec_SISO<B,Q>> Simulation_BFER_ite<B,R,Q>\n-::build_codec()\n-{\n- std::unique_ptr<factory::Codec> params_cdc(params_BFER_ite.cdc->clone());\n- auto param_siso_siho = dynamic_cast<factory::Codec_SISO*>(params_cdc.get());\n- auto cdc = std::unique_ptr<tools::Codec_SISO<B,Q>>(param_siso_siho->template build<B,Q>());\n- cdc->set_n_frames(this->params.n_frames);\n- return cdc;\n-}\n-\n-template <typename B, typename R, typename Q>\n-std::unique_ptr<tools ::Interleaver_core<>> Simulation_BFER_ite<B,R,Q>\n-::build_interleaver()\n-{\n- std::unique_ptr<factory::Interleaver> params_itl(params_BFER_ite.itl->clone());\n- auto itl = std::unique_ptr<tools::Interleaver_core<>>(params_itl->core->build<>());\n- itl->set_n_frames(this->params.n_frames);\n- return itl;\n-}\n-\n-template <typename B, typename R, typename Q>\n-std::unique_ptr<module::Modem<B,R,Q>> Simulation_BFER_ite<B,R,Q>\n-::build_modem(const tools::Distributions<R> *distributions, const tools::Constellation<R> *constellation)\n-{\n- if (distributions != nullptr)\n- {\n- auto mdm = std::unique_ptr<module::Modem<B,R,Q>>(params_BFER_ite.mdm->build<B,R,Q>(*distributions));\n- mdm->set_n_frames(this->params.n_frames);\n- return mdm;\n- }\n- else\n- {\n- auto mdm = std::unique_ptr<module::Modem<B,R,Q>>(params_BFER_ite.mdm->build<B,R,Q>(constellation));\n- mdm->set_n_frames(this->params.n_frames);\n- return mdm;\n- }\n-}\n-\n-template <typename B, typename R, typename Q>\n-std::unique_ptr<module::Channel<R>> Simulation_BFER_ite<B,R,Q>\n-::build_channel(const tools::Distributions<R> *distributions)\n-{\n- if (distributions != nullptr)\n- {\n- auto chn = std::unique_ptr<module::Channel<R>>(params_BFER_ite.chn->build<R>(*distributions));\n- chn->set_n_frames(this->params.n_frames);\n- return chn;\n- }\n- else\n- {\n- auto chn = std::unique_ptr<module::Channel<R>>(params_BFER_ite.chn->build<R>());\n- chn->set_n_frames(this->params.n_frames);\n- return chn;\n- }\n-}\n-\n-template <typename B, typename R, typename Q>\n-std::unique_ptr<module::Quantizer<R,Q>> Simulation_BFER_ite<B,R,Q>\n-::build_quantizer()\n-{\n- auto qnt = std::unique_ptr<module::Quantizer<R,Q>>(params_BFER_ite.qnt->build<R,Q>());\n- qnt->set_n_frames(this->params.n_frames);\n- return qnt;\n-}\n-\n-template <typename B, typename R, typename Q>\n-std::unique_ptr<module::Coset<B,Q>> Simulation_BFER_ite<B,R,Q>\n-::build_coset_real()\n-{\n- factory::Coset cst_params;\n- cst_params.size = params_BFER_ite.cdc->N_cw;\n- auto cst = std::unique_ptr<module::Coset<B,Q>>(cst_params.build_real<B,Q>());\n- cst->set_n_frames(this->params.n_frames);\n- return cst;\n-}\n-\n-template <typename B, typename R, typename Q>\n-std::unique_ptr<module::Coset<B,B>> Simulation_BFER_ite<B,R,Q>\n-::build_coset_bit()\n-{\n- factory::Coset cst_params;\n- cst_params.size = params_BFER_ite.coded_monitoring ? params_BFER_ite.cdc->N_cw : params_BFER_ite.cdc->K;\n- auto cst = std::unique_ptr<module::Coset<B,B>>(cst_params.build_bit<B,B>());\n- cst->set_n_frames(this->params.n_frames);\n- return cst;\n-}\n-\n-template <typename B, typename R, typename Q>\n-std::unique_ptr<module::Switcher> Simulation_BFER_ite<B,R,Q>\n-::build_switcher()\n-{\n- auto switcher = std::unique_ptr<module::Switcher>(\n- new module::Switcher(2, params_BFER_ite.cdc->N_cw, typeid(Q)));\n- switcher->set_n_frames(this->params.n_frames);\n- return switcher;\n-}\n-\n-template <typename B, typename R, typename Q>\n-std::unique_ptr<module::Iterator> Simulation_BFER_ite<B,R,Q>\n-::build_iterator()\n-{\n- auto iterator = std::unique_ptr<module::Iterator>(new module::Iterator(params_BFER_ite.n_ite));\n- iterator->set_n_frames(this->params.n_frames);\n- return iterator;\n-}\n-\n-template <typename B, typename R, typename Q>\n-void Simulation_BFER_ite<B,R,Q>\n-::create_modules()\n-{\n- Simulation_BFER<B,R>::create_modules();\n-\n- this->source = build_source ( );\n- this->codec = build_codec ( );\n- this->modem1 = build_modem (this->distributions.get(), this->constellation.get());\n- this->modem2 = build_modem (this->distributions.get(), this->constellation.get());\n- this->channel = build_channel (this->distributions.get() );\n- this->quantizer = build_quantizer ( );\n- this->coset_real1 = build_coset_real ( );\n- this->coset_real2 = build_coset_real ( );\n- this->coset_real3 = build_coset_real ( );\n- this->coset_bit = build_coset_bit ( );\n- this->interleaver_core = build_interleaver ( );\n- this->switcher = build_switcher ( );\n- this->iterator = build_iterator ( );\n-\n- this->interleaver_bit .reset(factory::Interleaver::build<B>(*this->interleaver_core));\n- this->interleaver_llr1.reset(factory::Interleaver::build<Q>(*this->interleaver_core));\n- this->interleaver_llr2.reset(factory::Interleaver::build<Q>(*this->interleaver_core));\n-}\n-\n-template <typename B, typename R, typename Q>\n-void Simulation_BFER_ite<B,R,Q>\n-::bind_sockets()\n-{\n- using namespace module;\n-\n- auto &src = *this->source;\n- auto &itb = *this->interleaver_bit;\n- auto &mdm1 = *this->modem1;\n- auto &mdm2 = *this->modem2;\n- auto &chn = *this->channel;\n- auto &qnt = *this->quantizer;\n- auto &itl1 = *this->interleaver_llr1;\n- auto &itl2 = *this->interleaver_llr2;\n- auto &csr1 = *this->coset_real1;\n- auto &csr2 = *this->coset_real2;\n- auto &csr3 = *this->coset_real3;\n- auto &csb = *this->coset_bit;\n- auto &mnt = *this->monitor_er;\n- auto &swi = *this->switcher;\n- auto &ite = *this->iterator;\n- auto &enc = this->codec->get_encoder();\n- auto &dcs = this->codec->get_decoder_siso();\n- auto &dch = this->codec->get_decoder_siho();\n-\n- std::vector<Module*> modules = { &src, &itb, &mdm1, &mdm2, &chn, &qnt, &itl1, &itl2, &csr1, &csr2, &csr3, &csb,\n- &mnt, &swi, &ite, &enc, &dcs, &dch };\n-\n- for (auto& mod : modules)\n- for (auto& tsk : mod->tasks)\n- tsk->set_autoalloc(true);\n-\n- if (this->params_BFER_ite.src->type == \"AZCW\")\n- {\n- auto src_data = (uint8_t*)(src[src::sck::generate ::U_K ].get_dataptr());\n- auto enc_data = (uint8_t*)(enc[enc::sck::encode ::X_N ].get_dataptr());\n- auto itl_data = (uint8_t*)(itb[itl::sck::interleave::itl ].get_dataptr());\n-\n- auto src_bytes = src[src::sck::generate ::U_K ].get_databytes();\n- auto enc_bytes = enc[enc::sck::encode ::X_N ].get_databytes();\n- auto itl_bytes = itb[itl::sck::interleave::itl ].get_databytes();\n-\n- std::fill(src_data, src_data + src_bytes, 0);\n- std::fill(enc_data, enc_data + enc_bytes, 0);\n- std::fill(itl_data, itl_data + itl_bytes, 0);\n-\n- mdm1[mdm::sck::modulate::X_N1].bind(itb[itl::sck::interleave::itl]);\n- mdm1[mdm::tsk::modulate].exec();\n- mdm1[mdm::tsk::modulate].reset();\n- }\n- else\n- {\n- if (this->params_BFER_ite.cdc->enc->type != \"NO\")\n- {\n- enc[enc::sck::encode::U_K].bind(src[src::sck::generate::U_K]);\n- }\n-\n- if (this->params_BFER_ite.cdc->enc->type != \"NO\")\n- itb[itl::sck::interleave::nat].bind(enc[enc::sck::encode::X_N]);\n- else\n- itb[itl::sck::interleave::nat].bind(src[src::sck::generate::U_K]);\n-\n- mdm1[mdm::sck::modulate::X_N1].bind(itb[itl::sck::interleave::itl]);\n- }\n-\n- if (this->params_BFER_ite.coset)\n- {\n- if (this->params_BFER_ite.coded_monitoring)\n- {\n- if (this->params_BFER_ite.cdc->enc->type != \"NO\")\n- csb[cst::sck::apply::ref].bind(enc[enc::sck::encode::X_N]);\n- else\n- csb[cst::sck::apply::ref].bind(src[src::sck::generate::U_K]);\n- }\n- else\n- {\n- csb[cst::sck::apply::ref].bind(src[src::sck::generate::U_K]);\n- }\n-\n- if (this->params_BFER_ite.cdc->enc->type != \"NO\")\n- {\n- csr1[cst::sck::apply::ref].bind(enc[enc::sck::encode::X_N]);\n- csr2[cst::sck::apply::ref].bind(enc[enc::sck::encode::X_N]);\n- csr3[cst::sck::apply::ref].bind(enc[enc::sck::encode::X_N]);\n- }\n- else\n- {\n- csr1[cst::sck::apply::ref].bind(src[src::sck::generate::U_K]);\n- csr2[cst::sck::apply::ref].bind(src[src::sck::generate::U_K]);\n- csr3[cst::sck::apply::ref].bind(src[src::sck::generate::U_K]);\n- }\n- }\n-\n- if (this->params_BFER_ite.coded_monitoring)\n- {\n- if (this->params_BFER_ite.cdc->enc->type != \"NO\")\n- mnt[mnt::sck::check_errors::U].bind(enc[enc::sck::encode::X_N]);\n- else\n- mnt[mnt::sck::check_errors::U].bind(src[src::sck::generate::U_K]);\n- }\n- else\n- mnt[mnt::sck::check_errors::U].bind(src[src::sck::generate::U_K]);\n-\n- const auto is_rayleigh = this->params_BFER_ite.chn->type.find(\"RAYLEIGH\") != std::string::npos;\n- if (is_rayleigh && this->params_BFER_ite.chn->type == \"NO\")\n- {\n- auto chn_data = (uint8_t*)(chn[chn::sck::add_noise_wg::H_N].get_dataptr());\n- auto chn_bytes = chn[chn::sck::add_noise_wg::H_N].get_databytes();\n- std::fill(chn_data, chn_data + chn_bytes, 0);\n- }\n-\n- if (this->params_BFER_ite.chn->type != \"NO\")\n- {\n- if (is_rayleigh)\n- {\n- chn[chn::sck::add_noise_wg::CP ].bind(this->channel_params);\n- chn[chn::sck::add_noise_wg::X_N].bind(mdm1[mdm::sck::modulate::X_N2]);\n- }\n- else\n- {\n- chn[chn::sck::add_noise::CP ].bind(this->channel_params);\n- chn[chn::sck::add_noise::X_N].bind(mdm1[mdm::sck::modulate::X_N2]);\n- }\n- }\n-\n- if (mdm1.is_filter())\n- {\n- mdm1[mdm::sck::filter::CP].bind(this->channel_params);\n- if (this->params_BFER_ite.chn->type != \"NO\")\n- {\n- if (is_rayleigh)\n- mdm1[mdm::sck::filter::Y_N1].bind(chn[chn::sck::add_noise_wg::Y_N]);\n- else\n- mdm1[mdm::sck::filter::Y_N1].bind(chn[chn::sck::add_noise::Y_N]);\n- }\n- else\n- mdm1[mdm::sck::filter::Y_N1].bind(mdm1[mdm::sck::modulate::X_N2]);\n- }\n-\n- if (this->params_BFER_ite.qnt->type != \"NO\")\n- {\n- if (mdm1.is_filter())\n- qnt[qnt::sck::process::Y_N1].bind(mdm1[mdm::sck::filter::Y_N2]);\n- else if (this->params_BFER_ite.chn->type != \"NO\")\n- {\n- if (is_rayleigh)\n- qnt[qnt::sck::process::Y_N1].bind(chn[chn::sck::add_noise_wg::Y_N]);\n- else\n- qnt[qnt::sck::process::Y_N1].bind(chn[chn::sck::add_noise::Y_N]);\n- }\n- else\n- qnt[qnt::sck::process::Y_N1].bind(mdm1[mdm::sck::modulate::X_N2]);\n- }\n-\n- if (mdm1.is_demodulator())\n- {\n- if (is_rayleigh)\n- {\n- mdm1[mdm::sck::demodulate_wg::CP].bind(this->channel_params);\n- if (this->params_BFER_ite.chn->type != \"NO\")\n- mdm1[mdm::sck::demodulate_wg::H_N].bind(chn[chn::sck::add_noise_wg::H_N]);\n- else\n- mdm1[mdm::sck::demodulate_wg::H_N].bind((uint8_t*)(chn[chn::sck::add_noise_wg::H_N].get_dataptr()));\n- }\n- else\n- mdm1[mdm::sck::demodulate::CP].bind(this->channel_params);\n-\n- if (this->params_BFER_ite.qnt->type != \"NO\")\n- {\n- if (is_rayleigh)\n- mdm1[mdm::sck::demodulate_wg::Y_N1].bind(qnt[qnt::sck::process::Y_N2]);\n- else\n- mdm1[mdm::sck::demodulate::Y_N1].bind(qnt[qnt::sck::process::Y_N2]);\n- }\n- else if (mdm1.is_filter())\n- {\n- if (is_rayleigh)\n- mdm1[mdm::sck::demodulate_wg::Y_N1].bind(mdm1[mdm::sck::filter::Y_N2]);\n- else\n- mdm1[mdm::sck::demodulate::Y_N1].bind(mdm1[mdm::sck::filter::Y_N2]);\n- }\n- else if (this->params_BFER_ite.chn->type != \"NO\")\n- {\n- if (is_rayleigh)\n- mdm1[mdm::sck::demodulate_wg::Y_N1].bind(chn[chn::sck::add_noise_wg::Y_N]);\n- else\n- mdm1[mdm::sck::demodulate::Y_N1].bind(chn[chn::sck::add_noise::Y_N]);\n- }\n- else\n- {\n- if (is_rayleigh)\n- mdm1[mdm::sck::demodulate_wg::Y_N1].bind(mdm1[mdm::sck::modulate::X_N2]);\n- else\n- mdm1[mdm::sck::demodulate::Y_N1].bind(mdm1[mdm::sck::modulate::X_N2]);\n- }\n- }\n-\n- if (mdm1.is_demodulator())\n- {\n- if (is_rayleigh)\n- itl1[itl::sck::deinterleave::itl].bind(mdm1[mdm::sck::demodulate_wg::Y_N2]);\n- else\n- itl1[itl::sck::deinterleave::itl].bind(mdm1[mdm::sck::demodulate::Y_N2]);\n- }\n- else if (this->params_BFER_ite.qnt->type != \"NO\")\n- itl1[itl::sck::deinterleave::itl].bind(qnt[qnt::sck::process::Y_N2]);\n- else if (mdm1.is_filter())\n- itl1[itl::sck::deinterleave::itl].bind(mdm1[mdm::sck::filter::Y_N2]);\n- else if (this->params_BFER_ite.chn->type != \"NO\")\n- {\n- if (is_rayleigh)\n- itl1[itl::sck::deinterleave::itl].bind(chn[chn::sck::add_noise_wg::Y_N]);\n- else\n- itl1[itl::sck::deinterleave::itl].bind(chn[chn::sck::add_noise::Y_N]);\n- }\n- else\n- itl1[itl::sck::deinterleave::itl].bind(mdm1[mdm::sck::modulate::X_N2]);\n-\n- // ----------------------------------------------------------------------------------------------------------------\n- // ---------------------------------------------------------------------------------------- turbo demodulation loop\n- // ----------------------------------------------------------------------------------------------------------------\n-\n- swi[swi::tsk::select ][1].bind(itl1[itl::sck::deinterleave::nat]);\n- ite[ite::tsk::iterate ].bind(swi [swi::tsk::select ][2 ]);\n- swi[swi::tsk::commute][0].bind(swi [swi::tsk::select ][2 ]);\n- swi[swi::tsk::commute][1].bind(ite [ite::sck::iterate ::out]);\n-\n- // ------------------------------------------------------------------------------------------------------- decoding\n- if (this->params_BFER_ite.coset)\n- {\n- csr1[cst::sck::apply ::in ].bind(swi [swi::tsk::commute ][2 ]);\n- dcs [dec::sck::decode_siso::Y_N1].bind(csr1[cst::sck::apply ::out ]);\n- csr2[cst::sck::apply ::in ].bind(dcs [dec::sck::decode_siso::Y_N2]);\n- }\n- else\n- {\n- dcs[dec::sck::decode_siso::Y_N1].bind(swi[swi::tsk::commute][2]);\n- }\n-\n- // --------------------------------------------------------------------------------------------------- interleaving\n- if (this->params_BFER_ite.coset)\n- itl2[itl::sck::interleave::nat].bind(csr2[cst::sck::apply::out]);\n- else\n- itl2[itl::sck::interleave::nat].bind(dcs[dec::sck::decode_siso::Y_N2]);\n-\n- // --------------------------------------------------------------------------------------------------- demodulation\n- if (mdm2.is_demodulator())\n- {\n- if (is_rayleigh)\n- {\n- mdm2[mdm::sck::tdemodulate_wg::CP].bind(this->channel_params);\n- if (this->params_BFER_ite.chn->type != \"NO\")\n- mdm2[mdm::sck::tdemodulate_wg::H_N].bind(chn[chn::sck::add_noise_wg::H_N]);\n- else\n- mdm2[mdm::sck::tdemodulate_wg::H_N].bind((uint8_t*)(chn[chn::sck::add_noise_wg::H_N].get_dataptr()));\n-\n- if (this->params_BFER_ite.qnt->type != \"NO\")\n- mdm2[mdm::sck::tdemodulate_wg::Y_N1].bind(qnt[qnt::sck::process::Y_N2]);\n- else if (mdm1.is_filter())\n- mdm2[mdm::sck::tdemodulate_wg::Y_N1].bind(mdm1[mdm::sck::filter::Y_N2]);\n- else if (this->params_BFER_ite.chn->type != \"NO\")\n- mdm2[mdm::sck::tdemodulate_wg::Y_N1].bind(chn[chn::sck::add_noise_wg::Y_N]);\n- else\n- mdm2[mdm::sck::tdemodulate_wg::Y_N1].bind(mdm1[mdm::sck::modulate::X_N2]);\n-\n- mdm2[mdm::sck::tdemodulate_wg::Y_N2].bind(itl2[itl::sck::interleave::itl]);\n- }\n- else\n- {\n- mdm2[mdm::sck::tdemodulate::CP].bind(this->channel_params);\n- if (this->params_BFER_ite.qnt->type != \"NO\")\n- mdm2[mdm::sck::tdemodulate::Y_N1].bind(qnt[qnt::sck::process::Y_N2]);\n- else if (mdm1.is_filter())\n- mdm2[mdm::sck::tdemodulate::Y_N1].bind(mdm1[mdm::sck::filter::Y_N2]);\n- else if (this->params_BFER_ite.chn->type != \"NO\")\n- mdm2[mdm::sck::tdemodulate::Y_N1].bind(chn[chn::sck::add_noise::Y_N]);\n- else\n- mdm2[mdm::sck::tdemodulate::Y_N1].bind(mdm1[mdm::sck::modulate::X_N2]);\n-\n- mdm2[mdm::sck::tdemodulate::Y_N2].bind(itl2[itl::sck::interleave::itl ]);\n- }\n- }\n-\n- // ------------------------------------------------------------------------------------------------- deinterleaving\n- if (mdm2.is_demodulator())\n- {\n- if (is_rayleigh)\n- itl2[itl::sck::deinterleave::itl].bind(mdm2[mdm::sck::tdemodulate_wg::Y_N3]);\n- else\n- itl2[itl::sck::deinterleave::itl].bind(mdm2[mdm::sck::tdemodulate::Y_N3]);\n- }\n- else if (this->params_BFER_ite.qnt->type != \"NO\")\n- itl2[itl::sck::deinterleave::itl].bind(qnt[qnt::sck::process::Y_N2]);\n- else if (mdm1.is_filter())\n- itl2[itl::sck::deinterleave::itl].bind(mdm1[mdm::sck::filter::Y_N2]);\n- else if (this->params_BFER_ite.chn->type != \"NO\")\n- {\n- if (is_rayleigh)\n- itl2[itl::sck::deinterleave::itl].bind(chn[chn::sck::add_noise_wg::Y_N]);\n- else\n- itl2[itl::sck::deinterleave::itl].bind(chn[chn::sck::add_noise::Y_N]);\n- }\n- else\n- itl2[itl::sck::deinterleave::itl].bind(mdm1[mdm::sck::modulate::X_N2]);\n-\n- swi[swi::tsk::select][0].bind(itl2[itl::sck::deinterleave::nat]);\n-\n- // ----------------------------------------------------------------------------------------------------------------\n- // --------------------------------------------------------------------------------- end of turbo demodulation loop\n- // ----------------------------------------------------------------------------------------------------------------\n-\n- if (this->params_BFER_ite.coset)\n- {\n- csr3[cst::sck::apply::in].bind(swi[swi::tsk::commute][3]);\n- if (this->params_BFER_ite.coded_monitoring)\n- {\n- dch[dec::sck::decode_siho_cw::Y_N].bind(csr3[cst::sck::apply ::out]);\n- csb[cst::sck::apply ::in ].bind(dch [dec::sck::decode_siho_cw::V_N]);\n- }\n- else\n- {\n- dch[dec::sck::decode_siho::Y_N].bind(csr3[cst::sck::apply ::out]);\n- csb[cst::sck::apply ::in ].bind(dch [dec::sck::decode_siho::V_K]);\n- }\n- }\n- else\n- {\n- if (this->params_BFER_ite.coded_monitoring)\n- dch[dec::sck::decode_siho_cw::Y_N].bind(swi[swi::tsk::commute][3]);\n- else\n- dch[dec::sck::decode_siho::Y_N].bind(swi[swi::tsk::commute][3]);\n- }\n-\n- if (this->params_BFER_ite.coded_monitoring)\n- {\n- if (this->params_BFER_ite.coset)\n- mnt[mnt::sck::check_errors::V].bind(csb[cst::sck::apply::out]);\n- else\n- mnt[mnt::sck::check_errors::V].bind(dch[dec::sck::decode_siho_cw::V_N]);\n- }\n- else\n- {\n- if (this->params_BFER_ite.coset)\n- mnt[mnt::sck::check_errors::V].bind(csb[cst::sck::apply::out]);\n- else\n- mnt[mnt::sck::check_errors::V].bind(dch[dec::sck::decode_siho::V_K]);\n- }\n-}\n-\n-template <typename B, typename R, typename Q>\n-void Simulation_BFER_ite<B,R,Q>\n-::create_sequence()\n-{\n- const auto is_rayleigh = this->params_BFER_ite.chn->type.find(\"RAYLEIGH\") != std::string::npos;\n- const auto t = this->params_BFER.n_threads;\n- if (this->params_BFER_ite.src->type != \"AZCW\")\n- this->sequence.reset(new tools::Sequence((*this->source)[module::src::tsk::generate], t));\n- else if (this->params_BFER_ite.chn->type != \"NO\")\n- {\n- if (is_rayleigh)\n- this->sequence.reset(new tools::Sequence((*this->channel)[module::chn::tsk::add_noise_wg], t));\n- else\n- this->sequence.reset(new tools::Sequence((*this->channel)[module::chn::tsk::add_noise], t));\n- }\n- else if (this->modem1->is_filter())\n- this->sequence.reset(new tools::Sequence((*this->modem1)[module::mdm::tsk::filter], t));\n- else if (this->params_BFER_ite.qnt->type != \"NO\")\n- this->sequence.reset(new tools::Sequence((*this->quantizer)[module::qnt::tsk::process], t));\n- else if (this->modem1->is_demodulator())\n- {\n- if (is_rayleigh)\n- this->sequence.reset(new tools::Sequence((*this->modem1)[module::mdm::tsk::demodulate_wg], t));\n- else\n- this->sequence.reset(new tools::Sequence((*this->modem1)[module::mdm::tsk::demodulate], t));\n- }\n- else\n- this->sequence.reset(new tools::Sequence((*this->interleaver_llr1)[module::itl::tsk::deinterleave], t));\n-\n- // set the noise\n- this->codec->set_noise(*this->noise);\n- for (auto &m : this->sequence->template get_modules<tools::Interface_get_set_noise>())\n- m->set_noise(*this->noise);\n-\n- // registering to noise updates\n- this->noise->record_callback_update([this](){ this->codec->notify_noise_update(); });\n- for (auto &m : this->sequence->template get_modules<tools::Interface_notify_noise_update>())\n- this->noise->record_callback_update([m](){ m->notify_noise_update(); });\n-\n- // set different seeds in the modules that uses PRNG\n- std::mt19937 prng(params_BFER_ite.local_seed);\n- for (auto &m : this->sequence->template get_modules<tools::Interface_set_seed>())\n- m->set_seed(prng());\n-\n- auto fb_modules = this->sequence->template get_modules<tools::Interface_get_set_frozen_bits>();\n- if (fb_modules.size())\n- {\n- this->noise->record_callback_update([fb_modules](){\n- for (auto &m : fb_modules)\n- m->set_frozen_bits(fb_modules[0]->get_frozen_bits());\n- });\n- }\n-\n- this->interleaver_core->set_seed(params_BFER_ite.itl->core->seed);\n- if (this->interleaver_core->is_uniform())\n- {\n- std::stringstream message;\n- message << \"Please use the legacy simulator engine for uniform interleaving (remove the '--sim-sequence' \"\n- << \"argument from the command line).\";\n- throw tools::runtime_error(__FILE__, __LINE__, __func__, message.str());\n- }\n-\n- auto monitors_er = this->sequence->template get_modules<module::Monitor_BFER<B >>();\n- auto decoders_siso = this->sequence->template get_modules<module::Decoder_SISO<B,Q>>();\n- for (size_t m = 0; m < monitors_er.size(); m++)\n- if (m < decoders_siso.size())\n- {\n- auto cur_decoder_siso = decoders_siso[m];\n- cur_decoder_siso->set_auto_reset(false);\n- monitors_er[m]->record_callback_check([cur_decoder_siso](){ cur_decoder_siso->reset(); });\n- }\n-\n- if (this->params_BFER_ite.err_track_enable)\n- {\n- auto sources = this->sequence->template get_modules<module::Source<B>>();\n- for (size_t tid = 0; tid < (size_t)this->params_BFER.n_threads; tid++)\n- {\n- auto &source = sources.size() ? *sources[tid] : *this->source;\n- auto src_data = (B*)(source[module::src::sck::generate::U_K].get_dataptr());\n- auto src_bytes = source[module::src::sck::generate::U_K].get_databytes();\n- auto src_size = (src_bytes / sizeof(B)) / this->params_BFER_ite.n_frames;\n- this->dumper[tid]->register_data(src_data,\n- (unsigned int)src_size,\n- this->params_BFER_ite.err_track_threshold,\n- \"src\",\n- false,\n- this->params_BFER_ite.n_frames,\n- {});\n- }\n-\n- auto encoders = this->sequence->template get_modules<module::Encoder<B>>();\n- for (size_t tid = 0; tid < (size_t)this->params_BFER.n_threads; tid++)\n- {\n- auto &encoder = encoders.size() ? *encoders[tid] : this->codec->get_encoder();\n- auto enc_data = (B*)(encoder[module::enc::sck::encode::X_N].get_dataptr());\n- auto enc_bytes = encoder[module::enc::sck::encode::X_N].get_databytes();\n- auto enc_size = (enc_bytes / sizeof(B)) / this->params_BFER_ite.n_frames;\n- this->dumper[tid]->register_data(enc_data,\n- (unsigned int)enc_size,\n- this->params_BFER_ite.err_track_threshold,\n- \"enc\",\n- false,\n- this->params_BFER_ite.n_frames,\n- {(unsigned)this->params_BFER_ite.cdc->enc->K});\n- }\n-\n- auto channels = this->sequence->template get_modules<module::Channel<R>>();\n- for (size_t tid = 0; tid < (size_t)this->params_BFER.n_threads; tid++)\n- {\n- auto &channel = channels.size() ? *channels[tid] : *this->channel;\n- this->dumper[tid]->register_data(channel.get_noised_data(),\n- this->params_BFER_ite.err_track_threshold,\n- \"chn\",\n- true,\n- this->params_BFER_ite.n_frames,\n- {});\n- }\n-\n- for (size_t tid = 0; tid < (size_t)this->params_BFER.n_threads; tid++)\n- {\n- monitors_er[tid]->record_callback_fe(std::bind(&tools::Dumper::add,\n- this->dumper[tid].get(),\n- std::placeholders::_1,\n- std::placeholders::_2));\n- }\n- }\n-}\n-\n-// ==================================================================================== explicit template instantiation\n-#include \"Tools/types.h\"\n-#ifdef AFF3CT_MULTI_PREC\n-template class aff3ct::simulation::Simulation_BFER_ite<B_8,R_8,Q_8>;\n-template class aff3ct::simulation::Simulation_BFER_ite<B_16,R_16,Q_16>;\n-template class aff3ct::simulation::Simulation_BFER_ite<B_32,R_32,Q_32>;\n-template class aff3ct::simulation::Simulation_BFER_ite<B_64,R_64,Q_64>;\n-#else\n-template class aff3ct::simulation::Simulation_BFER_ite<B,R,Q>;\n-#endif\n-// ==================================================================================== explicit template instantiation\n"
},
{
"change_type": "DELETE",
"old_path": "Simulation_BFER_ite.hpp",
"new_path": null,
"diff": "-#ifndef SIMULATION_BFER_ITE_HPP_\n-#define SIMULATION_BFER_ITE_HPP_\n-\n-#include <memory>\n-\n-#include \"Module/Source/Source.hpp\"\n-#include \"Module/CRC/CRC.hpp\"\n-#include \"Module/Modem/Modem.hpp\"\n-#include \"Module/Channel/Channel.hpp\"\n-#include \"Module/Quantizer/Quantizer.hpp\"\n-#include \"Module/Coset/Coset.hpp\"\n-#include \"Module/Interleaver/Interleaver.hpp\"\n-#include \"Module/Switcher/Switcher.hpp\"\n-#include \"Module/Iterator/Iterator.hpp\"\n-#include \"Tools/Interleaver/Interleaver_core.hpp\"\n-#include \"Tools/Codec/Codec_SISO.hpp\"\n-#include \"Tools/Constellation/Constellation.hpp\"\n-#include \"Tools/Math/Distribution/Distributions.hpp\"\n-#include \"Factory/Simulation/BFER/BFER_ite.hpp\"\n-#include \"Simulation/BFER/Simulation_BFER.hpp\"\n-\n-namespace aff3ct\n-{\n-namespace simulation\n-{\n-\n-template <typename B = int, typename R = float, typename Q = R>\n-class Simulation_BFER_ite : public Simulation_BFER<B,R>\n-{\n-protected:\n- const factory::BFER_ite ¶ms_BFER_ite;\n-\n- // communication sequence\n- std::unique_ptr<module::Source <B >> source;\n- std::unique_ptr<tools ::Codec_SISO <B, Q>> codec;\n- std::unique_ptr<module::Modem <B,R,Q>> modem1;\n- std::unique_ptr<module::Modem <B,R,Q>> modem2;\n- std::unique_ptr<module::Channel <R >> channel;\n- std::unique_ptr<module::Quantizer <R,Q >> quantizer;\n- std::unique_ptr<module::Coset <B,Q >> coset_real1;\n- std::unique_ptr<module::Coset <B,Q >> coset_real2;\n- std::unique_ptr<module::Coset <B,Q >> coset_real3;\n- std::unique_ptr<module::Coset <B,B >> coset_bit;\n- std::unique_ptr<tools ::Interleaver_core< >> interleaver_core;\n- std::unique_ptr<module::Interleaver <B >> interleaver_bit;\n- std::unique_ptr<module::Interleaver <Q >> interleaver_llr1;\n- std::unique_ptr<module::Interleaver <Q >> interleaver_llr2;\n- std::shared_ptr<module::Switcher > switcher;\n- std::shared_ptr<module::Iterator > iterator;\n-\n-public:\n- explicit Simulation_BFER_ite(const factory::BFER_ite ¶ms_BFER_ite);\n- virtual ~Simulation_BFER_ite() = default;\n-\n-protected:\n- std::unique_ptr<module::Source <B >> build_source ( );\n- std::unique_ptr<tools ::Codec_SISO <B,Q >> build_codec ( );\n- std::unique_ptr<module::Modem <B,R,Q>> build_modem (const tools::Distributions<R> *distributions,\n- const tools::Constellation<R> *constellation);\n- std::unique_ptr<module::Channel <R >> build_channel (const tools::Distributions<R> *distributions);\n- std::unique_ptr<module::Quantizer <R,Q >> build_quantizer ( );\n- std::unique_ptr<module::Coset <B,Q >> build_coset_real ( );\n- std::unique_ptr<module::Coset <B,B >> build_coset_bit ( );\n- std::unique_ptr<tools ::Interleaver_core< >> build_interleaver( );\n- std::unique_ptr<module::Switcher > build_switcher ( );\n- std::unique_ptr<module::Iterator > build_iterator ( );\n- virtual void create_modules();\n- virtual void bind_sockets();\n- virtual void create_sequence();\n-};\n-\n-}\n-}\n-\n-#endif /* SIMULATION_BFER_ITE_HPP_ */\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
Rm useless files.
|
8,490 |
28.04.2021 17:56:23
| -7,200 |
b5c0f79c9a3a6e55718f92821289a9d8287d0154
|
Reset the path in 'module::Switcher' for each wave in 'tools::Sequence'.
|
[
{
"change_type": "MODIFY",
"old_path": "include/Module/Switcher/Switcher.hpp",
"new_path": "include/Module/Switcher/Switcher.hpp",
"diff": "#include \"Module/Socket.hpp\"\n#include \"Module/Module.hpp\"\n#include \"Tools/Sequence/Sequence.hpp\"\n+#include \"Tools/Interface/Interface_reset.hpp\"\nnamespace aff3ct\n{\n@@ -25,7 +26,7 @@ namespace module\nenum class tsk : size_t { commute, select, SIZE };\n}\n-class Switcher : public Module\n+class Switcher : public Module, public tools::Interface_reset\n{\nfriend tools::Sequence; // Sequence is friend to enable the no copy mode (0 copy)\n@@ -60,6 +61,8 @@ public:\ninline bool is_no_copy_commute() const;\ninline bool is_no_copy_select () const;\n+ virtual void reset();\n+\nprotected:\ninline void set_path(const size_t path);\ninline void set_no_copy_commute(const bool no_copy_commute);\n"
},
{
"change_type": "MODIFY",
"old_path": "include/Tools/Sequence/Sequence.hpp",
"new_path": "include/Tools/Sequence/Sequence.hpp",
"diff": "@@ -77,6 +77,7 @@ protected:\nbool no_copy_mode;\nconst std::vector<const module::Task*> saved_exclusions;\nstd::vector<tools::Interface_is_done*> donners;\n+ std::vector<std::vector<tools::Interface_reset*>> switchers_reset;\nbool auto_stop;\npublic:\n"
},
{
"change_type": "MODIFY",
"old_path": "src/Module/Switcher/Switcher.cpp",
"new_path": "src/Module/Switcher/Switcher.cpp",
"diff": "@@ -10,3 +10,9 @@ Switcher* Switcher\nm->deep_copy(*this);\nreturn m;\n}\n+\n+void Switcher\n+::reset()\n+{\n+ this->path = this->get_n_data_sockets() -1;\n+}\n"
},
{
"change_type": "MODIFY",
"old_path": "src/Tools/Sequence/Sequence.cpp",
"new_path": "src/Tools/Sequence/Sequence.cpp",
"diff": "@@ -40,6 +40,7 @@ Sequence\npuids(puids),\nno_copy_mode(true),\nsaved_exclusions(exclusions),\n+ switchers_reset(n_threads),\nauto_stop(true)\n{\n#ifndef AFF3CT_HWLOC\n@@ -124,6 +125,7 @@ Sequence\npuids(puids),\nno_copy_mode(true),\nsaved_exclusions(exclusions_convert_to_const(exclusions)),\n+ switchers_reset(n_threads),\nauto_stop(true)\n{\nif (thread_pinning && puids.size() < n_threads)\n@@ -291,6 +293,11 @@ void Sequence\nthis->update_firsts_and_lasts_tasks();\nthis->gen_processes();\nthis->donners = get_modules<tools::Interface_is_done>(true);\n+\n+ for (size_t tid = 0; tid < this->n_threads; tid++)\n+ for (auto &mdl : this->all_modules[tid])\n+ if (auto swi = dynamic_cast<module::Switcher*>(mdl))\n+ this->switchers_reset[tid].push_back(dynamic_cast<tools::Interface_reset*>(swi));\n}\nSequence* Sequence\n@@ -465,6 +472,10 @@ void Sequence\n{\ndo\n{\n+ // force switchers reset to reinitialize the path to the last input socket\n+ for (size_t s = 0; s < this->switchers_reset[tid].size(); s++)\n+ this->switchers_reset[tid][s]->reset();\n+\nstd::fill(statuses.begin(), statuses.end(), nullptr);\ntry\n{\n@@ -541,6 +552,10 @@ void Sequence\n{\ndo\n{\n+ // force switchers reset to reinitialize the path to the last input socket\n+ for (size_t s = 0; s < this->switchers_reset[tid].size(); s++)\n+ this->switchers_reset[tid][s]->reset();\n+\ntry\n{\nexec_sequence(sequence);\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
Reset the path in 'module::Switcher' for each wave in 'tools::Sequence'.
|
8,490 |
20.05.2021 15:01:15
| -7,200 |
ea10ed0b6e72af7baded3128e007732667cd8d98
|
Fix MSVC compilation error (again...).
|
[
{
"change_type": "MODIFY",
"old_path": "include/Module/Binaryop/Binaryop.hxx",
"new_path": "include/Module/Binaryop/Binaryop.hxx",
"diff": "@@ -24,17 +24,6 @@ Binaryop<TI,TO,BOP>\n::Binaryop(const size_t n_elmts)\n: Module(), n_elmts(n_elmts)\n{\n- std::string op = \"ukn\";\n- if ((uintptr_t)BOP == (uintptr_t)tools::bop_add<TI,TO>) op = \"add\";\n- else if ((uintptr_t)BOP == (uintptr_t)tools::bop_sub<TI,TO>) op = \"sub\";\n- else if ((uintptr_t)BOP == (uintptr_t)tools::bop_mul<TI,TO>) op = \"mul\";\n- else if ((uintptr_t)BOP == (uintptr_t)tools::bop_div<TI,TO>) op = \"div\";\n- else if ((uintptr_t)BOP == (uintptr_t)tools::bop_or <TI,TO>) op = \"or\";\n- else if ((uintptr_t)BOP == (uintptr_t)tools::bop_xor<TI,TO>) op = \"xor\";\n- else if ((uintptr_t)BOP == (uintptr_t)tools::bop_and<TI,TO>) op = \"and\";\n- else if ((uintptr_t)BOP == (uintptr_t)tools::bop_min<TI,TO>) op = \"min\";\n- else if ((uintptr_t)BOP == (uintptr_t)tools::bop_max<TI,TO>) op = \"max\";\n-\nconst std::string name = \"Binaryop\";\nthis->set_name(name + \"<\" + tools::bop_get_name<TI,TO,BOP>() + \">\");\nthis->set_short_name(name);\n"
}
] |
C++
|
MIT License
|
aff3ct/aff3ct
|
Fix MSVC compilation error (again...).
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.