-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1f1a5ba
commit 1cdbf6d
Showing
10 changed files
with
171 additions
and
25 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
# nvidia | ||
*.ncu-rep | ||
|
||
|
||
### Custom #### | ||
_build | ||
_local | ||
|
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
program call_identity_cffi_plugin | ||
use openacc | ||
use, intrinsic :: iso_c_binding | ||
use identity_plugin | ||
implicit none | ||
integer(c_int) :: cdim, kdim, i, rc | ||
real(c_double), dimension(:, :), allocatable :: input | ||
|
||
! array dimensions | ||
cdim = 5 | ||
kdim = 5 | ||
|
||
! allocate arrays (allocate in column-major order) | ||
allocate(input(cdim, kdim)) | ||
|
||
! initialise arrays | ||
input = 5.0d0 | ||
|
||
! print array shapes and values before computation | ||
print *, "Fortran Arrays before calling Python:" | ||
print *, "input = ", input | ||
print * | ||
|
||
!$acc enter data create(input) | ||
! call cffi code | ||
call identity(input, rc) | ||
|
||
if (rc /= 0) then | ||
print *, "Python failed with exit code = ", rc | ||
call exit(1) | ||
end if | ||
|
||
!$acc update host(input) | ||
|
||
print *, "input after calling Python = ", input | ||
print * | ||
|
||
!$acc exit data delete(input) | ||
|
||
deallocate (input) | ||
|
||
end program call_identity_cffi_plugin |
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