-
Notifications
You must be signed in to change notification settings - Fork 25
Starting modularization of the library. #64
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
Open
loiseaujc
wants to merge
14
commits into
fortran-lang:main
Choose a base branch
from
loiseaujc:linting
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 11 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
0bf1ed1
Linting (implicit none)
loiseaujc cfc19eb
All passb* functions in module.
loiseaujc 1402096
All passf* functions in module.
loiseaujc 301588f
All radb* functions in module.
loiseaujc e677a33
All radf* functions in module.
loiseaujc 048cd21
Clean-up
loiseaujc dfdab90
Replaced all rk with dp.
loiseaujc fccb760
Replaced rk with dp.
loiseaujc d061509
Fypp-ification of the fftpack_kinds module.
loiseaujc c4a84c3
Added examples in the coverage.
loiseaujc eda9429
Added all examples to the coverage.
loiseaujc 2dcb692
Apply suggestion from @zoziha
loiseaujc 35ec39f
Apply suggestion from @zoziha
loiseaujc 70d9d9a
Apply suggestion from @zoziha
loiseaujc 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
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
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 |
|---|---|---|
| @@ -1,43 +1,43 @@ | ||
| program bench1 | ||
| use fftpack, only: zffti, zfftf, zfftb | ||
| use fftpack_kind, only: rk | ||
| implicit none | ||
| complex(rk), allocatable :: z(:) | ||
| real(rk), allocatable :: w(:), x(:) | ||
| real(rk) :: err, time_init, time_forward, time_backward, t1, t2 | ||
| integer :: N | ||
| use fftpack, only: zffti, zfftf, zfftb | ||
| use fftpack_kinds, only: dp | ||
| implicit none | ||
| complex(dp), allocatable :: z(:) | ||
| real(dp), allocatable :: w(:), x(:) | ||
| real(dp) :: err, time_init, time_forward, time_backward, t1, t2 | ||
| integer :: N | ||
|
|
||
| N = 1024*1014*16 | ||
| N = 1024*1014*16 | ||
|
|
||
| allocate(x(N), z(N), w(4*N+15)) | ||
| call random_number(x) | ||
| z = x | ||
| allocate (x(N), z(N), w(4*N + 15)) | ||
| call random_number(x) | ||
| z = x | ||
|
|
||
| print *, "01: Benchmarking zfft" | ||
| print *, "Initializing" | ||
| call cpu_time(t1) | ||
| call zffti(N, w) | ||
| call cpu_time(t2) | ||
| time_init = t2-t1 | ||
| print *, "01: Benchmadping zfft" | ||
| print *, "Initializing" | ||
| call cpu_time(t1) | ||
| call zffti(N, w) | ||
| call cpu_time(t2) | ||
| time_init = t2 - t1 | ||
|
|
||
| print *, "Forward" | ||
| call cpu_time(t1) | ||
| call zfftf(N, z, w) | ||
| call cpu_time(t2) | ||
| time_forward = t2-t1 | ||
| print *, "Forward" | ||
| call cpu_time(t1) | ||
| call zfftf(N, z, w) | ||
| call cpu_time(t2) | ||
| time_forward = t2 - t1 | ||
|
|
||
| print *, "Backward" | ||
| call cpu_time(t1) | ||
| call zfftb(N, z, w) | ||
| call cpu_time(t2) | ||
| time_backward = t2-t1 | ||
| print *, "Done" | ||
| print *, "Backward" | ||
| call cpu_time(t1) | ||
| call zfftb(N, z, w) | ||
| call cpu_time(t2) | ||
| time_backward = t2 - t1 | ||
| print *, "Done" | ||
|
|
||
| err = maxval(abs(x-real(z/N,rk))) | ||
| print * | ||
| print *, "Error: ", err | ||
| print *, "Init time: ", time_init | ||
| print *, "Forward time: ", time_forward | ||
| print *, "Backward time: ", time_backward | ||
| print *, "" | ||
| err = maxval(abs(x - real(z/N, dp))) | ||
| print * | ||
| print *, "Error: ", err | ||
| print *, "Init time: ", time_init | ||
| print *, "Forward time: ", time_forward | ||
| print *, "Backward time: ", time_backward | ||
| print *, "" | ||
| end program | ||
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 |
|---|---|---|
| @@ -1,64 +1,64 @@ | ||
| program bench2 | ||
| use fftpack, only: zffti, zfftf, zfftb, fft, ifft | ||
| use fftpack_kind, only: rk | ||
| use fftpack, only: zffti, zfftf, zfftb, fft, ifft | ||
| use fftpack_kinds, only: dp | ||
|
|
||
| implicit none | ||
| integer, parameter :: N = 1024*135*77 ! (2**10)*(3**3)*5*7*11 | ||
| implicit none | ||
| integer, parameter :: N = 1024*135*77 ! (2**10)*(3**3)*5*7*11 | ||
|
|
||
| complex(rk), dimension(N) :: x, z | ||
| real(rk), dimension(4*N+15) :: w | ||
| real(rk) :: err, time_i, time_f, time_b, t1, t2 | ||
| complex(dp), dimension(N) :: x, z | ||
| real(dp), dimension(4*N + 15) :: w | ||
| real(dp) :: err, time_i, time_f, time_b, t1, t2 | ||
|
|
||
| call random_number(x%re) | ||
| z = x | ||
| call random_number(x%re) | ||
| z = x | ||
|
|
||
| print *, "02: Benchmarking zfft & fft" | ||
| print *, "02: Benchmadping zfft & fft" | ||
|
loiseaujc marked this conversation as resolved.
Outdated
|
||
|
|
||
| call cpu_time(t1) | ||
| call zffti(N, w) | ||
| call cpu_time(t2) | ||
| time_i = t2-t1 | ||
| print *, "Initializing: done" | ||
| call cpu_time(t1) | ||
| call zffti(N, w) | ||
| call cpu_time(t2) | ||
| time_i = t2 - t1 | ||
| print *, "Initializing: done" | ||
|
|
||
| call cpu_time(t1) | ||
| call zfftf(N, z, w) | ||
| call cpu_time(t2) | ||
| time_f = t2-t1 | ||
| print *, "Forward: done" | ||
| call cpu_time(t1) | ||
| call zfftf(N, z, w) | ||
| call cpu_time(t2) | ||
| time_f = t2 - t1 | ||
| print *, "Forward: done" | ||
|
|
||
| call cpu_time(t1) | ||
| call zfftb(N, z, w) | ||
| call cpu_time(t2) | ||
| time_b = t2-t1 | ||
| print *, "Backward: done" | ||
| print *, "" | ||
| call cpu_time(t1) | ||
| call zfftb(N, z, w) | ||
| call cpu_time(t2) | ||
| time_b = t2 - t1 | ||
| print *, "Backward: done" | ||
| print *, "" | ||
|
|
||
| err = maxval(abs(x-real(z/N,rk))) | ||
| print *, "--zfft" | ||
| print *, "Error: ", err | ||
| print *, "Init. time: ", time_i | ||
| print *, "Forward time: ", time_f | ||
| print *, "Backward time: ", time_b | ||
| print *, "" | ||
| err = maxval(abs(x - real(z/N, dp))) | ||
| print *, "--zfft" | ||
| print *, "Error: ", err | ||
| print *, "Init. time: ", time_i | ||
| print *, "Forward time: ", time_f | ||
| print *, "Backward time: ", time_b | ||
| print *, "" | ||
|
|
||
| print *, "Comparing to calls through fft" | ||
| call cpu_time(t1) | ||
| z = fft(x) | ||
| call cpu_time(t2) | ||
| time_f = t2-t1 | ||
| print *, "Init. & forward: done" | ||
| print *, "Comparing to calls through fft" | ||
| call cpu_time(t1) | ||
| z = fft(x) | ||
| call cpu_time(t2) | ||
| time_f = t2 - t1 | ||
| print *, "Init. & forward: done" | ||
|
|
||
| call cpu_time(t1) | ||
| z = ifft(z) | ||
| call cpu_time(t2) | ||
| time_b = t2-t1 | ||
| print *, "Backward: done" | ||
| print *, "" | ||
| call cpu_time(t1) | ||
| z = ifft(z) | ||
| call cpu_time(t2) | ||
| time_b = t2 - t1 | ||
| print *, "Backward: done" | ||
| print *, "" | ||
|
|
||
| err = maxval(abs(x-real(z/N,rk))) | ||
| print *, "--fft" | ||
| print *, "Error: ", err | ||
| print *, "Init. & forward time: ", time_f | ||
| print *, "Backward time: ", time_b | ||
| print *, "" | ||
| err = maxval(abs(x - real(z/N, dp))) | ||
| print *, "--fft" | ||
| print *, "Error: ", err | ||
| print *, "Init. & forward time: ", time_f | ||
| print *, "Backward time: ", time_b | ||
| print *, "" | ||
| end program | ||
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 |
|---|---|---|
| @@ -1,64 +1,64 @@ | ||
| program bench3 | ||
| use fftpack, only: dffti, dfftf, dfftb, rfft, irfft | ||
| use fftpack_kind, only: rk | ||
| use fftpack, only: dffti, dfftf, dfftb, rfft, irfft | ||
| use fftpack_kinds, only: dp | ||
|
|
||
| implicit none | ||
| integer, parameter :: N = 1024*135*77 ! (2**10)*(3**3)*5*7*11 | ||
| implicit none | ||
| integer, parameter :: N = 1024*135*77 ! (2**10)*(3**3)*5*7*11 | ||
|
|
||
| real(rk), dimension(N) :: x, y | ||
| real(rk), dimension(2*N+15) :: w | ||
| real(rk) :: err, time_i, time_f, time_b, t1, t2 | ||
| real(dp), dimension(N) :: x, y | ||
| real(dp), dimension(2*N + 15) :: w | ||
| real(dp) :: err, time_i, time_f, time_b, t1, t2 | ||
|
|
||
| call random_number(x) | ||
| y = x | ||
| call random_number(x) | ||
| y = x | ||
|
|
||
| print *, "03: Benchmarking dfft & rfft" | ||
| print *, "03: Benchmadping dfft & rfft" | ||
|
loiseaujc marked this conversation as resolved.
Outdated
|
||
|
|
||
| call cpu_time(t1) | ||
| call dffti(N, w) | ||
| call cpu_time(t2) | ||
| time_i = t2-t1 | ||
| print *, "Initializing: done" | ||
| call cpu_time(t1) | ||
| call dffti(N, w) | ||
| call cpu_time(t2) | ||
| time_i = t2 - t1 | ||
| print *, "Initializing: done" | ||
|
|
||
| call cpu_time(t1) | ||
| call dfftf(N, y, w) | ||
| call cpu_time(t2) | ||
| time_f = t2-t1 | ||
| print *, "Forward: done" | ||
| call cpu_time(t1) | ||
| call dfftf(N, y, w) | ||
| call cpu_time(t2) | ||
| time_f = t2 - t1 | ||
| print *, "Forward: done" | ||
|
|
||
| call cpu_time(t1) | ||
| call dfftb(N, y, w) | ||
| call cpu_time(t2) | ||
| time_b = t2-t1 | ||
| print *, "Backward: done" | ||
| print *, "" | ||
| call cpu_time(t1) | ||
| call dfftb(N, y, w) | ||
| call cpu_time(t2) | ||
| time_b = t2 - t1 | ||
| print *, "Backward: done" | ||
| print *, "" | ||
|
|
||
| err = maxval(abs(x-y/N)) | ||
| print *, "--dfft" | ||
| print *, "Error: ", err | ||
| print *, "Init. time: ", time_i | ||
| print *, "Forward time: ", time_f | ||
| print *, "Backward time: ", time_b | ||
| print *, "" | ||
| err = maxval(abs(x - y/N)) | ||
| print *, "--dfft" | ||
| print *, "Error: ", err | ||
| print *, "Init. time: ", time_i | ||
| print *, "Forward time: ", time_f | ||
| print *, "Backward time: ", time_b | ||
| print *, "" | ||
|
|
||
| print *, "Comparing to calls through rfft" | ||
| call cpu_time(t1) | ||
| y = rfft(x) | ||
| call cpu_time(t2) | ||
| time_f = t2-t1 | ||
| print *, "Init. & forward: done" | ||
| print *, "Comparing to calls through rfft" | ||
| call cpu_time(t1) | ||
| y = rfft(x) | ||
| call cpu_time(t2) | ||
| time_f = t2 - t1 | ||
| print *, "Init. & forward: done" | ||
|
|
||
| call cpu_time(t1) | ||
| y = irfft(y) | ||
| call cpu_time(t2) | ||
| time_b = t2-t1 | ||
| print *, "Backward: done" | ||
| print *, "" | ||
| call cpu_time(t1) | ||
| y = irfft(y) | ||
| call cpu_time(t2) | ||
| time_b = t2 - t1 | ||
| print *, "Backward: done" | ||
| print *, "" | ||
|
|
||
| err = maxval(abs(x-y/N)) | ||
| print *, "--rfft" | ||
| print *, "Error: ", err | ||
| print *, "Init. & forward time: ", time_f | ||
| print *, "Backward time: ", time_b | ||
| print *, "" | ||
| err = maxval(abs(x - y/N)) | ||
| print *, "--rfft" | ||
| print *, "Error: ", err | ||
| print *, "Init. & forward time: ", time_f | ||
| print *, "Backward time: ", time_b | ||
| print *, "" | ||
| end program | ||
Oops, something went wrong.
Oops, something went wrong.
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.