SNABSuite  0.x
Spiking Neural Architecture Benchmark Suite
setup_time.hpp
Go to the documentation of this file.
1 /*
2  * SNABSuite -- Spiking Neural Architecture Benchmark Suite
3  * Copyright (C) 2018 Christoph Jenzen
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 #pragma once
20 
21 #ifndef SNABSUITE_SNABS_SETUP_TIME_HPP
22 #define SNABSUITE_SNABS_SETUP_TIME_HPP
23 
24 #include <cypress/cypress.hpp>
25 
26 #include "common/snab_base.hpp"
27 
28 namespace SNAB {
29 
34 class SetupTimeOneToOne : public SNABBase {
35 protected:
36  // Populations to be connected
37  cypress::PopulationBase m_pop1, m_pop2;
38  // Simulation times for Connector and List connection
39  cypress::Real m_rt_conn, m_rt_list;
40  // Dummy network to assure the machine is booted
41  cypress::Network m_netw2;
42 
47  SetupTimeOneToOne(std::string name, std::string backend,
48  std::initializer_list<std::string> indicator_names,
49  std::initializer_list<std::string> indicator_types,
50  std::initializer_list<std::string> indicator_measures,
51  std::initializer_list<std::string> indicator_units,
52  std::initializer_list<std::string> required_parameters,
53  size_t bench_index);
54 
55 public:
56  SetupTimeOneToOne(const std::string backend, size_t bench_index);
57  cypress::Network &build_netw(cypress::Network &netw) override;
58  void run_netw(cypress::Network &netw) override;
59  std::vector<std::array<cypress::Real, 4>> evaluate() override;
60  virtual std::shared_ptr<SNABBase> clone() override
61  {
62  return std::make_shared<SetupTimeOneToOne>(m_backend, m_bench_index);
63  }
64 };
65 
71 public:
72  SetupTimeAllToAll(const std::string backend, size_t bench_index);
73  void run_netw(cypress::Network &netw) override;
74  std::shared_ptr<SNABBase> clone() override
75  {
76  return std::make_shared<SetupTimeAllToAll>(m_backend, m_bench_index);
77  }
78 };
79 
85 public:
86  SetupTimeRandom(const std::string backend, size_t bench_index);
87  void run_netw(cypress::Network &netw) override;
88  std::shared_ptr<SNABBase> clone() override
89  {
90  return std::make_shared<SetupTimeRandom>(m_backend, m_bench_index);
91  }
92 };
93 } // namespace SNAB
94 
95 #endif /* SNABSUITE_SNABS_SETUP_TIME_HPP */
std::vector< std::array< cypress::Real, 4 > > evaluate() override
This should contain the evaluation process and return the result in order of those in names()...
std::string m_backend
String which contains the name of the simulation backend.
Definition: snab_base.hpp:210
void run_netw(cypress::Network &netw) override
SetupTimeOneToOne(std::string name, std::string backend, std::initializer_list< std::string > indicator_names, std::initializer_list< std::string > indicator_types, std::initializer_list< std::string > indicator_measures, std::initializer_list< std::string > indicator_units, std::initializer_list< std::string > required_parameters, size_t bench_index)
cypress::Real m_rt_conn
Definition: setup_time.hpp:39
cypress::PopulationBase m_pop2
Definition: setup_time.hpp:37
Virtual Base class for SNABs(Benchmarks). All SNABs should have seperate building of networks...
Definition: snab_base.hpp:33
cypress::Network & build_netw(cypress::Network &netw) override
Building the neural network for benchmarking. If you want to use an external network, you should use the first version of building (and the corresponding run function), for the member network use the second function. The implementation is contained in the first one.
const std::vector< std::string > & indicator_measures() const
Getter for SNABSSuite::m_indicator_measures.
Definition: snab_base.hpp:128
const std::vector< std::string > & indicator_names() const
Getter for SNABSSuite::m_indicator_names.
Definition: snab_base.hpp:106
cypress::PopulationBase m_pop1
Definition: setup_time.hpp:37
const std::vector< std::string > & indicator_types() const
Getter for SNABSSuite::m_indicator_types.
Definition: snab_base.hpp:117
std::shared_ptr< SNABBase > clone() override
Virtual method cloning the SNAB without knowing which SNAB it is.
Definition: setup_time.hpp:88
const size_t m_bench_index
Definition: snab_base.hpp:260
virtual std::shared_ptr< SNABBase > clone() override
Virtual method cloning the SNAB without knowing which SNAB it is.
Definition: setup_time.hpp:60
std::shared_ptr< SNABBase > clone() override
Virtual method cloning the SNAB without knowing which SNAB it is.
Definition: setup_time.hpp:74
cypress::Real m_rt_list
Definition: setup_time.hpp:39
cypress::Network m_netw2
Definition: setup_time.hpp:41