Skip to content
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

WiP: Support derived types and make kernels look more like original Fortran code #40

Open
wants to merge 402 commits into
base: develop-acc
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
402 commits
Select commit Hold shift + click to select a range
be82104
(WiP) memcpy check is backend specific
domcharrier Mar 23, 2022
1c5498d
(WiP) Workaround: Do not lookup C type for character, always assume char
domcharrier Mar 23, 2022
389731c
(WiP) Do not identify 'module procedure' as 'module' statement
domcharrier Mar 23, 2022
c853345
(WiP) Add '\b' around end/else in util.parsing.tokenize regexes
domcharrier Mar 23, 2022
0d63de9
(WiP) Improve declaration parsing
domcharrier Mar 23, 2022
c8bb972
(WiP) More modules to ignore
domcharrier Mar 23, 2022
f782eee
(WiP) Scanner should also not interpret module procedure as module
domcharrier Mar 23, 2022
cf4e7fa
util/parsing: Break apart expression group as matching expressions wi…
domcharrier Mar 23, 2022
dc440e4
indexer: Adopt default python package as it appears robuster than orj…
domcharrier Mar 23, 2022
f40a093
WiP: Expanding array assignment operations (unstable)
domcharrier Mar 25, 2022
97a303e
(WiP) Add kernels example. Builds & passes
domcharrier Mar 28, 2022
43105e4
Add previously missing file
domcharrier Mar 28, 2022
9fcc8c6
(WiP) Added accidentally removed line
domcharrier Mar 28, 2022
5f55860
(WiP) Token-based parser: +allocate parser, improve use stmt parser
domcharrier Mar 29, 2022
13c7909
(WiP) Streamlined code generation further
domcharrier Mar 29, 2022
57e3f80
WiP on loopnest identification
domcharrier Mar 29, 2022
823501a
(WiP) Scanner workaround for functions with prefixed return value
domcharrier Mar 29, 2022
9c751c9
(WiP) Add integer c_char to default conv. table
domcharrier Mar 29, 2022
ccc1082
(WiP): Derive c_type only if needed in C++ kernel
domcharrier Mar 29, 2022
3149cc3
(WiP) converter: Do not read other gpufort mod files if we just want …
domcharrier Mar 29, 2022
87f52f1
(WiP) Minimized ACC kernels example
domcharrier Mar 29, 2022
8903825
(WiP) Add first impl of host_data via associate + example
domcharrier Mar 29, 2022
946d0d7
(WiP) Fix tokenizer issue that prevented splitting end(if|do) elseif
domcharrier Mar 30, 2022
1e0c8a6
(WiP) translator: Only collect tensors/call nodes that have been iden…
domcharrier Mar 30, 2022
fc8c0d8
acc kernels: Fix kernelgen when bounds unspecified
domcharrier Apr 4, 2022
26b4c0d
Makefile: Fix target name, regenerate shared gpufort_array.h
domcharrier Apr 4, 2022
3407722
indexer/scope: More robust tag comparison
domcharrier Apr 4, 2022
2b520e9
(WiP,unstable) Commit because dev machine might be migrated tomorrow
domcharrier Apr 5, 2022
e9db4b4
(WiP, unstable) Last changes
domcharrier Apr 5, 2022
dcc1a10
(WiP) Group consec. use module statements if possible
domcharrier Apr 6, 2022
e920bb3
(WiP) Add file and (first) line number to error messages
domcharrier Apr 6, 2022
36ad971
WiP: Add ignore case check to use stmt parsing
domcharrier Apr 6, 2022
af372dd
(WiP) Add switch to touch C++ files ...
domcharrier Apr 6, 2022
de531dc
(WiP) Perform actual deep copies where I intended to do so
domcharrier Apr 6, 2022
aa90fbd
(WiP) Fix issue in 'lookup' of ignored modules
domcharrier Apr 7, 2022
ef8fefd
(WiP) Do not assume line breaks in C preproc. directives anymore
domcharrier Apr 7, 2022
5bda7ef
(WiP) share/gpufort_sources: Add gpufort.h
domcharrier Apr 7, 2022
3d971c7
(WiP) Fix allocate, deallocate parsing. All tests pass again
domcharrier Apr 7, 2022
aebac91
(WiP)grammar: Allow whitespace between label and colon
domcharrier Apr 7, 2022
05c02c0
(WiP)collapsing: Simpler check if thread idx...
domcharrier Apr 7, 2022
0b74064
(WiP)indexer: Add mpi module to ignore list
domcharrier Apr 7, 2022
31c6291
(WiP) Cleaner HIP output, add loop_length device routine
domcharrier Apr 7, 2022
d8dff88
(WiP) Multiple changes
domcharrier Apr 8, 2022
36a80de
(WiP) Add option for passing scalar derived type members as scalar arg
domcharrier Apr 8, 2022
d91ea1e
(WiP) Some loop collapsing output tuning.
domcharrier Apr 8, 2022
c1b1417
codegen: proc. conv: Check correct value for none
domcharrier Apr 11, 2022
64fc3ba
(WiP) Outsource macro evaluation into separate pkg
domcharrier Apr 11, 2022
bc80494
(WiP) translator: Generate less brackets for arithm. expr
domcharrier Apr 11, 2022
772b150
(WiP) 1st impl. of statement functions as macros
domcharrier Apr 11, 2022
3e748be
(WiP): relocate_inline_comments: Remove blank lines
domcharrier Apr 11, 2022
21c2378
(WiP)Token-based reimpl of 2 util.parsing routine
domcharrier Apr 11, 2022
91b0754
(WiP) Fix scope reusing. Extend test case
domcharrier Apr 12, 2022
86d0372
(WiP) Fix line continuation issue within directive
domcharrier Apr 12, 2022
c7bd2bb
(WiP) Add token-based parser for function stmt
domcharrier Apr 12, 2022
2c88c4a
(WiP) Add token-based parser for type statement
domcharrier Apr 13, 2022
b9b95a7
(WiP) indexer: Token-based parser for type/...
domcharrier Apr 13, 2022
3878fe7
(WiP)scanner:stmt func only 4 integer,real,logical
domcharrier Apr 13, 2022
d686978
(WiP) indexer: Fix return variable creation
domcharrier Apr 13, 2022
9098525
(WiP) util.parsing: Return dummy args as empty list by default
domcharrier Apr 13, 2022
cb68740
(WiP)indexer: include scope tag in lookup error
domcharrier Apr 13, 2022
0bbabe3
(WiP) Lookup c_type before rendering interop derived type
domcharrier Apr 13, 2022
2da6a1c
(WiP)scanner/indexer: Attempt to clean up parser loops
domcharrier Apr 13, 2022
a9f975c
(WiP) Add new parser stability test
domcharrier Apr 13, 2022
17fddd6
(WiP) Edit help message
domcharrier Apr 13, 2022
04459ec
(WiP) gpufort(fc)?: change flag append env var
domcharrier Apr 13, 2022
0536b63
(WiP)scanner:Log where line recording starts/stops
domcharrier Apr 13, 2022
865fc61
(WiP)Fix: It's legal to specify dimension and var bounds
domcharrier Apr 13, 2022
2eea729
(WiP)Fix:indexer: overwrite dimens. if var bounds
domcharrier Apr 13, 2022
8535216
(WiP)Workaround for statement functions
domcharrier Apr 13, 2022
114d306
(WiP):Stmt func: Wrap args/subst in ()
domcharrier Apr 13, 2022
510d7e7
(WiP) Parse high-level structure of do-loop token-based
domcharrier Apr 13, 2022
738b99e
(WiP) Multiple fixes:
domcharrier Apr 13, 2022
dc87bcb
(WiP)translator: Replace .and./.or. by logical ops
domcharrier Apr 13, 2022
6fa02e8
(WiP) Add check for where
domcharrier Apr 13, 2022
0ec8479
(WiP): Add switch to not map derived types at all
domcharrier Apr 13, 2022
666b2a1
(WiP)macros/linemapper: Fix preproc issues
domcharrier Apr 14, 2022
71c2811
(WiP) Fix: -> raise
domcharrier Apr 14, 2022
6cfb0c4
(WiP)Array expr expansion: Fix issue if ubound is type member
domcharrier Apr 14, 2022
9cd3d8e
(WiP) Fix: IValue op applied to _value member
domcharrier Apr 14, 2022
39e92d6
(WiP)Add test for update of derived type members
domcharrier Apr 14, 2022
5cd0b71
(WiP)Backend support for acc update if&if_present
domcharrier Apr 14, 2022
bd0aa82
(WiP) Remove legacy test files
domcharrier Apr 14, 2022
f4650fc
(WiP) Couple of fixes
domcharrier Apr 14, 2022
e80f829
(WiP) Restore deleted file. All tests pass again
domcharrier Apr 14, 2022
ab161ba
(WiP) Latest fixes.
domcharrier Apr 14, 2022
2d554df
util.parsing: tokenize according to more complex expr. first
domcharrier Apr 15, 2022
df65eae
translator/parser: Ensure whitespaces between operators and operands
domcharrier Apr 15, 2022
498ee65
scanner/parser: Add error message if array ...
domcharrier Apr 15, 2022
c55abb6
(WiP) Streamline grammar (more work to do)
domcharrier Apr 15, 2022
59cd85a
(WiP)Basic support for array expr sans colons
domcharrier Apr 19, 2022
0d78301
(WiP,unstable) Saving WiP
domcharrier Apr 19, 2022
604c072
(WiP,unstable)Towards mapping subarrays
domcharrier Apr 20, 2022
0246e12
(WiP) Unified parts of grammar, some support for subarray expressions
domcharrier Apr 21, 2022
1c1ab56
(WiP) Some basic support for do <int> ... <int> continue
domcharrier Apr 21, 2022
72d474f
(WiP) Add support for goto & shared do loop stmt numbers
domcharrier Apr 21, 2022
902cba3
(WiP) Towards support of acc serial
domcharrier Apr 21, 2022
fbcc585
(WiP) Acc serial example runs successfully
domcharrier Apr 22, 2022
a68a0cc
(WiP) Switch to token-based parser for procedures
domcharrier Apr 22, 2022
2adfe45
(WiP) More robust detection of multi-statement lines
domcharrier Apr 22, 2022
4bed827
(WiP) Consider parameter statement
domcharrier Apr 24, 2022
b2e4ef4
(WiP) More sophisticated assignment detection
domcharrier Apr 25, 2022
7dc1edc
(WiP) Reenable if.
domcharrier Apr 25, 2022
14c6205
(WiP) fort2x.hip: Introduce namespace per program/procedure scope
domcharrier Apr 25, 2022
becc1d6
(WiP) Towards thread-private/shared variables
domcharrier Apr 25, 2022
cca9f74
(WiP,WARNING) Put parameters into namespace, remove from arg list
domcharrier Apr 26, 2022
34e0e1a
(WiP) Fix kernel arguments with private arrays
domcharrier Apr 26, 2022
00418ea
(WiP) Add token-based parser for implicit/public/private statements
domcharrier Apr 27, 2022
de07a77
(WiP,unstable) Support of private/public module content accessibility
domcharrier Apr 27, 2022
4f32c7a
(WiP) Studies on C++ namespaces & legal Fortran character declarations
domcharrier Apr 28, 2022
a9639c3
(WiP) More studies on character declaration variants
domcharrier Apr 28, 2022
41d6b5a
(WiP,unstable) Reimplementation of datatype/declaration parser
domcharrier Apr 28, 2022
642ae0d
(WiP) vector-add-complicated: Make example for parameter expansion vi…
domcharrier Apr 28, 2022
8a0e4cb
(WiP) Add study on precise (complex) float/double value output
domcharrier Apr 29, 2022
eaec204
(WiP) studies/gfortran/write-formats: Sketch array value output
domcharrier Apr 29, 2022
057e512
(WiP) More careful float/double precision parameter parsing
domcharrier Apr 29, 2022
d7d2600
(WiP) Include parameters even though they are ...
domcharrier Apr 29, 2022
235054a
(WiP) Also consider operators in public/private stmt
domcharrier Apr 29, 2022
06403db
(WiP) Support private/public operator/assignment/type member expression
domcharrier Apr 30, 2022
f7e6beb
(WiP) Add study on order of module lookup
domcharrier Apr 30, 2022
8f010d1
(WiP,unstable) Recreate module hierarchy to resolve parameters better
domcharrier May 1, 2022
4240d91
(WiP) vector-add-complicated: public module param depending on private
domcharrier May 1, 2022
a447634
(WiP) python/*/acc2hipgpufort*: Fix issues with wait clause/dir codegen
domcharrier May 1, 2022
804a0a6
(WiP,fix)Support allocate with non-array expr
domcharrier May 1, 2022
3e1dabf
(WiP,unstable) Reproduce accessibility in generated modules; derived …
domcharrier May 1, 2022
4904c20
(WiP) indexer/scope: Improve public/private treatment
domcharrier May 2, 2022
a7e5e0b
(WiP) Indexer,scope support for implicit parameters in modules
domcharrier May 2, 2022
b05f4dc
(WiP) Parse cycle/exit in loop body; fix fort2x.hip example
domcharrier May 2, 2022
a73a9d4
(WiP) Make parent program/procedure statement func avail in nested
domcharrier May 2, 2022
908b448
(WiP)translator/parser: Fix critical typo
domcharrier May 2, 2022
1d501b2
(WiP) Some more investigation of implicit behaviour
domcharrier May 2, 2022
488c9b3
(WiP) Remove erroneously added binary files and output files
domcharrier May 2, 2022
c853652
(WiP,unstable) Compiler & flags parsing moves into converter
domcharrier May 2, 2022
3d4194e
Merge branch 'develop-acc-no-cptrs' of github.com:RocmSoftwarePlatfor…
domcharrier May 2, 2022
b714c43
(WiP,unstable) Fix issue passing cflags to namespacegen
domcharrier May 2, 2022
ad935b2
(WiP,unstable) namespacegen: Fix parent module name derivation
domcharrier May 2, 2022
b3b6cc4
(WiP,unstable) namespacegen: Ignore type parameters for the time being.
domcharrier May 2, 2022
76a13cd
(WiP,unstable) Fix used module rendering
domcharrier May 3, 2022
72225d6
(WiP,unstable) namespacegen: No non-parameters in
domcharrier May 3, 2022
7240c2c
(WiP,unstable) Improve namespacegen output
domcharrier May 3, 2022
d7ebd2e
(WiP)indexer.scope: Fix indent where renaming list is processed
domcharrier May 3, 2022
3088808
(WiP) test/stab*: Resolve parameters via FC
domcharrier May 3, 2022
d2d5f7a
(WiP)namespacegen: clean FC output, modfile tmpdir
domcharrier May 3, 2022
71097ea
(WiP)indexer:Error if parameter decl without RHS
domcharrier May 3, 2022
d754709
(WiP)FIX:Apply renamings more carefully
domcharrier May 3, 2022
70e44ed
(WiP)Fix 2 issues in scope creation
domcharrier May 3, 2022
ab5fba0
(WiP,WARN)Another revision of the scope creation
domcharrier May 3, 2022
bc96c0d
(WiP,Fix)grammar: Make l/rvalue pyparsing groups
domcharrier May 3, 2022
794d8ee
(WiP) Fix CUDA Fortran vector-add example
domcharrier May 3, 2022
670354f
(WiP)scope: No strict only/renaming checks ...
domcharrier May 3, 2022
1b5e11a
(WiP) Add study on only and renaming-lists
domcharrier May 3, 2022
8428951
(WiP)Fix: Revise combination of use statements
domcharrier May 3, 2022
4ef3cbf
(WiP)Fix:namespacegen: Adopt new USE treatment
domcharrier May 3, 2022
07f9e29
(WiP)scope:More detailed error message when var lookup fails
domcharrier May 4, 2022
6f086d4
Support INTENT+(+IN+<whitespace>+OUT+)
domcharrier May 4, 2022
0db1d54
(WiP)Frontend support for more expressions
domcharrier May 4, 2022
0034070
(WiP)+Study on fixed size arrays on derived types
domcharrier May 4, 2022
9c683ab
(WiP)studies/*/alter-ego:Put scalar before array
domcharrier May 4, 2022
75400cd
(WiP) used module codegen: Rename & only list may not be present
domcharrier May 5, 2022
e51c0d4
(WiP)Remove trailing characters in jinja macro
domcharrier May 5, 2022
2cc432e
(WiP)Parameter namespaces: Prevent redefinitions
domcharrier May 5, 2022
731a9d4
(WiP) **/Makefile: gpufort opt '--path'->'--print-path'
domcharrier May 12, 2022
719e571
(WiP)scanner: Support 'do' statement w/o further tokens
domcharrier May 16, 2022
b4451a1
(WiP)scanner/parser.py: Use stripped statement when parsing assignment
domcharrier May 16, 2022
571016e
(WiP) util/parsing: consider implicit w double precision/complex
domcharrier May 16, 2022
0a8dbd2
(WiP) Add two options
domcharrier May 16, 2022
bebd3ee
(WiP) Multiple fixes
domcharrier May 16, 2022
30668f6
(WiP) Rename stability test files
domcharrier May 17, 2022
2f6045d
(WiP) Touch autogenerated files via Makefile
domcharrier May 17, 2022
639aac6
(WiP) Update .gitignore
domcharrier May 17, 2022
555881c
(WiP)Fix: /= 0 translation: ignore symbols that are not variables
domcharrier May 17, 2022
85ee465
(WiP,unstable)indexer: Store if procedure is iface
domcharrier May 17, 2022
80869f9
(WiP) indexer/scanner: Consider 'end interface'
domcharrier May 17, 2022
5fb0928
(WiP)Fix:File can contain procedures & no interfaces
domcharrier May 17, 2022
deec110
(WiP)namespacegen: Make all parameters public in artificial parent mo…
domcharrier May 17, 2022
fe1a438
(WiP)Fix: Directive terms may have commas/upper case
domcharrier May 18, 2022
f761327
(WiP) util.{parsing -> error}.SyntaxError
domcharrier May 18, 2022
f503cc1
(WiP,unstable) Next iter of param resolve via FC
domcharrier May 18, 2022
797e57a
(WiP) Get stability tests running again
domcharrier May 18, 2022
2e66556
(WiP) Remove legacy code
domcharrier May 18, 2022
b1ef867
(WiP) Add and or reduction ops
domcharrier May 18, 2022
9252115
(WiP) Tackle ambiguous declarations
domcharrier May 19, 2022
48427ff
(WiP) Fix: comments may have only a single character
domcharrier May 19, 2022
b92c11f
(WiP) translator/tree/fortran: Add missing import
domcharrier May 19, 2022
6639c78
(WiP) scanner: Add comment
domcharrier May 19, 2022
4fdbd67
(WiP,unstable) Revisit ACC serial/parallel/data
domcharrier May 19, 2022
f9c7eea
(WiP) Fix requirements install msg
domcharrier May 20, 2022
71b3f39
(WiP) Record # directives & disabled code
domcharrier May 20, 2022
2df24dc
(WiP) Fix compiler issues with debug code
domcharrier May 20, 2022
7ed220b
Merge branch 'develop-acc-no-cptrs' of github.com:ROCmSoftwarePlatfor…
domcharrier May 20, 2022
4986c3c
(WiP) Minor output fix
domcharrier May 20, 2022
594cc4e
(WiP,unstable) Fix do loop length calculation
domcharrier May 21, 2022
e996b7b
(WiP,unstable)HIP problem size launcher: Do not launch if problem dim…
domcharrier May 21, 2022
1e2bb19
(WiP,more testing needed) Import local opts module
domcharrier May 23, 2022
422f66f
(WiP) Remove debug output
domcharrier May 23, 2022
8eb1e91
(WiP) Fix emitted loop condition
domcharrier May 23, 2022
744f789
(WiP) Remove debug output
domcharrier May 23, 2022
632dc4a
(WiP) Fix GPUFORT lib build script
domcharrier May 23, 2022
5aa7ec6
(WiP) Add halo layer param to gpufort_array print routines
domcharrier May 23, 2022
9ed5f29
(WiP,unstable) Fix input/output array debug code
domcharrier May 23, 2022
cf140e5
Reference counter-based implementation of GPUFORT ACC runtime (#42)
domcharrier Aug 22, 2022
e11f650
Fix:gpufortrt: update_{self,host} implementation
domcharrier Aug 22, 2022
0911610
Fix:gpufortrt: Remove procedures/interfaces
domcharrier Aug 22, 2022
f28a22a
Fix:gpufortrt: Fix update_{host,device} signatures/interfaces
domcharrier Aug 22, 2022
4cc2173
Fix:gpufortrt: Switch to ptrdiff_t from size_t for ptr arithmetic
domcharrier Aug 22, 2022
6b19fef
gpufortrt/src/*/record_list_t.cpp: Replace exception by runtime error
domcharrier Aug 23, 2022
a3204b3
WiP(unstable): Support zero-size data mappings
domcharrier Aug 23, 2022
92ae177
gpufortrt: Implement zero-len array mappings
domcharrier Aug 23, 2022
93144cd
scanner/*/acc2omp: Reactivate by fixing errors
domcharrier Aug 24, 2022
e2dbbbe
scanner/parser: Remove debug output
domcharrier Aug 24, 2022
fa775fc
indexer.scope: Improve lookup of derived type members
domcharrier Aug 24, 2022
ba0dd4b
gpufort: +option: translate no compute constructs
domcharrier Aug 24, 2022
a781823
gpufortrt: Implement host_data use_device support
domcharrier Aug 24, 2022
9952a3f
Simplify gpufortrt_use_device Fortran interface
domcharrier Aug 24, 2022
f7391e3
gpufort_api.h: Fix C compiler error
domcharrier Aug 25, 2022
a3088ed
Logging: Add config option to disable logging
domcharrier Aug 25, 2022
8ea4a5d
scope: Do not deep copy scope member `index`
domcharrier Aug 25, 2022
30145fe
Merge branch 'develop-acc-no-cptrs' of github.com:ROCmSoftwarePlatfor…
domcharrier Aug 25, 2022
42f1e6f
studies/cpp/hip: Failed to implement device code linking
domcharrier Aug 29, 2022
ff066cd
gpufort.h Add mod(a,b) device function
domcharrier Aug 29, 2022
3f5c6e0
studies/hip: Add study on nested device routines
domcharrier Aug 29, 2022
de0290b
fort2x/codegen: C++ file for toplevel procedures
domcharrier Aug 29, 2022
47d662d
util/parsing:is_assign*: do not join opernd tokens
domcharrier Aug 30, 2022
4820c98
fort2x/namespacegen: Change default flags to support arbitrary line l…
domcharrier Aug 30, 2022
d6c2db3
parsing:tokenize: Prevent split at decimal point
domcharrier Aug 30, 2022
05888bc
gpufort.h: Add alog10/dlog10 device functions
domcharrier Aug 30, 2022
84b9d1d
scope: Consider implicit rule in variable lookup
domcharrier Aug 30, 2022
14be046
codegen: Add c_int8t to default interfaces
domcharrier Aug 30, 2022
e27f80f
Changes in translator & namespacegen
domcharrier Aug 30, 2022
149e133
Add two stability tests
domcharrier Aug 30, 2022
b0886b2
gpufort.h: Add device function dexp
domcharrier Aug 31, 2022
729c4cf
py*/gpuf*/index*: Support dimension statement
domcharrier Aug 31, 2022
5091282
indexer.scope: Improve implicit & intrinsics support
domcharrier Aug 31, 2022
070d0d9
gpufort/translator: Improve expr type resolution
domcharrier Aug 31, 2022
e48e24a
scanner/*/nodes: Lookup of implicit func retty
domcharrier Aug 31, 2022
06c7ef6
fort2x.hip: Emit prototype for accel. procedure
domcharrier Aug 31, 2022
0fd3495
util/parsing: Add parser for external stmt
domcharrier Aug 31, 2022
daa6234
Accelerator routines: Take implicit variables into account
domcharrier Aug 31, 2022
0a75f44
studies/gfortran: Add study on hiding present intrinsic
domcharrier Aug 31, 2022
f6964b2
hipcodegen: Fix error when catching exception
domcharrier Aug 31, 2022
97ee73e
grammar_f03: Fix grammar of \.not\. op
domcharrier Aug 31, 2022
fc4ddb5
fort2x/codegen: Reduce number of namespaces
domcharrier Aug 31, 2022
310fb03
translator: Improve classific. of call-like expr
domcharrier Sep 1, 2022
324b9d6
studies: +study on Fortran vs C loop control statements
domcharrier Sep 1, 2022
3ab82ba
Add stability test
domcharrier Sep 1, 2022
1a77277
Fix:gpufort_api_core.f90: Add missing value attrib
domcharrier Oct 18, 2022
8e8bf8b
Fix: gpufortrt_api_core.f90: F90 fun bound to wrong C fun
domcharrier Oct 18, 2022
19f4c2d
Fix: Not map min intrinsic to max fun
domcharrier Oct 19, 2022
643ea4a
maintain(*/parser.py): support recent Python versions
domcharrier Dec 4, 2023
0197a95
fix(src/rules.mk): allow HIPCC/HIPFC override
domcharrier Dec 4, 2023
3a05b65
maintain(README.md): update install information.
domcharrier Dec 4, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,11 @@ __pycache__
*.kernels.f08
*.kernels.hip.cpp
*.hipified.*
*-gpufort.cpp
*-gpufort.f*
*-fort2x.cpp
*-fort2x.f*
gpufort.h
gpufort_reductions.h
render*.template.*
render.py.in
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2021 Advanced Micro Devices, Inc. All rights reserved.
Copyright (c) 2020-2022 Advanced Micro Devices, Inc. All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
44 changes: 29 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,35 +1,47 @@
.PHONY: clean_all gpufort_headers gpufort_sources lib/$(LIBGPUFORT) lib/$(LIBGPUFORT_ACC)
.PHONY: clean_all gpufort_headers gpufort_sources gpufort_templates share/gpufort_sources lib/$(LIBGPUFORT) lib/$(LIBGPUFORTRT)

SUFFIX = $(if $(HIP_PLATFORM),$(HIP_PLATFORM),amd)
LIBGPUFORT = libgpufort_$(SUFFIX).a
LIBGPUFORT_ACC = libgpufort_acc_$(SUFFIX).a
SUFFIX = $(if $(HIP_PLATFORM),$(HIP_PLATFORM),amd)
LIBGPUFORT = libgpufort_$(SUFFIX).a
LIBGPUFORTRT = libgpufortrt_$(SUFFIX).a

GPUFORT_DIR = $(shell gpufort --path)
GPUFORT_ACC_DIR = $(GPUFORT_DIR)/runtime/gpufort_acc_runtime
GPUFORT_DIR = .
GPUFORTRT_DIR = $(GPUFORT_DIR)/runtime/gpufortrt

all: | gpufort_headers lib/$(LIBGPUFORT) lib/$(LIBGPUFORT_ACC) make_directories
all: | gpufort_templates lib/$(LIBGPUFORT) lib/$(LIBGPUFORTRT) make_directories

gpufort_templates:
make -C $(GPUFORT_DIR)/python/gpufort/fort2x/templates all
make -C $(GPUFORT_DIR)/python/gpufort/fort2x/hip/templates all

gpufort_headers:
make -C $(GPUFORT_DIR)/include all

gpufort_sources:
make -C $(GPUFORT_DIR)/src gpufort_sources

lib/$(LIBGPUFORT): | gpufort_headers gpufort_sources make_directories
share/gpufort_sources: gpufort_headers gpufort_sources
cp src/gpufort.f03 share/gpufort_sources
cp src/gpufort_array.cpp share/gpufort_sources
cp src/gpufort_array.f03 share/gpufort_sources
cp include/gpufort.h share/gpufort_sources
cp include/gpufort_array.h share/gpufort_sources
cp include/gpufort_reduction.h share/gpufort_sources

lib/$(LIBGPUFORT): | gpufort_templates gpufort_headers gpufort_sources make_directories
make -C $(GPUFORT_DIR)/src $(LIBGPUFORT)
mv $(GPUFORT_DIR)/src/$(LIBGPUFORT) $(GPUFORT_DIR)/lib
mv $(GPUFORT_DIR)/src/*.mod $(GPUFORT_DIR)/include/$(SUFFIX)/
make -C $(GPUFORT_DIR)/src clean

lib/$(LIBGPUFORT_ACC): make_directories
make -C $(GPUFORT_ACC_DIR)/ lib/$(LIBGPUFORT_ACC)
mv $(GPUFORT_ACC_DIR)/lib/$(LIBGPUFORT_ACC)\
lib/$(LIBGPUFORTRT): | gpufort_templates make_directories
make -C $(GPUFORTRT_DIR)/ clean_all build clean
mv $(GPUFORTRT_DIR)/lib/$(LIBGPUFORTRT)\
$(GPUFORT_DIR)/lib/
mv $(GPUFORT_ACC_DIR)/include/*.mod\
mv $(GPUFORTRT_DIR)/include/*.mod\
$(GPUFORT_DIR)/include/$(SUFFIX)/
#-mv $(GPUFORT_ACC_DIR)/include/*.h\
#-mv $(GPUFORTRT_DIR)/include/*.h\
# $(GPUFORT_DIR)/include/$(SUFFIX)
make -C $(GPUFORT_ACC_DIR)/ clean
make -C $(GPUFORTRT_DIR)/ clean

make_directories:
mkdir -p $(GPUFORT_DIR)/lib
Expand All @@ -38,4 +50,6 @@ make_directories:
clean_all:
make -C $(GPUFORT_DIR)/include clean_all
make -C $(GPUFORT_DIR)/src clean_all
rm -f lib/$(LIBGPUFORT) lib/$(LIBGPUFORT_ACC)
make -C $(GPUFORT_DIR)/python/gpufort/fort2x/templates clean_all
make -C $(GPUFORT_DIR)/python/gpufort/fort2x/hip/templates clean_all
rm -f lib/$(LIBGPUFORT) lib/$(LIBGPUFORTRT)
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,17 @@ build the GPUFORT static libraries and/or
offloading runtime for AMD and/or NVIDIA devices.
Assuming HIPFORT is installed, you can compile them via:

NOTE: The project uses `hipfort`. If you are not using the AMD flang compiler, it is recommended to build it from source so that the `hipfort` `*.mod` files are compatible with your compiler.

```bash
HIP_PLATFORM=amd FC=hipfc make all # use HIP_PLATFORM=nvidia for NVIDIA devices
HIP_PLATFORM=amd FC=hipfc make clean_all all # use HIP_PLATFORM=nvidia for NVIDIA devices

# or without hipfc:

FC="/opt/rocm/bin/flang" HIPFORT_INC="/opt/rocm/include/hipfort/amdgcn" HIP_PLATFORM="amd" make clean_all all
```

If the compilation is successful, take a look at the
After compiling successfully, take a look at the
CUDA Fortran and OpenACC examples in the `examples/` subdirectory,
which all come with a Makefile for generating code and building
the examples.
Expand Down
29 changes: 5 additions & 24 deletions bin/gpufort
Original file line number Diff line number Diff line change
@@ -1,29 +1,10 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: MIT
# Copyright (c) 2021 Advanced Micro Devices, Inc. All rights reserved.
# check if required software installed
# Copyright (c) 2020-2022 Advanced Micro Devices, Inc. All rights reserved.
GPUFORT_BIN_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"

declare -i retval
requirements=$(grep -v "^\s*#" $GPUFORT_BIN_DIR/../os-requirements.txt | grep "^\w\+")
for p in $requirements; do
command -v $p > /dev/null
retval=$(echo $?)
if (( retval > 0 )); then
echo "ERROR: Could not find program '$p'. Please install or add to path."
exit 10
fi
done

declare -i clang_format_version # major version
clang_format_version=$(clang-format --version | grep -o "clang-format version [0-9]\+\.[0-9]\+\.[0-9]\+" | grep -o "\s\+[0-9]\+")
if (( clang_format_version < 7 )); then
echo "ERROR: Minimum required clang-format version is 7.0.0"
exit 11
fi

# check if required python packages are installed
requirements=$(grep -v "^\s*#" $GPUFORT_BIN_DIR/../python3-requirements.txt | grep "^\w\+")
requirements=$(grep -v "^\s*#" $GPUFORT_BIN_DIR/../python/requirements.txt | grep "^\w\+")
declare -i requirements_missing
requirements_missing=0 # 0: 'false', >0: true
for m in $requirements; do
Expand All @@ -36,7 +17,7 @@ for m in $requirements; do
done
if (( requirements_missing > 0 )); then
echo "Please install missing python3 packages e.g. via:"
echo "python3 -m pip install -r <gpufort_root>/python3-requirements.txt"
echo "python3 -m pip install -r ${GPUFORT_BIN_DIR}/../python/requirements.txt"
echo "(you might need to be root)"
exit 20
fi
Expand All @@ -63,5 +44,5 @@ for a in "$@"; do
done

if [ -z ${USED_DEVELOPER_TOOL} ]; then
python3 $GPUFORT_BIN_DIR/../python/gpufort.py --working-dir $(pwd) "${@}"
fi
python3 $GPUFORT_BIN_DIR/../python/converter.py --working-dir $(pwd) "${@}" ${GPUFORT_FLAGS_APPEND}
fi
30 changes: 30 additions & 0 deletions bin/gpufortfc
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: MIT
# Copyright (c) 2020-2022 Advanced Micro Devices, Inc. All rights reserved.
# check if required software installed
GPUFORT_BIN_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"

# check if required python packages are installed
requirements=$(grep -v "^\s*#" $GPUFORT_BIN_DIR/../python/requirements.txt | grep "^\w\+")
declare -i requirements_missing
requirements_missing=0 # 0: 'false', >0: true
for m in $requirements; do
python3 -c "import $m" &> /dev/null
retval="$(echo $?)"
requirements_missing="$requirements_missing + $retval"
if (( retval > 0 )); then
echo "ERROR: Could not find python3 module '$m'. Please install or add to path."
fi
done
if (( requirements_missing > 0 )); then
echo "Please install missing python3 packages e.g. via:"
echo "python3 -m pip install -r ${GPUFORT_BIN_DIR}/../python/requirements.txt"
echo "(you might need to be root)"
exit 20
fi

# all dependencies are met and we can continue

if [ -z ${USED_DEVELOPER_TOOL} ]; then
python3 $GPUFORT_BIN_DIR/../python/fc.hip.py --working-dir $(pwd) "${@}" ${GPUFORTFC_FLAGS_APPEND}
fi
10 changes: 5 additions & 5 deletions config/dynamico.py.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# SPDX-License-Identifier: MIT
# Copyright (c) 2021 Advanced Micro Devices, Inc. All rights reserved.
# Copyright (c) 2020-2022 Advanced Micro Devices, Inc. All rights reserved.
###############################################################################
# config file for dynamico (python script)
###############################################################################
Expand Down Expand Up @@ -33,10 +33,10 @@ scanner.HIP_MATH_MODULE_PREFIX = scanner.HIP_MODULE_NAME+"_"
scanner.ACC_DEV_PREFIX=""
scanner.ACC_DEV_SUFFIX="_d"

translator.FORTRAN_2_C_TYPE_MAP["complex"]["cstd"] = "hipDoubleComplex"
translator.FORTRAN_2_C_TYPE_MAP["complex"]["rstd"] = "hipDoubleComplex"
translator.FORTRAN_2_C_TYPE_MAP["real"]["rstd"] = "double"
translator.FORTRAN_2_C_TYPE_MAP["complex"]["istd"] = "int"
translator.fortran_2_c_type_map["complex"]["cstd"] = "hipDoubleComplex"
translator.fortran_2_c_type_map["complex"]["rstd"] = "hipDoubleComplex"
translator.fortran_2_c_type_map["real"]["rstd"] = "double"
translator.fortran_2_c_type_map["complex"]["istd"] = "int"

translator.LOOP_COLLAPSE_STRATEGY="collapse-always"

Expand Down
184 changes: 0 additions & 184 deletions docs/README.md

This file was deleted.

Loading