Add taskiter NODES test
This commit is contained in:
parent
26d01d18eb
commit
3c6c6ed230
@ -1,4 +1,4 @@
|
||||
# Copyright (c) 2022 Barcelona Supercomputing Center (BSC)
|
||||
# Copyright (c) 2022-2023 Barcelona Supercomputing Center (BSC)
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
find_package(Nodes)
|
||||
@ -41,3 +41,4 @@ nodes_rt_test(../nanos6/nested-task.c NAME nested-task SORT)
|
||||
nodes_rt_test(../nanos6/several-tasks.c NAME several-tasks SORT)
|
||||
nodes_rt_test(../nanos6/if0.c NAME if0 SORT)
|
||||
nodes_rt_test(../nanos6/sched-add.c NAME sched-add SORT)
|
||||
nodes_rt_test(taskiter.c SORT)
|
||||
|
26
test/rt/nodes/taskiter.c
Normal file
26
test/rt/nodes/taskiter.c
Normal file
@ -0,0 +1,26 @@
|
||||
/* Copyright (c) 2023 Barcelona Supercomputing Center (BSC)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later */
|
||||
|
||||
#include "compat.h"
|
||||
#include <stdio.h>
|
||||
|
||||
/* Adapted from Listing 2 of https://arxiv.org/pdf/2208.06332.pdf */
|
||||
|
||||
int
|
||||
main(void)
|
||||
{
|
||||
int A;
|
||||
#pragma oss task out(A)
|
||||
A = 1;
|
||||
|
||||
#pragma oss taskiter in(A) out(A)
|
||||
for (int i = 0; i < 10; i++) {
|
||||
#pragma oss task in(A)
|
||||
sleep_us(10 + A);
|
||||
#pragma oss task out(A)
|
||||
A = A + 1;
|
||||
}
|
||||
|
||||
# pragma oss task in(A)
|
||||
printf("A=%d\n", A);
|
||||
}
|
Loading…
Reference in New Issue
Block a user