{"id":25456799,"url":"https://github.com/szaghi/fundal","last_synced_at":"2026-02-20T16:04:59.431Z","repository":{"id":222499055,"uuid":"757460023","full_name":"szaghi/FUNDAL","owner":"szaghi","description":"Fortran UNified Device Acceleration Library","archived":false,"fork":false,"pushed_at":"2025-02-13T20:08:47.000Z","size":3095,"stargazers_count":11,"open_issues_count":2,"forks_count":2,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-02-13T21:23:46.936Z","etag":null,"topics":["fortran","gpu","hpc","openacc","openmp","parallel-computing"],"latest_commit_sha":null,"homepage":"","language":"Fortran","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/szaghi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.bsd-2.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-02-14T14:41:32.000Z","updated_at":"2025-02-13T20:08:51.000Z","dependencies_parsed_at":"2024-03-28T17:26:56.372Z","dependency_job_id":"8f2afef9-cfd2-4079-83f4-7f22d68c861d","html_url":"https://github.com/szaghi/FUNDAL","commit_stats":{"total_commits":30,"total_committers":2,"mean_commits":15.0,"dds":0.1333333333333333,"last_synced_commit":"9bd16e9dbb7aa3009a458089620399641fe0e650"},"previous_names":["szaghi/oafml","szaghi/fundal"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/szaghi%2FFUNDAL","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/szaghi%2FFUNDAL/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/szaghi%2FFUNDAL/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/szaghi%2FFUNDAL/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/szaghi","download_url":"https://codeload.github.com/szaghi/FUNDAL/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239394685,"owners_count":19631122,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fortran","gpu","hpc","openacc","openmp","parallel-computing"],"created_at":"2025-02-18T01:51:21.125Z","updated_at":"2026-02-20T16:04:59.424Z","avatar_url":"https://github.com/szaghi.png","language":"Fortran","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FUNDAL\n\n**Fortran UNified Device Acceleration Library** — a pure Fortran library providing a unified API for GPU/device memory management over OpenACC and OpenMP backends.\n\n[![GitHub tag](https://img.shields.io/github/tag/szaghi/FUNDAL.svg)](https://github.com/szaghi/FUNDAL/releases)\n[![GitHub issues](https://img.shields.io/github/issues/szaghi/FUNDAL.svg)](https://github.com/szaghi/FUNDAL/issues)\n[![License](https://img.shields.io/badge/license-GPLv3%20%7C%20BSD%20%7C%20MIT-blue.svg)](#copyrights)\n\n---\n\n## Features\n\n- Unified API for both OpenACC and OpenMP backends — backend selected at compile time, no conditional code in user programs\n- Structured model: device-only memory as Fortran `pointer` arrays (`dev_alloc`, `dev_free`, `dev_memcpy_*`)\n- Unstructured model: host `allocatable` arrays mapped onto the device (`dev_alloc_unstr`, `dev_free_unstr`, `dev_memcpy_*_unstr`)\n- Assignment-style copy with automatic reallocation on size change (`dev_assign_to_device`, `dev_assign_from_device`)\n- Device handling: query type, ID, count, memory, and properties\n- MPI multi-device support via the `mpih_object` class\n- Arrays of any rank (1–7) and numeric kind (R8P, R4P, I8P, I4P, I2P, I1P)\n\n**[Documentation](https://szaghi.github.io/FUNDAL/)** | **[API Reference](https://szaghi.github.io/FUNDAL/guide/api-reference)**\n\n---\n\n## Authors\n\n- Stefano Zaghi — [stefano.zaghi@cnr.it](mailto:stefano.zaghi@cnr.it)\n- Giacomo Rossi — [giacomo.rossi@amd.com](mailto:giacomo.rossi@amd.com)\n- Andrea di Mascio — [andrea.dimascio@univaq.it](mailto:andrea.dimascio@univaq.it)\n- Francesco Salvadore — [f.salvadore@cineca.it](mailto:f.salvadore@cineca.it)\n\nContributions are welcome — see the [Usage](https://szaghi.github.io/FUNDAL/guide/usage) page.\n\n## Copyrights\n\nThis project is distributed under a multi-licensing system:\n\n- **FOSS projects**: [GPL v3](http://www.gnu.org/licenses/gpl-3.0.html)\n- **Closed source / commercial**: [BSD 2-Clause](http://opensource.org/licenses/BSD-2-Clause), [BSD 3-Clause](http://opensource.org/licenses/BSD-3-Clause), or [MIT](http://opensource.org/licenses/MIT)\n\n\u003e Anyone interested in using, developing, or contributing to FUNDAL is welcome — pick the license that best fits your needs.\n\n---\n\n## Quick start\n\nAllocate device memory, copy data to the GPU, run a kernel, copy back:\n\n```fortran\nprogram fundal_taste\nuse, intrinsic :: iso_fortran_env, only : I4P=\u003eint32, R8P=\u003ereal64\nuse            :: fundal\n\nimplicit none\nreal(R8P), pointer     :: a_dev(:,:,:)=\u003enull()  ! device memory\nreal(R8P), allocatable :: b_hos(:,:,:)           ! host   memory\ninteger(I4P)           :: ierr, i, j, k\n\ncall dev_init  ! initialise device environment\n\ncall dev_alloc(fptr_dev=a_dev, lbounds=[-1,-2,-3], ubounds=[1,2,3], ierr=ierr)\nallocate(b_hos(-1:1,-2:2,-3:3))\nb_hos = -3._R8P\n\ncall dev_memcpy_to_device(dst=a_dev, src=b_hos)\n\n!$acc parallel loop independent deviceptr(a_dev) collapse(3)\n!$omp target teams distribute parallel do collapse(3) has_device_addr(a_dev)\ndo k=-3,3; do j=-2,2; do i=-1,1\n  a_dev(i,j,k) = a_dev(i,j,k) / 2._R8P\nenddo; enddo; enddo\n\ncall dev_memcpy_from_device(dst=b_hos, src=a_dev)\nprint*, b_hos\n\ncall dev_free(a_dev)\nendprogram fundal_taste\n```\n\nDevice memory must be declared as `pointer`; host memory can be `pointer` or `allocatable`. OpenACC and OpenMP pragmas coexist safely — unrecognised directives are ignored by the compiler.\n\n---\n\n## Install\n\n```sh\ngit clone https://github.com/szaghi/FUNDAL.git\ncd FUNDAL\n```\n\nBuild with [FoBiS.py](https://github.com/szaghi/FoBiS):\n\n| Compiler | Backend | Build mode |\n|----------|---------|------------|\n| NVIDIA nvfortran ≥ 12.3 | OpenACC | `FoBiS.py build -mode fundal-test-oac-nvf` |\n| Intel IFX ≥ 2024.0.2 | OpenMP | `FoBiS.py build -mode fundal-test-omp-ifx` |\n| GNU gfortran ≥ 13.1 | OpenACC (partial) | `FoBiS.py build -mode fundal-test-oac-gnu` |\n| AMD Flang | OpenMP | `FoBiS.py build -mode fundal-test-omp-amd` |\n\nRun all tests:\n\n```sh\nutils/run_tests.sh\n# or: FoBiS.py rule -ex build-run-tests-oac-nvf\n```\n\nEach test prints `test passed` on success.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fszaghi%2Ffundal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fszaghi%2Ffundal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fszaghi%2Ffundal/lists"}