Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 2bb51ccd authored by hhakim's avatar hhakim
Browse files

Fix pyfaust.Faust functions that use FaustCoreGPU pyx type unconditionally (it...

Fix pyfaust.Faust functions that use FaustCoreGPU pyx type unconditionally (it makes the wrapper to crash if not compiled with GPU support) and remove an erroneous use of FaustCoreGPU type in pure CPU pyx FaustCore class (in multiply function).
parent ee48d360
Branches
Tags
No related merge requests found
......@@ -238,11 +238,7 @@ class Faust:
"""
Returns the device on which the Faust is located (cpu or gpu).
"""
if(isinstance(self.m_faust, (_FaustCorePy.FaustCoreGPU,
_FaustCorePy.FaustCore))):
return self.m_faust.device()
else:
raise TypeError('This Faust object is invalid.')
return self.m_faust.device()
def transpose(F):
"""
......@@ -502,9 +498,7 @@ class Faust:
See also Faust.__sub__
"""
dev = 'cpu'
if isinstance(F.m_faust, _FaustCorePy.FaustCoreGPU):
dev = 'gpu'
dev = F.device
for i in range(0,len(args)):
G = args[i]
if(isinstance(G,Faust)):
......@@ -1774,7 +1768,7 @@ class Faust:
Returns:
The Faust clone.
"""
if isinstance(F.m_faust, _FaustCorePy.FaustCoreGPU):
if F.device == 'gpu':
clone_F = Faust(core_obj=F.m_faust.clone(dev))
return clone_F
else:
......
......@@ -431,7 +431,7 @@ cdef class FaustCore:
# Left-Multiplication by a Faust F
# y=multiply(F,M) is equivalent to y=F*M
def multiply(self,M):
if(isinstance(M, (FaustCore, FaustCoreGPU))):
if isinstance(M, FaustCore):
return self.multiply_faust(M)
if not isinstance(M, np.ndarray):
raise ValueError('input M must be a numpy.ndarray')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment