-
Notifications
You must be signed in to change notification settings - Fork 39
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: Upgrade to ROCm 3.10/4.0, add RAND modules, add Fortran pointer/target interfaces, add docu #38
WiP: Upgrade to ROCm 3.10/4.0, add RAND modules, add Fortran pointer/target interfaces, add docu #38
Conversation
* Doxygen style docu in all modules for IDE integration and docu generation. * RT literals such as hipHostMallocDefault etc are now loaded in hipfort module via hipfort_types aux module.
* hipMalloc,hipHostMalloc,hipFree,hipHostFree accept now Fortran pointers of type complex,integer,real (SP and DP) with up to seven dimensions. Arguments are in #elements here instead of #bytes. * hipMemcpy,hipMemcpyAsync accept now Fortran pointers of type complex,integer,real (SP and DP) with up to seven dimensions. Arguments are in #elements here instead of #bytes. * hipMemcpy2D,hipMemcpy2DAsync accept now 2D Fortran pointers of type complex,integer,real (SP and DP). Arguments are in #elements here instead of #bytes. * Modified vecadd example to work with these new interfaces. Change required to bump up Fortran standard to 2008 in CMakeList.txt
* Upgrade all modules to ROCm 3.9. * Add interfaces that take scalar and vector targets for most routines. * Add interfaces that take higher-rank tensor target arrays into account for some interfaces where it is clear that one argument is a matrix or a tensor with even higher rank. * Add rocblas/hipblas auxiliary functions for various datatypes
This PR generally adds a larger number of new APIs (coming from the upgrade to ROCm 3.10) Main discussion point is if we can switch to f2008 or if this has impact of some projects that strictly require f2003. |
How much of a pain would it be to support both? I.e. detect at configure time if compiler supports the f2008 features needed and then guard with pre-processor macros. That would be my preference, but the maintenance burden is a bit bigger. |
@schoonovernumerics Can you check if this PR closes #36 ? |
@schoonovernumerics Can you check if this covers the test automation needs you mention in |
* add f2003 (original) and f2008 version * original f2003 Taken from: #35
@malcolmroberts Please check if this PR covers #35 |
cd build && make all-tests-run | Scanning dependencies of target all-tests | Built target all-tests | Scanning dependencies of target all-tests-run | -- Running test 'vecadd' (Fortran 2003 interfaces) - PASSED! | -- Running test 'rocFFT' (Fortran 2003 interfaces) - PASSED! | -- Running test 'ddoti' (Fortran 2003 interfaces) - PASSED! | -- Running test 'CGEMM' (Fortran 2003 interfaces) - PASSED! | -- Running test 'DGEMM' (Fortran 2003 interfaces) - PASSED! | -- Running test 'dger' (Fortran 2003 interfaces) - PASSED! | -- Running test 'dscal' (Fortran 2003 interfaces) - PASSED! | -- Running test 'SAXPY' (Fortran 2003 interfaces) - PASSED! | -- ... and update copyright date in all files
* Collected names from CUDA 11.2 libcublas.so
…/hipfort into feature/rocm3.8-modules
@txomin13 I'll take a look today |
* Issue was unitialized direction variable Further: * hipfc users must now specify offload arch with '--offload-arch=<...>' as in hipcc
As the PR now passes all tests and adds a substantial number of new interfaces, I will merge it into develop. |
NOTE: This PR requires to move from-std=f2003
to-std=f2008
in order to enable overloading offunctions where only the assumed rank of an array input argument differs but not the number, name, and order of input arguments!
(Build process tries to determine now if compiler supports F2008.)
(Issue with current ROCm packaging is that we only ship only modules compatible with one gfortran module file format
per OS as we only ship one set of precompiled modules. We should actually build modules compliant to the last N gfortran module file formats.)
Fixes
value
qualifier tohipStream
andhipEvent
where neededas
type(c_ptr)
. Therefore, it is not necessary to usec_loc
and to add atarget
qualifierto the declaration of these parameters in Fortran user code. Among these updated interfaces
are
hipGetDevice
and various interfaces for querying device properties.Minor fixes
Main contributions:
Upgrade all modules to ROCm 3.10.
Add hiprand and rocrand modules
Add documentation for most routines.
HIP Runtime API:
"source" implies a memcpy, "mold" does not.
This mimicks the ALLOCATE intrinsics behaviour: https://www.ibm.com/support/knowledgecenter/SS2MB5_14.1.0/com.ibm.xlf141.bg.doc/language_ref/alloc.html)
HIP/ROCm Math Libs:
Work with Fortran pointers instead of type(c_ptr); enables easy slicing
Add interfaces that take scalar and vector targets for most routines.
Add interfaces that take higher-rank tensor target arrays into account for some interfaces
where it is clear that one argument is a matrix or a tensor with even higher rank.
Add rocblas/hipblas auxiliary functions for various datatypes
Tests
Example usage of the upgraded HIP runtime API:
https://raw.githubusercontent.com/ROCmSoftwarePlatform/hipfort/ef0380082af511dc68e2b1350ce287cc2f617eee/test/vecadd/main.f03
Another example that uses rocblas and HIP Runtime API:
https://raw.githubusercontent.com/ROCmSoftwarePlatform/hipfort/ef0380082af511dc68e2b1350ce287cc2f617eee/test/rocblas/saxpy.f03