Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
las3_pub
/
predictable_parallel_patterns
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
449a89ef
authored
Jun 14, 2019
by
FritzFlorian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test for invoke.
parent
ee8414cf
Pipeline
#1267
failed with stages
in 37 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
0 deletions
+25
-0
test/algorithm_test.cpp
+25
-0
No files found.
test/algorithm_test.cpp
View file @
449a89ef
...
@@ -61,3 +61,28 @@ TEST_CASE("scan functions correctly", "[algorithms/scan.h]") {
...
@@ -61,3 +61,28 @@ TEST_CASE("scan functions correctly", "[algorithms/scan.h]") {
REQUIRE
(
all_correct
);
REQUIRE
(
all_correct
);
});
});
}
}
long
fib
(
long
n
)
{
if
(
n
<=
2
)
{
return
1
;
}
long
a
,
b
;
pls
::
invoke
(
[
&
a
,
n
]()
{
a
=
fib
(
n
-
1
);
},
[
&
b
,
n
]()
{
b
=
fib
(
n
-
2
);
}
);
return
a
+
b
;
}
TEST_CASE
(
"invoke functions correctly"
,
"[algorithms/invoke.h]"
)
{
constexpr
long
fib_40
=
102334155
;
malloc_scheduler_memory
my_scheduler_memory
{
8
,
2
<<
12
};
scheduler
my_scheduler
{
&
my_scheduler_memory
,
2
};
my_scheduler
.
perform_work
([
=
]()
{
REQUIRE
(
fib
(
40
)
==
fib_40
);
});
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment