forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'sotoc-vla-arguments' into 'aurora_offloading_prototype'
Fix generated target region parameters for multidimensional VLAs Closes llvm#28 See merge request NEC-RWTH-Projects/clang!21
- Loading branch information
Showing
13 changed files
with
115 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
clang/tools/sotoc/test/arrays/static_variable_length_array_2d_sw.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// RUN: %sotoc-transform-compile | ||
// RUN: %run-on-host | %filecheck %s | ||
|
||
#include <stdio.h> | ||
int main(){ | ||
int j; | ||
int size=512; | ||
float A[2][size]; | ||
|
||
#pragma omp target map(tofrom:A[:2][:size]) | ||
{ | ||
int i; | ||
for(i=0; i< size; i++){ | ||
A[0][i]=i; | ||
A[1][i]=i+1; | ||
} | ||
} | ||
|
||
for (j = 0; j < size; j+=64) { | ||
printf("%.2f %.2f ",A[0][j],A[1][j]); | ||
} | ||
return 0; | ||
} | ||
|
||
// CHECK: 0.00 1.00 64.00 65.00 128.00 129.00 192.00 193.00 256.00 257.00 320.00 321.00 384.00 385.00 448.00 449.00 |
28 changes: 28 additions & 0 deletions
28
clang/tools/sotoc/test/arrays/static_variable_length_array_3d.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// RUN: %sotoc-transform-compile | ||
// RUN: %run-on-host | %filecheck %s | ||
|
||
#include <stdio.h> | ||
int main(){ | ||
int j; | ||
int size=512; | ||
float A[size][2][5]; | ||
|
||
#pragma omp target map(tofrom:A[:size][:2][:5]) | ||
{ | ||
int k; | ||
int i; | ||
for(i=0; i< size; i++){ | ||
for(k=0; k< 5; k++){ | ||
A[i][0][k]=i; | ||
A[i][1][k]=i+1; | ||
} | ||
} | ||
} | ||
|
||
for (j = 0; j < size; j+=64) { | ||
printf("%.2f %.2f ",A[j][0][3],A[j][1][2]); | ||
} | ||
return 0; | ||
} | ||
|
||
// CHECK: 0.00 1.00 64.00 65.00 128.00 129.00 192.00 193.00 256.00 257.00 320.00 321.00 384.00 385.00 448.00 449.00 |
28 changes: 28 additions & 0 deletions
28
clang/tools/sotoc/test/arrays/static_variable_length_array_3d_sw.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// RUN: %sotoc-transform-compile | ||
// RUN: %run-on-host | %filecheck %s | ||
|
||
#include <stdio.h> | ||
int main(){ | ||
int j; | ||
int size=512; | ||
float A[2][size][5]; | ||
|
||
#pragma omp target map(tofrom:A[:2][:size][:5]) | ||
{ | ||
int i; | ||
int k; | ||
for(i=0; i< size; i++){ | ||
for(k=0; k< 5; k++){ | ||
A[0][i][k]=i; | ||
A[1][i][k]=i+1; | ||
} | ||
} | ||
} | ||
|
||
for (j = 0; j < size; j+=64) { | ||
printf("%.2f %.2f ",A[0][j][3],A[1][j][2]); | ||
} | ||
return 0; | ||
} | ||
|
||
// CHECK: 0.00 1.00 64.00 65.00 128.00 129.00 192.00 193.00 256.00 257.00 320.00 321.00 384.00 385.00 448.00 449.00 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters