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
98c27ca5
Commit
98c27ca5
authored
4 years ago
by
hhakim
Browse files
Options
Downloads
Patches
Plain Diff
Add MatDense<FPP,GPU2>::operator= overloads (from CPU or GPU2 MatDense or CPU MatSparse).
parent
98dd2a57
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/faust_linear_operator/GPU2/faust_MatDense_gpu.h
+3
-0
3 additions, 0 deletions
src/faust_linear_operator/GPU2/faust_MatDense_gpu.h
src/faust_linear_operator/GPU2/faust_MatDense_gpu.hpp.in
+30
-0
30 additions, 0 deletions
src/faust_linear_operator/GPU2/faust_MatDense_gpu.hpp.in
with
33 additions
and
0 deletions
src/faust_linear_operator/GPU2/faust_MatDense_gpu.h
+
3
−
0
View file @
98c27ca5
...
...
@@ -16,6 +16,9 @@ namespace Faust
public:
MatDense
(
const
faust_unsigned_int
nbRow
,
const
faust_unsigned_int
nbCol
,
const
FPP
*
data
=
nullptr
,
const
bool
no_alloc
=
false
);
void
operator
=
(
const
MatDense
<
FPP
,
GPU2
>
&
A
);
void
operator
=
(
const
MatDense
<
FPP
,
Cpu
>
&
A
);
void
operator
=
(
const
MatSparse
<
FPP
,
Cpu
>
&
A
);
// *this = *this + A
void
add
(
const
MatDense
<
FPP
,
Cpu
>
&
A
);
void
add
(
const
MatDense
<
FPP
,
GPU2
>
&
A
);
...
...
This diff is collapsed.
Click to expand it.
src/faust_linear_operator/GPU2/faust_MatDense_gpu.hpp.in
+
30
−
0
View file @
98c27ca5
...
...
@@ -345,3 +345,33 @@ void Faust::MatDense<@FAUST_SCALAR_FOR_GM@, GPU2>::multiplyLeft(const MatSparse<
this->dim1 = S.getNbRow();
}
}
template<>
void Faust::MatDense<@FAUST_SCALAR_FOR_GM@, GPU2>::operator=(const MatDense<@FAUST_SCALAR_FOR_GM@, Cpu>& A)
{
auto dsm_funcs = ((gm_DenseMatFunc_@GM_SCALAR@*)this->dsm_funcs);
dim1 = A.getNbRow();
dim2 = A.getNbCol();
auto gpu_mat = dsm_funcs->togpu(dim1, dim2, const_cast<@FAUST_SCALAR_FOR_GM@*>(A.getData()));
dsm_funcs->free(this->gpu_mat);
this->gpu_mat = gpu_mat;
}
template<>
void Faust::MatDense<@FAUST_SCALAR_FOR_GM@, GPU2>::operator=(const MatSparse<@FAUST_SCALAR_FOR_GM@, Cpu>& A)
{
MatDense<@FAUST_SCALAR_FOR_GM@, Cpu> ds_A(A);
*(this) = ds_A;
}
template<>
void Faust::MatDense<@FAUST_SCALAR_FOR_GM@, GPU2>::operator=(const MatDense<@FAUST_SCALAR_FOR_GM@, GPU2>& A)
{
auto dsm_funcs = ((gm_DenseMatFunc_@GM_SCALAR@*)this->dsm_funcs);
auto gpu_mat = dsm_funcs->clone(A.gpu_mat);
dsm_funcs->free(this->gpu_mat);
this->gpu_mat = gpu_mat;
this->dim1 = A.dim1;
this->dim2 = A.dim2;
}
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