Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tnl-dev
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor 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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
TNL
tnl-dev
Commits
a1d4cee6
There was an error fetching the commit references. Please try again later.
Commit
a1d4cee6
authored
3 years ago
by
Tomáš Oberhuber
Committed by
Jakub Klinkovský
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fixing parallel static Euler solver test to work with nvcc.
parent
355d82a6
No related branches found
No related tags found
1 merge request
!125
ODE solvers
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/UnitTests/Solvers/ODE/ODEStaticSolverTest.h
+16
-7
16 additions, 7 deletions
src/UnitTests/Solvers/ODE/ODEStaticSolverTest.h
with
16 additions
and
7 deletions
src/UnitTests/Solvers/ODE/ODEStaticSolverTest.h
+
16
−
7
View file @
a1d4cee6
...
...
@@ -84,16 +84,20 @@ void ODENumericSolverTest_ParallelLinearFunctionTest()
const
RealType
final_time
=
10.0
;
TNL
::
Containers
::
Vector
<
RealType
,
Device
>
u
(
size
,
0.0
);
auto
u_view
=
u
.
getView
();
auto
inner_f
=
[]
__cuda_callable__
(
const
RealType
&
time
,
const
RealType
&
tau
,
const
RealType
&
u
,
RealType
&
fu
)
{
fu
=
time
;
};
auto
f
=
[
=
]
__cuda_callable__
(
int
idx
)
mutable
{
SolverType
solver
;
solver
.
setTime
(
0.0
);
solver
.
setStopTime
(
final_time
);
solver
.
setTau
(
0.005
);
solver
.
setConvergenceResidue
(
0.0
);
solver
.
solve
(
u_view
[
idx
],
[]
__cuda_callable__
(
const
RealType
&
time
,
const
RealType
&
tau
,
const
RealType
&
u
,
RealType
&
fu
)
{
fu
=
time
;
}
);
solver
.
solve
(
u_view
[
idx
],
inner_f
);
// The following is not accepted by nvcc
//solver.solve( u_view[ idx ], [] __cuda_callable__ ( const RealType& time, const RealType& tau, const RealType& u, RealType& fu ) {
// fu = time;
//} );
};
TNL
::
Algorithms
::
ParallelFor
<
Device
>::
exec
(
0
,
size
,
f
);
...
...
@@ -154,16 +158,21 @@ void ODEStaticSolverTest_ParallelLinearFunctionTest()
const
RealType
final_time
=
10.0
;
TNL
::
Containers
::
Vector
<
DofContainerType
,
Device
>
u
(
size
,
0.0
);
auto
u_view
=
u
.
getView
();
auto
inner_f
=
[
=
]
__cuda_callable__
(
const
RealType
&
time
,
const
RealType
&
tau
,
const
DofContainerType
&
u
,
DofContainerType
&
fu
)
{
fu
=
time
;
};
auto
f
=
[
=
]
__cuda_callable__
(
int
idx
)
mutable
{
SolverType
solver
;
solver
.
setTime
(
0.0
);
solver
.
setStopTime
(
final_time
);
solver
.
setTau
(
0.005
);
solver
.
setConvergenceResidue
(
0.0
);
solver
.
solve
(
u_view
[
idx
],
inner_f
);
solver
.
solve
(
u_view
[
idx
],
[]
__cuda_callable__
(
const
RealType
&
time
,
const
RealType
&
tau
,
const
DofContainerType
&
u
,
DofContainerType
&
fu
)
{
fu
=
time
;
}
);
// The following is not accepted by nvcc compiler
//solver.solve( u_view[ idx ], [] __cuda_callable__ ( const RealType& time, const RealType& tau, const DofContainerType& u, DofContainerType& fu ) {
// fu = time;
//} );
};
TNL
::
Algorithms
::
ParallelFor
<
Device
>::
exec
(
0
,
size
,
f
);
...
...
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