From a93aa3b0f2490e03d020939750095cd0ff10ca50 Mon Sep 17 00:00:00 2001 From: David Rowenhorst Date: Mon, 13 May 2024 10:33:10 -0400 Subject: [PATCH] Fixed memory allocations. Signed-off by: David Rowenhorst --- pyebsdindex/opencl/nlpar_cl.py | 2 +- pyebsdindex/opencl/nlpar_clray.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyebsdindex/opencl/nlpar_cl.py b/pyebsdindex/opencl/nlpar_cl.py index 6f3f2a4..63250dd 100644 --- a/pyebsdindex/opencl/nlpar_cl.py +++ b/pyebsdindex/opencl/nlpar_cl.py @@ -100,7 +100,7 @@ def calcsigma_cl(self,nn=1,saturation_protect=True,automask=True, normalize_d=Fa #print(gpuid) clparams.get_context(gpu_id=gpuid, kfile = 'clnlpar.cl') clparams.get_queue() - target_mem = clparams.queue.device.max_mem_alloc_size + target_mem = clparams.queue.device.max_mem_alloc_size//2 ctx = clparams.ctx prg = clparams.prg queue = clparams.queue diff --git a/pyebsdindex/opencl/nlpar_clray.py b/pyebsdindex/opencl/nlpar_clray.py index df5aff6..695cb8c 100644 --- a/pyebsdindex/opencl/nlpar_clray.py +++ b/pyebsdindex/opencl/nlpar_clray.py @@ -123,7 +123,7 @@ def calcnlpar_cl(self,chunksize=0, searchradius=None, lam = None, dthresh = None rescale = rescale, gpuid = gpuid) - target_mem = clparams.gpu[gpuid].max_mem_alloc_size//2 + target_mem = clparams.gpu[gpuid].max_mem_alloc_size//3 max_mem = clparams.gpu[gpuid].global_mem_size*0.75 if target_mem*ngpuwrker > max_mem: target_mem = max_mem/ngpuwrker