Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
faust
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
GitLab upgrade completed. Current version is 17.11.4.
Show more breadcrumbs
faust group
faust
Commits
4dc598c1
Commit
4dc598c1
authored
2 years ago
by
hhakim
Browse files
Options
Downloads
Patches
Plain Diff
Fix matfaust.Faust.single regression due to a
e2a04b60
workaround.
parent
d4b9f9ca
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
wrapper/matlab/tools/FaustCore.m
+22
-15
22 additions, 15 deletions
wrapper/matlab/tools/FaustCore.m
with
22 additions
and
15 deletions
wrapper/matlab/tools/FaustCore.m
+
22
−
15
View file @
4dc598c1
...
...
@@ -63,21 +63,28 @@ classdef FaustCore < handle
this
.
isRealFlag
=
varargin
{
2
};
this
.
dev
=
varargin
{
3
};
this
.
dtype
=
varargin
{
4
};
onGPU
=
startsWith
(
this
.
dev
,
'gpu'
);
% TODO: the copy of factors shouldn't be necessary
% it's here to fix a bug when for instance calling
% matfaust.fact.hierarchical/butterfly, the returned Faust is
% ok but F-M (for example) leads to a crash
% (it's probably because of matrix reference manager that is
% duplicated in static memory of different shared
% libraries/mexs -- still to verify. All Faust object must be
% managed by mexFaustReal/Cplx/Float, hence the copy)
nf
=
call_mex
(
this
,
'numfactors'
);
facts
=
cell
(
1
,
nf
);
for
i
=
1
:
nf
facts
{
i
}
=
call_mex
(
this
,
'factors'
,
i
);
end
this
=
FaustCore
(
facts
,
1.0
,
false
,
this
.
isRealFlag
,
this
.
dev
,
this
.
dtype
);
if
~
strcmp
(
this
.
dtype
,
'float'
)
onGPU
=
startsWith
(
this
.
dev
,
'gpu'
);
% TODO: the copy of factors shouldn't be necessary
% it's here to fix a bug when for instance calling
% matfaust.fact.hierarchical/butterfly, the returned Faust is
% ok but F-M (for example) leads to a crash
% (it's probably because of matrix reference manager that is
% duplicated in static memory of different shared
% libraries/mexs -- still to verify. All Faust object must be
% managed by mexFaustReal/Cplx/Float, hence the copy)
% we don't use this workaround for single precision Faust
% because sparse matrices in single precision aren't supported
% by matlab which lead to buffer type error
% (double instead of float in the cpp mexcode)
nf
=
call_mex
(
this
,
'numfactors'
);
facts
=
cell
(
1
,
nf
);
for
i
=
1
:
nf
facts
{
i
}
=
call_mex
(
this
,
'factors'
,
i
);
end
this
=
FaustCore
(
facts
,
1.0
,
false
,
this
.
isRealFlag
,
this
.
dev
,
this
.
dtype
);
end
elseif
(
nargin
>=
1
)
factors
=
varargin
{
1
};
scale
=
varargin
{
2
};
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment