-
Notifications
You must be signed in to change notification settings - Fork 11k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[openmp] Add addrspacecast to getOrCreateIdent
Fixes 51982. Adds a missing CreatePointerCast and allocates a global in the correct address space. Test case derived from https://github.com/ROCm-Developer-Tools/aomp/\ blob/aomp-dev/test/smoke/nest_call_par2/nest_call_par2.c by deleting parts while checking the assertion failure still occurred. Reviewed By: jdoerfert Differential Revision: https://reviews.llvm.org/D110556
- Loading branch information
1 parent
b75a748
commit 3247329
Showing
2 changed files
with
37 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// RUN: %libomptarget-compile-generic -O1 && %libomptarget-run-generic | ||
// -O1 to run openmp-opt | ||
|
||
int main(void) { | ||
long int aa = 0; | ||
|
||
int ng = 12; | ||
int nxyz = 5; | ||
|
||
const long exp = ng * nxyz; | ||
|
||
#pragma omp target map(tofrom : aa) | ||
for (int gid = 0; gid < nxyz; gid++) { | ||
#pragma omp parallel for | ||
for (unsigned int g = 0; g < ng; g++) { | ||
#pragma omp atomic | ||
aa += 1; | ||
} | ||
} | ||
if (aa != exp) { | ||
return 1; | ||
} | ||
return 0; | ||
} |