From 8c4507d9f135ee257b2df8f23eb4af18caf85681 Mon Sep 17 00:00:00 2001 From: Zhenwen Dai Date: Thu, 3 Apr 2014 12:29:44 +0100 Subject: [PATCH] [GPU] bug fix --- GPy/kern/_src/psi_comp/ssrbf_psi_gpucomp.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/GPy/kern/_src/psi_comp/ssrbf_psi_gpucomp.py b/GPy/kern/_src/psi_comp/ssrbf_psi_gpucomp.py index 0aebf399..263884dd 100644 --- a/GPy/kern/_src/psi_comp/ssrbf_psi_gpucomp.py +++ b/GPy/kern/_src/psi_comp/ssrbf_psi_gpucomp.py @@ -260,11 +260,11 @@ class PSICOMP_SSRBF(object): self.gpuCache = None def _initGPUCache(self, N, M, Q): - if self.gpuCache and self.gpuCacheAll['mu_gpu'].shape[0]!=N: + if self.gpuCache and self.gpuCache['mu_gpu'].shape[0]!=N: self._releaseMemory() if self.gpuCache == None: - self.gpuCacheAll = { + self.gpuCache = { 'l_gpu' :gpuarray.empty((Q,),np.float64,order='F'), 'Z_gpu' :gpuarray.empty((M,Q),np.float64,order='F'), 'mu_gpu' :gpuarray.empty((N,Q),np.float64,order='F'), @@ -306,11 +306,11 @@ class PSICOMP_SSRBF(object): } def _releaseMemory(self): - if not self.gpuCacheAll: - for k,v in self.gpuCacheAll: + if not self.gpuCache: + for k,v in self.gpuCache: v.gpudata.free() del v - self.gpuCacheAll = None + del self.gpuCache self.gpuCache = None def psicomputations(self, variance, lengthscale, Z, mu, S, gamma):