sPyNNaker neural_modelling 7.3.1
|
General types associated with generators. More...
#include <common-typedefs.h>
#include <spin1_api.h>
#include "param_generator.h"
#include "matrix_generator.h"
Go to the source code of this file.
Macros | |
#define | max(a, b) (a > b? a: b) |
Typedefs | |
typedef uint32_t | generator_hash_t |
The type of values used to indicate the subtype of generator to create. Must match the constants on the Python side of the code. | |
typedef void *() | initialize_param_func(void **region) |
How to initialise the param generator. | |
typedef void *() | initialize_connector_func(void **region) |
How to initialise the connection generator. | |
typedef void *() | initialize_matrix_func(void **region, void *synaptic_matrix) |
How to initialise the matrix generator. | |
typedef void() | free_func(void *data) |
How to free any data for the generator; all generator types use the same signature of free func. | |
typedef accum() | generate_param_func(void *generator) |
How to generate values with a parameter generator. | |
typedef bool() | write_synapse_func(void *generator, uint32_t pre_index, uint16_t post_index, accum weight, uint16_t delay, unsigned long accum weight_scale) |
How to write a synapse to a matrix. | |
typedef bool() | generate_connection_func(void *generator, uint32_t pre_lo, uint32_t pre_hi, uint32_t post_lo, uint32_t post_hi, uint32_t post_index, uint32_t post_slice_start, uint32_t post_slice_count, unsigned long accum weight_scale, accum timestep_per_delay, param_generator_t weight_generator, param_generator_t delay_generator, matrix_generator_t matrix_generator) |
How to generate connections with a connection generator. | |
Functions | |
static uint16_t | rescale_delay (accum delay, accum timestep_per_delay) |
Rescales a delay to account for timesteps and type-converts it. | |
static uint16_t | rescale_weight (accum weight, unsigned long accum weight_scale) |
Rescales a weight to account for weight granularity and type-converts it. | |
General types associated with generators.
Note that generators are really classes... except this is C so we have to cheat.
Definition in file generator_types.h.
#define max | ( | a, | |
b | |||
) | (a > b? a: b) |
Definition at line 159 of file generator_types.h.
typedef uint32_t generator_hash_t |
The type of values used to indicate the subtype of generator to create. Must match the constants on the Python side of the code.
Definition at line 38 of file generator_types.h.
typedef void *() initialize_param_func(void **region) |
How to initialise the param generator.
[in,out] | region | Region to read parameters from. Should be updated to position just after parameters after calling. |
Definition at line 46 of file generator_types.h.
typedef void *() initialize_connector_func(void **region) |
How to initialise the connection generator.
[in,out] | region | Region to read parameters from. Should be updated to position just after parameters after calling. |
Definition at line 54 of file generator_types.h.
typedef void *() initialize_matrix_func(void **region, void *synaptic_matrix) |
How to initialise the matrix generator.
[in,out] | region | Region to read parameters from. Should be updated to position just after parameters after calling. |
[in] | synaptic_matrix | The address of the base of the synaptic matrix |
Definition at line 63 of file generator_types.h.
typedef void() free_func(void *data) |
How to free any data for the generator; all generator types use the same signature of free func.
[in] | data | The data to free |
Definition at line 70 of file generator_types.h.
typedef accum() generate_param_func(void *generator) |
How to generate values with a parameter generator.
[in] | generator | The generator to use to generate values |
Definition at line 77 of file generator_types.h.
typedef bool() write_synapse_func(void *generator, uint32_t pre_index, uint16_t post_index, accum weight, uint16_t delay, unsigned long accum weight_scale) |
How to write a synapse to a matrix.
[in] | generator | The generator data |
[in] | pre_index | The index of the pre-neuron relative to the start of the matrix |
[in] | post_index | The index of the post-neuron on this core |
[in] | weight | The weight of the synapse in raw numbers |
[in] | delay | The delay of the synapse in time steps |
[in] | weight_scale | The scaling to apply to the weight if needed |
Definition at line 90 of file generator_types.h.
typedef bool() generate_connection_func(void *generator, uint32_t pre_lo, uint32_t pre_hi, uint32_t post_lo, uint32_t post_hi, uint32_t post_index, uint32_t post_slice_start, uint32_t post_slice_count, unsigned long accum weight_scale, accum timestep_per_delay, param_generator_t weight_generator, param_generator_t delay_generator, matrix_generator_t matrix_generator) |
How to generate connections with a connection generator.
[in] | generator | The generator to use to generate connections |
[in] | pre_slice_start | The start of the slice of the pre-population being generated |
[in] | pre_slice_count | The number of neurons in the slice of the pre-population being generated |
[in] | pre_neuron_index | The index of the neuron in the pre-population being generated |
[in] | post_slice_start | The start of the slice of the post-population being generated |
[in] | post_slice_count | The number of neurons in the slice of the post-population being generated |
[in] | max_row_length | The maximum number of connections to generate |
[in,out] | indices | An array into which the core-relative post-indices should be placed. This will be initialised to be max_row_length in size |
Definition at line 113 of file generator_types.h.
|
inlinestatic |
Rescales a delay to account for timesteps and type-converts it.
[in] | delay | the delay to rescale |
[in] | timestep_per_delay | The timestep unit |
Definition at line 125 of file generator_types.h.
|
inlinestatic |
Rescales a weight to account for weight granularity and type-converts it.
[in] | weight | the weight to rescale |
[in] | weight_scale | The weight scaling factor |
Definition at line 142 of file generator_types.h.