-
Notifications
You must be signed in to change notification settings - Fork 25
Adding the first workdistribute test #889
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
481a43e
Adding the first workdistribute test
andrewkallai ed7ae07
Fixed offloading check.
andrewkallai 5fc515c
Update tests/6.0/workdistribute/test_workdistribute_directive.F90
spophale 0721159
temporary state workdistribute
andrewkallai 7f1b2f2
Merge branch 'test_workdistribute' of https://github.com/OpenMP-Valid…
andrewkallai abe988d
workdistribute update
andrewkallai ce38886
Adding changes
andrewkallai 35ee100
Adding changes
andrewkallai fe13c7c
Update tests/6.0/workdistribute/test_workdistribute_directive.F90
andrewkallai d67a684
Removed comments to comment back in the pragmas and other critical pi…
andrewkallai d2b3c84
Removed unecessary pragmas
andrewkallai b1a9137
Change directives to just have target
andrewkallai 5d7e08d
Adding comments back in
andrewkallai 562fbe6
Updated N parameter
andrewkallai File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
56 changes: 56 additions & 0 deletions
56
tests/6.0/workdistribute/test_workdistribute_directive.F90
This file contains hidden or 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,56 @@ | ||
| !===----test_workdistribute_directive.F90-----------------------------------===// | ||
| ! | ||
| ! OpenMP API Version 6.0 | ||
| ! | ||
| ! This test checks if the workdistribute passed to the nowait clause | ||
spophale marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ! | ||
| !===------------------------------------------------------------------------===// | ||
|
|
||
| #include "ompvv.F90" | ||
|
|
||
| module axpy_mod | ||
| implicit none | ||
| contains | ||
| subroutine axpy_workdistribute(a, x, y, n) | ||
| implicit none | ||
| integer :: n | ||
| real :: a | ||
| real, dimension(n) :: x | ||
| real, dimension(n) :: y | ||
| !$omp target teams workdistribute map(to:x) map(tofrom:y) | ||
| y = a * x + y | ||
| !$omp end target teams workdistribute | ||
| end subroutine axpy_workdistribute | ||
| end module axpy_mod | ||
|
|
||
| program test_omp_workdistribute | ||
| use iso_fortran_env | ||
| use ompvv_lib | ||
| use omp_lib | ||
| use axpy_mod, only: axpy_workdistribute | ||
| implicit none | ||
|
|
||
| !OMPVV_TEST_OFFLOADING | ||
|
|
||
| integer :: errors = 0 | ||
| integer, parameter :: N = 1024 * 1024 | ||
| real :: a | ||
| real :: x0 | ||
| real :: y0 | ||
| real, dimension(N) :: x | ||
| real, dimension(N) :: y | ||
| a = 2.0 | ||
| x = 2.0 ! initialize arrays | ||
| y = 1.0 | ||
| x0 = 2.0 ! initialize scalars for validation | ||
| y0 = 1.0 | ||
|
|
||
| call axpy_workdistribute(a, x, y, N) | ||
| IF (sum(y) / N .NE. a * x0 + y0) THEN | ||
| errors = errors + 1 | ||
| END IF | ||
| !write (*,'(A,F4.2,A,F4.2)') 'sum ', sum(y) / N, ' expected ', a * x0 + y0 | ||
andrewkallai marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| OMPVV_ERROR_IF(errors /= 0, "The workdistribute directive did not perform as expected.") | ||
| OMPVV_REPORT_AND_RETURN() | ||
| end program test_omp_workdistribute | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.