Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 400ce8cc authored by hhakim's avatar hhakim
Browse files

Fix GPU pyfaust.Faust complex to real conversion.

Two bugs:
- the GPU device was ignored and the copy was going to CPU.
- The GPU Faust factors in subsequent slicing were rebuilt instead of using weak references.
parent 705cb537
No related branches found
No related tags found
No related merge requests found
......@@ -725,7 +725,7 @@ namespace Faust
//TODO: take optional arguments into account
GPUModHandler::get_singleton()->check_gpu_mod_loaded();
for(auto m: factors)
push_back(m);
push_back(m, cloning_fact);
}
template<typename FPP>
......
......@@ -2594,7 +2594,7 @@ class Faust(numpy.lib.mixins.NDArrayOperatorsMixin):
if F.dtype != 'complex':
# return Faust(csr_matrix(F.shape)) # TODO: debug pyx code
return Faust(csr_matrix((np.array([0.]).astype(F.dtype),
([0],[0])), (F.shape)))
([0],[0])), (F.shape)), dev=F.device)
else:
# return 1/2j * (F + F.conj())
I = _cplx2real_op(F)[F.shape[0]:2*F.shape[0],
......@@ -4741,7 +4741,8 @@ def check_dev(dev):
def _cplx2real_op(op):
if pyfaust.isFaust(op):
return Faust([_cplx2real_op(op.factors(i)) for i in range(op.numfactors())])
return Faust([_cplx2real_op(op.factors(i)) for i in
range(op.numfactors())], dev=op.device)
else:
rop = np.real(op) # doesn't change type for scipy matrix if it is one
iop = np.imag(op)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment