Skip to content

Commit dab8e8a

Browse files
Yuliya Z. FrolovaArtiom N.
authored andcommitted
Merged PR 1764144: Doxygen proofreading
Doxygen proofreading Related work items: #9522889
1 parent da6e120 commit dab8e8a

87 files changed

Lines changed: 1905 additions & 690 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

knp/backends/cpu/cpu-devices/include/knp/devices/cpu.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131

3232
/**
3333
* @namespace knp::devices
34+
*
3435
* @brief Namespace for implementation of concrete devices.
3536
*/
3637

@@ -68,6 +69,7 @@ class KNP_DECLSPEC CPU final : public knp::core::Device // cppcheck-suppress cl
6869

6970
/**
7071
* @brief CPU device move operator.
72+
*
7173
* @return reference to CPU instance.
7274
*/
7375
CPU &operator=(CPU &&) noexcept;
@@ -80,24 +82,28 @@ class KNP_DECLSPEC CPU final : public knp::core::Device // cppcheck-suppress cl
8082
public:
8183
/**
8284
* @brief Get device type.
85+
*
8386
* @return device type.
8487
*/
8588
[[nodiscard]] knp::core::DeviceType get_type() const override;
8689

8790
/**
8891
* @brief Get device name.
92+
*
8993
* @return device name in the arbitrary format.
9094
*/
9195
[[nodiscard]] const std::string get_name() const override;
9296

9397
/**
9498
* @brief Get CPU device socket number.
99+
*
95100
* @return socket number.
96101
*/
97102
[[nodiscard]] uint32_t get_socket_number() const;
98103

99104
/**
100105
* @brief Get power consumption details for the device.
106+
*
101107
* @return amount of consumed power.
102108
*/
103109
[[nodiscard]] float get_power() const override;
@@ -120,6 +126,7 @@ class KNP_DECLSPEC CPU final : public knp::core::Device // cppcheck-suppress cl
120126

121127
/**
122128
* @brief List all processors on which backend can be initialized.
129+
*
123130
* @return vector of CPUs.
124131
*/
125132
KNP_DECLSPEC std::vector<CPU> list_processors();

knp/backends/cpu/cpu-library/include/knp/backends/cpu-library/init.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ namespace knp::backends::cpu
4040

4141
/**
4242
* @brief The "null" subscriber.
43+
*
4344
* @tparam SynapseType type of the non-STDP synapses.
4445
*/
4546
template <typename SynapseType>
@@ -54,6 +55,7 @@ struct subscribe_stdp_projection
5455

5556
/**
5657
* @brief STDP projection subscriber.
58+
*
5759
* @tparam Rule STDP rule.
5860
* @tparam SynapseType linked synapse type.
5961
*/
@@ -62,6 +64,7 @@ struct subscribe_stdp_projection<knp::synapse_traits::STDP<Rule, SynapseType>>
6264
{
6365
/**
6466
* @brief Subscribe projection to message endpoint.
67+
*
6568
* @param p projection to subscribe.
6669
* @param message_endpoint message endpoint to subscribe.
6770
*/
@@ -81,9 +84,11 @@ struct subscribe_stdp_projection<knp::synapse_traits::STDP<Rule, SynapseType>>
8184

8285
/**
8386
* @brief Initialize backend.
87+
*
8488
* @param projections container backend projections.
8589
* @param message_endpoint message endpoint.
86-
* @tparam ProjectionContainer type of projection container.
90+
*
91+
* @tparam ProjectionContainer type of a projection container.
8792
*/
8893
template <typename ProjectionContainer>
8994
void init(const ProjectionContainer &projections, knp::core::MessageEndpoint &message_endpoint)

knp/backends/cpu/cpu-library/include/knp/backends/cpu-library/populations.h

Lines changed: 39 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,22 @@
3333

3434

3535
/**
36-
* @brief Namespace for CPU backend's populations.
36+
* @brief Namespace for CPU backend population functions.
3737
*/
3838
namespace knp::backends::cpu::populations
3939
{
4040

4141
/**
4242
* @brief Partially calculate population before it receives synaptic impact messages.
43-
* @param population Population to update.
44-
* @param start Index of the first neuron to calculate.
45-
* @param end Index of the last neuron to calculate.
43+
*
44+
* @note The 'end' parameter is exclusive, that is a neuron with the specified 'end' index is not calculated.
45+
*
46+
* @tparam Neuron type of neurons stored in the population.
47+
*
48+
* @param population population to calculate.
49+
* @param start index of the first neuron to calculate.
50+
* @param end index of the last neuron to calculate.
51+
*
4652
*/
4753
template <class Neuron>
4854
void calculate_pre_impact_population_state(knp::core::Population<Neuron> &population, size_t start, size_t end)
@@ -56,9 +62,13 @@ void calculate_pre_impact_population_state(knp::core::Population<Neuron> &popula
5662

5763

5864
/**
59-
* @brief Impact population.
60-
* @param population Population.
61-
* @param messages Impact messages.
65+
* @brief Dispatch synaptic impact messages to population.
66+
*
67+
* @tparam Neuron type of neurons stored in the population.
68+
*
69+
* @param population population to impact.
70+
* @param messages synaptic impact messages to dispatch.
71+
*
6272
*/
6373
template <class Neuron>
6474
void impact_population(
@@ -77,10 +87,19 @@ void impact_population(
7787

7888
/**
7989
* @brief Partially calculate population after it receives synaptic impact messages.
80-
* @param population population to update.
90+
*
91+
* @note The 'end' parameter is exclusive, that is a neuron with the specified 'end' index is not calculated.
92+
*
93+
* @details The function iterates over the neurons in the range `[start, end)`. If a neuron produces a spike, then
94+
* its index is appended to the message defined in the `message` parameter.
95+
*
96+
* @tparam Neuron type of neurons stored in the population.
97+
*
98+
* @param population population to calculate.
8199
* @param message output spike message to update.
82-
* @param start index of the first neuron to update.
83-
* @param end index of the last neuron to update.
100+
* @param start index of the first neuron to calculate.
101+
* @param end index of the last neuron to calculate.
102+
*
84103
*/
85104
template <class Neuron>
86105
void calculate_post_impact_population_state(
@@ -98,11 +117,16 @@ void calculate_post_impact_population_state(
98117

99118

100119
/**
101-
* @brief Train population.
102-
* @param population Population.
103-
* @param projections Connected projections.
104-
* @param message Spiking neurons in population at current step.
105-
* @param step Step.
120+
* @brief Train the population for the given simulation step.
121+
*
122+
* @tparam Neuron type of neurons stored in the population.
123+
* @tparam Synapse type of synapses used in the connected projections.
124+
*
125+
* @param population population to train.
126+
* @param projections connected projections that send synaptic impacts.
127+
* @param message spiking neurons in the population at the current step.
128+
* @param step simulation step for which the training is performed.
129+
*
106130
*/
107131
template <class Neuron, class Synapse>
108132
void train_population(

knp/backends/cpu/cpu-library/include/knp/backends/cpu-library/populations_old.h

Lines changed: 77 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,29 @@
3030

3131

3232
/**
33-
* @brief Namespace for CPU backend's populations.
33+
* @brief Namespace for CPU backend functions.
3434
*/
3535
namespace knp::backends::cpu
3636
{
3737

38+
3839
/**
39-
* @brief Find projection by type and postsynaptic uid.
40+
* @brief Find projections of a given synapse type that target a specific postsynaptic population.
41+
*
4042
* @tparam SynapseType synapse type.
41-
* @tparam ProjectionContainer projection container.
42-
* @param projections projections.
43-
* @param post_uid postsynaptic uid.
44-
* @param exclude_locked should projections with locked weights be exluded or not.
45-
* @return found projections.
43+
* @tparam ProjectionContainer type of a projection container.
44+
*
45+
* @param projections container of projections to search.
46+
* @param post_uid UID of the postsynaptic population to match.
47+
* @param exclude_locked flag that determines whether projections with locked weights are omitted.
48+
*
49+
* @return vector of references to the matching projections.
50+
*
51+
* @details The function iterates over `projections`, skips entries whose variant index does not
52+
* match the specified synapse type, and extracts the concrete `Projection<SynapseType>`.
53+
* Projections whose `is_locked()` flag is true are excluded when `exclude_locked` is set.
54+
* Finally, only projections whose postsynaptic population UID matches `post_uid` are added to the result.
55+
*
4656
*/
4757
template <class SynapseType, class ProjectionContainer>
4858
std::vector<std::reference_wrapper<knp::core::Projection<SynapseType>>> find_projection_by_type_and_postsynaptic(
@@ -74,12 +84,22 @@ std::vector<std::reference_wrapper<knp::core::Projection<SynapseType>>> find_pro
7484

7585

7686
/**
77-
* @brief Make one execution step for a population of any neurons.
78-
* @tparam Neuron type of a neuron.
87+
* @brief Execute one simulation step for a population of arbitrary neurons.
88+
*
89+
* @tparam Neuron type of neurons stored in the population.
90+
*
7991
* @param pop population to update.
80-
* @param endpoint message endpoint used for message exchange.
81-
* @param step_n execution step.
82-
* @return indexes of spiked neurons.
92+
* @param endpoint message endpoint used for loading and sending messages.
93+
* @param step_n current execution step number.
94+
*
95+
* @return spike message containing the indexes of neurons that emitted a spike during this step.
96+
*
97+
* @details The function unloads all synaptic impact messages addressed to the population from
98+
* the message endpoint. Then the function calculates pre-impact state
99+
* (@ref populations::calculate_pre_impact_population_state), dispatches synaptic impact messages
100+
* (@ref populations::impact_population), and calculates post-impact state
101+
* (@ref populations::calculate_post_impact_population_state). If any spikes were generated,
102+
* the functions sends a spike message back through the message endpoint.
83103
*/
84104
template <class Neuron>
85105
std::optional<core::messaging::SpikeMessage> calculate_any_population(
@@ -102,12 +122,19 @@ std::optional<core::messaging::SpikeMessage> calculate_any_population(
102122

103123

104124
/**
105-
* @brief Make one execution step for a population of BLIFAT neurons.
106-
* @tparam BlifatLikeNeuron type of a neuron with BLIFAT-like parameters.
125+
* @brief Execute one simulation step for a population of BLIFAT‑like neurons.
126+
*
127+
* @tparam BlifatLikeNeuron type of a neuron that possesses BLIFAT‑like parameters.
128+
*
107129
* @param pop population to update.
108-
* @param endpoint message endpoint used for message exchange.
109-
* @param step_n execution step.
110-
* @return indexes of spiked neurons.
130+
* @param endpoint message endpoint used for loading and sending messages.
131+
* @param step_n current execution step number.
132+
*
133+
* @return spike message containing the indexes of neurons that emitted a spike during this step.
134+
*
135+
* @details This function is a thin wrapper around @ref calculate_any_population. It forwards the provided population,
136+
* message endpoint, and step number to the generic implementation, thereby reusing the full simulation pipeline.
137+
*
111138
*/
112139
template <class BlifatLikeNeuron>
113140
std::optional<core::messaging::SpikeMessage> calculate_blifat_population(
@@ -118,12 +145,19 @@ std::optional<core::messaging::SpikeMessage> calculate_blifat_population(
118145

119146

120147
/**
121-
* @brief Calculate LIF population.
148+
* @brief Execute one simulation step for a population of LIF neurons.
149+
*
122150
* @tparam LifNeuron LIF neuron type.
123-
* @param pop population to calculate.
124-
* @param endpoint endpoint to use for message exchange.
125-
* @param step_n current step.
126-
* @return spike message with indexes of spiked neurons if population is emitting one.
151+
*
152+
* @param pop population to update.
153+
* @param endpoint message endpoint used for loading and sending messages.
154+
* @param step_n current execution step number.
155+
*
156+
* @return spike message containing the indexes of neurons that emitted a spike during this step.
157+
*
158+
* @details This function simply forwards the call to @ref calculate_any_population, reusing the
159+
* generic simulation pipeline.
160+
*
127161
*/
128162
template <class LifNeuron>
129163
std::optional<knp::core::messaging::SpikeMessage> calculate_lif_population(
@@ -133,16 +167,30 @@ std::optional<knp::core::messaging::SpikeMessage> calculate_lif_population(
133167
}
134168

135169

136-
/**
137-
* @brief Make one execution step for a population of `SynapticResourceSTDPNeuron` neurons.
138-
* @tparam BlifatLikeNeuron type of a neuron with BLIFAT-like parameters.
170+
/**
171+
* @brief Execute one simulation step for a population of `SynapticResourceSTDPNeuron` neurons.
172+
*
173+
* @tparam BlifatLikeNeuron type of a neuron with BLIFAT‑like parameters.
139174
* @tparam BaseSynapseType base synapse type.
140175
* @tparam ProjectionContainer type of a projection container.
176+
*
141177
* @param pop population to update.
142-
* @param container projection container from backend.
143-
* @param endpoint message endpoint used for message exchange.
144-
* @param step_n execution step.
145-
* @return message containing indexes of spiked neurons.
178+
* @param container projection container supplied by the backend.
179+
* @param endpoint message endpoint used for loading and sending messages.
180+
* @param step_n current execution step number.
181+
*
182+
* @return spike message containing the indexes of neurons that emitted a spike during this step.
183+
*
184+
* @details The function unloads all synaptic impact messages addressed to the population from
185+
* the message endpoint. Then the function calculates pre-impact state
186+
* (@ref populations::calculate_pre_impact_population_state), dispatches synaptic impact messages
187+
* (@ref populations::impact_population), and calculates post-impact state
188+
* (@ref populations::calculate_post_impact_population_state).
189+
* The function then retrieves projections of the `SynapticResourceSTDPDeltaSynapse` type that
190+
* target the population, optionally excluding locked ones.
191+
* Finally, the function trains the population with the generated spike message and sends the spike
192+
* message back through the message endpoint if any neurons spiked.
193+
146194
*/
147195
template <class BlifatLikeNeuron, class BaseSynapseType, class ProjectionContainer>
148196
std::optional<core::messaging::SpikeMessage> calculate_resource_stdp_population(

knp/backends/cpu/cpu-library/include/knp/backends/cpu-library/projections.h

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,27 @@
3333
#include "impl/projections/projection_dispatcher.h"
3434

3535

36+
/**
37+
* @brief Namespace for CPU backend projection functions.
38+
*/
3639
namespace knp::backends::cpu::projections
3740
{
3841

3942
/**
40-
* @brief Calculate projection.
41-
* @param projection Projection.
42-
* @param endpoint Projection endpoint.
43-
* @param future_messages Future messages queue.
44-
* @param step_n Step number.
43+
* @brief Calculate a synapse projection for the given simulation step.
44+
*
45+
* @tparam Synapse type of a synapse that possesses Delta‑like parameters.
46+
*
47+
* @param projection projection to calculate.
48+
* @param endpoint message endpoint used for loading and sending messages.
49+
* @param future_messages queue that stores messages to be sent in future steps.
50+
* @param step_n current simulation step number.
51+
*
52+
* @details First, the function unloads all spike messages addressed to the projection from
53+
* the message endpoint. Then the function processes the unloaded spike messages together with
54+
* any pending `future_messages` and returns an iterator to the first impact message that should be
55+
* sent immediately. If such a message exists, the function sends it via the message endpoint
56+
* and removes it from `future_messages`.
4557
*/
4658
template <typename Synapse>
4759
void calculate_projection(
@@ -73,16 +85,20 @@ void calculate_projection(
7385

7486

7587
/**
76-
* @brief Process a part of projection synapses in multithreaded way.
77-
* @pre TODO Get rid of this function. Its here just so multi threaded backend will work.
78-
* @tparam Synapse type of a synapse that requires synapse weight and delay as parameters.
79-
* @param projection projection to receive the message.
88+
* @brief Process a part of projection synapses in a multi-threaded way.
89+
*
90+
* @todo Get rid of this function. This function exists only to keep the multi-threaded backend functional.
91+
*
92+
* @tparam Synapse type of synapses stored in the projection.
93+
*
94+
* @param projection projection that will receive the processed messages.
8095
* @param message_in_data processed spike data for the projection.
8196
* @param future_messages queue of future messages.
82-
* @param step_n current step.
97+
* @param step_n current simulation step.
8398
* @param part_start index of the starting synapse.
8499
* @param part_size number of synapses to process.
85-
* @param mutex mutex.
100+
* @param mutex mutex used for synchronization.
101+
*
86102
*/
87103
template <class Synapse>
88104
void calculate_projection_multithreaded(

0 commit comments

Comments
 (0)