From 5fd492d14dcc59a0edad4d1bec8eef6719741234 Mon Sep 17 00:00:00 2001 From: neworderofjamie Date: Wed, 20 Apr 2022 15:18:08 +0100 Subject: [PATCH] Fixed ``BackendSIMT::getPaddedNumCustomUpdateThreads`` helper and actually use it in ``BackendSIMT::genCustomUpdateKernel`` --- src/genn/genn/code_generator/backendSIMT.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/genn/genn/code_generator/backendSIMT.cc b/src/genn/genn/code_generator/backendSIMT.cc index 6cd273f5e3..40334f807a 100644 --- a/src/genn/genn/code_generator/backendSIMT.cc +++ b/src/genn/genn/code_generator/backendSIMT.cc @@ -197,7 +197,7 @@ size_t BackendSIMT::getNumInitialisationRNGStreams(const ModelSpecMerged &modelM //-------------------------------------------------------------------------- size_t BackendSIMT::getPaddedNumCustomUpdateThreads(const CustomUpdateInternal &cg, unsigned int batchSize) const { - const size_t numCopies = cg.isBatched() ? batchSize : 1; + const size_t numCopies = (cg.isBatched() && !cg.isReduction()) ? batchSize : 1; return numCopies * padKernelSize(cg.getSize(), KernelCustomUpdate); } //-------------------------------------------------------------------------- @@ -857,8 +857,7 @@ void BackendSIMT::genCustomUpdateKernel(CodeStream &os, const Substitutions &ker os, kernelSubs, modelMerged.getMergedCustomUpdateGroups(), idStart, [&modelMerged, this](const CustomUpdateInternal &cu) { - const unsigned int numCopies = (cu.isBatched() && !cu.isReduction()) ? modelMerged.getModel().getBatchSize() : 1; - return numCopies * padKernelSize(cu.getSize(), KernelCustomUpdate); + return getPaddedNumCustomUpdateThreads(cu, modelMerged.getModel().getBatchSize()); }, [&updateGroup](const CustomUpdateGroupMerged &cg) { return (cg.getArchetype().getUpdateGroupName() == updateGroup); }, [&modelMerged, this](CodeStream &os, const CustomUpdateGroupMerged &cg, Substitutions &popSubs)