sPyNNaker neural_modelling 7.1.1
Loading...
Searching...
No Matches
last_neuron_selection_impl.c
Go to the documentation of this file.
1/*
2 * Copyright (c) 2017 The University of Manchester
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * https://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
20
22uint32_t n_spikes[2];
26uint32_t last_time;
27
28void partner_init(uint8_t **data) {
29 last_spikes_buffer_size = ((uint32_t *) *data)[0];
30 log_debug("Last neuron selection, buffer size = %u", last_spikes_buffer_size);
31 for (uint32_t i = 0; i < 2; i++) {
33 spin1_malloc(last_spikes_buffer_size * sizeof(spike_t));
34 if (last_spikes_buffer[i] == NULL) {
35 log_error("Out of memory when creating last spikes buffer");
37 }
38 n_spikes[i] = 0;
39 }
40 *data += sizeof(uint32_t);
41}
void log_error(const char *message,...)
void log_debug(const char *message,...)
spike_t * last_spikes_buffer[2]
Spike accumulation buffers.
uint32_t last_spikes_buffer_size
Size of each sub-array within last_spikes_buffer.
uint32_t n_spikes[2]
Spike buffer counters.
void partner_init(uint8_t **data)
Initialise the partner selection rule.
uint32_t last_time
The time of the most recently-considered spike.
Recently spiked partners selection rule.
uint32_t spike_t
The type of a spike.
RTE_SWERR
void rt_error(uint code,...)
#define NULL