Skip to content

Commit

Permalink
Fixed BackendSIMT::getPaddedNumCustomUpdateThreads helper and act…
Browse files Browse the repository at this point in the history
…ually use it in ``BackendSIMT::genCustomUpdateKernel``
  • Loading branch information
neworderofjamie committed Apr 20, 2022
1 parent 439c79d commit 5fd492d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/genn/genn/code_generator/backendSIMT.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
//--------------------------------------------------------------------------
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 5fd492d

Please sign in to comment.