Archive MaleCNS research sources, provenance, bibliography and immutable data inventory

This commit is contained in:
Digital Drosophila Archive
2026-09-29 03:38:32 +08:00
commit 3981628ff8
682 changed files with 161475 additions and 0 deletions
@@ -0,0 +1,23 @@
#include <torch/extension.h>
void state_step_cuda(torch::Tensor v, torch::Tensor g, torch::Tensor refractory,
torch::Tensor arrival, torch::Tensor spikes,
torch::Tensor spike_counts, double g_decay, double alpha,
double rest, double reset, double threshold,
int64_t refractory_steps);
void force_step_cuda(torch::Tensor v, torch::Tensor refractory,
torch::Tensor spikes, torch::Tensor spike_counts,
torch::Tensor targets, torch::Tensor forced,
double reset, int64_t refractory_steps);
void fanout_cuda(torch::Tensor spikes, torch::Tensor indptr,
torch::Tensor indices, torch::Tensor weights,
torch::Tensor destination);
void fill_edges_cuda(torch::Tensor indptr, torch::Tensor sources,
torch::Tensor output_offsets, torch::Tensor output);
PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) {
m.def("state_step", &state_step_cuda, "Fused exact LIF state update (CUDA)");
m.def("force_step", &force_step_cuda, "Apply external forced spikes (CUDA)");
m.def("fanout", &fanout_cuda, "Event-driven CSR fan-out (CUDA)");
m.def("fill_edges", &fill_edges_cuda, "Exact source-ordered CSR edge expansion (CUDA)");
}