Skip to content

Commit 219260b

Browse files
committed
Merge branch 'aurora_offloading_prototype' into sotoc-vla-arguments
Conflicts: tools/sotoc/test/arrays/global_array_static.c tools/sotoc/test/arrays/static_variable_length_array_2d.c tools/sotoc/test/arrays/variable_length_array_2d.c
2 parents 48f831a + 2acd695 commit 219260b

File tree

4 files changed

+55
-0
lines changed

4 files changed

+55
-0
lines changed

clang/tools/sotoc/test/arrays/static_variable_length_array_2d.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@ int main(){
1717
}
1818

1919
for (j = 0; j < size; j+=64) {
20+
<<<<<<< HEAD
2021
printf("%.2f %.2f ",A[j][0],A[j][1]);
22+
=======
23+
printf("%.2f %.2f",A[j][0],A[j][1]);
24+
>>>>>>> aurora_offloading_prototype
2125
}
2226
return 0;
2327
}

clang/tools/sotoc/test/arrays/variable_length_array_2d.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ int main(){
77
int sizeX=512;
88
int sizeY=512;
99
float A[sizeX][sizeY];
10+
1011
#pragma omp target map(tofrom:A[:sizeX][:sizeY])
1112
{
1213
int i;
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// RUN: %sotoc-transform-compile
2+
// RUN: %run-on-host | %filecheck %s
3+
#include <stdio.h>
4+
5+
#pragma omp declare target
6+
void execfunc(void(*func)(void)){
7+
func();
8+
}
9+
10+
void foo(){
11+
printf("42");
12+
fflush(0);
13+
}
14+
#pragma omp end declare target
15+
16+
int main(void) {
17+
18+
#pragma omp target device(0)
19+
{
20+
execfunc(&foo);
21+
}
22+
return 0;
23+
}
24+
25+
// CHECK: 42
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// RUN: %sotoc-transform-compile
2+
// RUN: %run-on-host | %filecheck %s
3+
#include <stdio.h>
4+
5+
void execfunc(void(*func)(void)){
6+
func();
7+
}
8+
9+
#pragma omp declare target
10+
void foo(){
11+
printf("42");
12+
fflush(0);
13+
}
14+
#pragma omp end declare target
15+
16+
int main(void) {
17+
18+
#pragma omp target device(0)
19+
{
20+
execfunc(&foo);
21+
}
22+
return 0;
23+
}
24+
25+
// CHECK: 42

0 commit comments

Comments
 (0)