Skip to content

Commit

Permalink
Call push kernel only with max bundle size threads
Browse files Browse the repository at this point in the history
  • Loading branch information
denisalevi committed Feb 15, 2022
1 parent dba8942 commit e7ad71b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions brian2cuda/templates/synapses_push_spikes.cu
Original file line number Diff line number Diff line change
Expand Up @@ -1054,12 +1054,16 @@ void _run_{{codeobj_name}}()
*/
needed_shared_memory = (2 * {{owner.name}}_max_num_unique_delays + 1) * sizeof(int);
assert (needed_shared_memory <= max_shared_mem_size);
// We don't need more then max(num_synapses) threads per block.
num_threads = {{owner.name}}_max_size;
{% else %}{# bundle_mode #}
needed_shared_memory = 0;
// We don't need more then max(num_delays) threads per block.
num_threads = {{owner.name}}_bundle_size_max;
{% endif %}{# not bundle_mode #}

// We don't need more then max(num_synapses) threads per block.
num_threads = {{owner.name}}_max_size;
// TODO: warp size multiple for num_threads?

if (num_threads > max_threads_per_block)
{
num_threads = max_threads_per_block;
Expand Down

0 comments on commit e7ad71b

Please sign in to comment.