Skip to content

Commit

Permalink
Merge porter:src/pyopencl
Browse files Browse the repository at this point in the history
  • Loading branch information
inducer committed Aug 9, 2016
2 parents adb9bf2 + 9fdfa92 commit 33245c9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pyopencl/scan.py
Expand Up @@ -1065,6 +1065,10 @@ def finish_setup(self):
dev.local_mem_size
for dev in self.devices)

if "CUDA" in self.devices[0].platform.name:
# not sure where these go, but roughly this much seems unavailable.
avail_local_mem -= 0x400

is_cpu = self.devices[0].type & cl.device_type.CPU
is_gpu = self.devices[0].type & cl.device_type.GPU

Expand All @@ -1091,7 +1095,7 @@ def finish_setup(self):
k_group_size = 2**k_exp
lmem_use = self.get_local_mem_use(wg_size, k_group_size,
use_bank_conflict_avoidance)
if lmem_use + 256 <= avail_local_mem:
if lmem_use <= avail_local_mem:
solutions.append((wg_size*k_group_size, k_group_size, wg_size))

if is_gpu:
Expand Down

0 comments on commit 33245c9

Please sign in to comment.