Skip to content

Commit 876a3f0

Browse files
author
Cristiano Köhler
committed
Added restriction to override number to avoid exceeding the maximum number of threads
1 parent d6d7cb8 commit 876a3f0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

elephant/asset/asset.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1354,7 +1354,8 @@ def pycuda(self, mat):
13541354
# needed for the kernel, to avoid exceeding the resources
13551355
if self.cuda_threads:
13561356
# Override with the number in the parameter `cuda_threads`
1357-
n_threads = self.cuda_threads
1357+
n_threads = min(self.cuda_threads,
1358+
device.MAX_THREADS_PER_BLOCK)
13581359
else:
13591360
# Automatically determine the number of threads based on
13601361
# the register count.

0 commit comments

Comments
 (0)