Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
typon
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
cython-plus
typon
Commits
35bcc206
Commit
35bcc206
authored
May 09, 2022
by
Xavier Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adapt test programs
parent
1e6161c9
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
15 additions
and
15 deletions
+15
-15
rt/test/exceptions.cpp
rt/test/exceptions.cpp
+1
-1
rt/test/fibo.cpp
rt/test/fibo.cpp
+1
-1
rt/test/forkjoin.cpp
rt/test/forkjoin.cpp
+6
-6
rt/test/forkjoin_fibo.cpp
rt/test/forkjoin_fibo.cpp
+2
-2
rt/test/loop.cpp
rt/test/loop.cpp
+1
-1
rt/test/main.cpp
rt/test/main.cpp
+1
-1
rt/test/root.cpp
rt/test/root.cpp
+1
-1
rt/test/test_discard.cpp
rt/test/test_discard.cpp
+1
-1
rt/test/test_inline.cpp
rt/test/test_inline.cpp
+1
-1
No files found.
rt/test/exceptions.cpp
View file @
35bcc206
...
...
@@ -25,7 +25,7 @@ Join<void> fail_join() {
}
Join
<
void
>
join
(
int
max
)
{
std
::
vector
<
Future
<
core
::
Fork
<
int
>::
promise_type
>>
v
;
std
::
vector
<
Future
<
Fork
<
int
>::
promise_type
>>
v
;
for
(
int
i
=
0
;
i
<
max
;
i
++
)
{
v
.
push_back
(
co_await
fork
(
fib
()));
}
...
...
rt/test/fibo.cpp
View file @
35bcc206
...
...
@@ -2,7 +2,7 @@
#include <cstdio>
using
namespace
typon
::
core
;
using
namespace
typon
;
Task
<
int
>
fibo
(
int
n
)
{
if
(
n
<
2
)
{
...
...
rt/test/forkjoin.cpp
View file @
35bcc206
...
...
@@ -14,7 +14,7 @@ Task<void> hello(int i) {
int
n
=
fibo
(
10
);
(
void
)
i
;
(
void
)
n
;
printf
(
"hello from %d on %u, fibo(40) = %d
\n
"
,
i
,
core
::
Scheduler
::
thread_id
,
n
);
printf
(
"hello from %d on %u, fibo(40) = %d
\n
"
,
i
,
Scheduler
::
thread_id
,
n
);
// printf("hello from %d on %lu, fibo(40) = %d\n", i, riften::detail::static_id, n);
co_return
;
}
...
...
@@ -22,24 +22,24 @@ Task<void> hello(int i) {
Join
<
void
>
parallel
()
{
for
(
int
i
=
0
;
i
<
30
;
i
++
)
{
co_await
fork
(
hello
(
i
));
printf
(
"parallel resumed on %u
\n
"
,
core
::
Scheduler
::
thread_id
);
printf
(
"parallel resumed on %u
\n
"
,
Scheduler
::
thread_id
);
// printf("parallel resumed on %lu\n", riften::detail::static_id);
}
printf
(
"parallel syncing on %u
\n
"
,
core
::
Scheduler
::
thread_id
);
printf
(
"parallel syncing on %u
\n
"
,
Scheduler
::
thread_id
);
// printf("parallel syncing on %lu\n", riften::detail::static_id);
co_await
Sync
();
printf
(
"parallel resumed on %u
\n
"
,
core
::
Scheduler
::
thread_id
);
printf
(
"parallel resumed on %u
\n
"
,
Scheduler
::
thread_id
);
// printf("parallel resumed on %lu\n", riften::detail::static_id);
for
(
int
i
=
30
;
i
<
60
;
i
++
)
{
co_await
fork
(
hello
(
i
));
printf
(
"parallel resumed on %u
\n
"
,
core
::
Scheduler
::
thread_id
);
printf
(
"parallel resumed on %u
\n
"
,
Scheduler
::
thread_id
);
// printf("parallel resumed on %lu\n", riften::detail::static_id);
}
}
Root
root
()
{
co_await
parallel
();
printf
(
"root resumed on %u
\n
"
,
core
::
Scheduler
::
thread_id
);
printf
(
"root resumed on %u
\n
"
,
Scheduler
::
thread_id
);
}
int
main
()
{
...
...
rt/test/forkjoin_fibo.cpp
View file @
35bcc206
...
...
@@ -8,8 +8,8 @@ Join<int> fibo(int n) {
if
(
n
<
2
)
{
co_return
n
;
}
core
::
Future
a
=
co_await
fork
(
fibo
(
n
-
1
));
core
::
Future
b
=
co_await
fork
(
fibo
(
n
-
2
));
Future
a
=
co_await
fork
(
fibo
(
n
-
1
));
Future
b
=
co_await
fork
(
fibo
(
n
-
2
));
co_await
Sync
();
co_return
a
.
get
()
+
b
.
get
();
}
...
...
rt/test/loop.cpp
View file @
35bcc206
...
...
@@ -2,7 +2,7 @@
#include <cstdio>
using
namespace
typon
::
core
;
using
namespace
typon
;
Task
<
int
>
add
(
int
a
,
int
b
)
{
co_return
a
+
b
;
...
...
rt/test/main.cpp
View file @
35bcc206
...
...
@@ -2,7 +2,7 @@
#include <cstdio>
using
namespace
typon
::
core
;
using
namespace
typon
;
Task
<
int
>
fibo
(
int
n
)
{
if
(
n
<
2
)
{
...
...
rt/test/root.cpp
View file @
35bcc206
...
...
@@ -5,7 +5,7 @@
using
namespace
typon
;
Root
root
()
{
printf
(
"root resumed on %u
\n
"
,
core
::
Scheduler
::
thread_id
);
printf
(
"root resumed on %u
\n
"
,
Scheduler
::
thread_id
);
co_return
;
}
...
...
rt/test/test_discard.cpp
View file @
35bcc206
...
...
@@ -2,7 +2,7 @@
#include <cstdio>
using
namespace
typon
::
core
;
using
namespace
typon
;
Task
<
int
>
add
(
int
a
,
int
b
)
{
printf
(
"add(%d, %d)
\n
"
,
a
,
b
);
...
...
rt/test/test_inline.cpp
View file @
35bcc206
...
...
@@ -2,7 +2,7 @@
#include <cstdio>
using
namespace
typon
::
core
;
using
namespace
typon
;
Task
<
int
>
add
(
int
a
,
int
b
)
{
co_return
a
+
b
;
...
...
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