mirror of
https://github.com/SheffieldML/GPy.git
synced 2026-05-09 20:12:38 +02:00
[GPU] bug fix
This commit is contained in:
parent
bb5c41f64c
commit
8c4507d9f1
1 changed files with 5 additions and 5 deletions
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue