# From Legacy Fortran to Portable Kokkos: An Autonomous Agentic AI Workflow

DevFeed: [From Legacy Fortran to Portable Kokkos: An Autonomous Agentic AI Workflow](<https://devfeed.tech/articles/from-legacy-fortran-to-portable-kokkos-an-autonomous-agentic-ai-workflow-102918.md>)

Original publisher: [Read original article](<https://arxiv.org/abs/2509.12443>)

Author: Sparsh Gupta, Kamalavasan Kamalakkannan, Maxim Moraru, Galen Shipman, Patrick Diehl

Published: 2026-10-28T04:00:00Z

Content type: article

Language: en

Sources: [arXiv: Artificial Intelligence](<https://devfeed.tech/sources/arxiv-artificial-intelligence.md>), [arXiv: Distributed Computing](<https://devfeed.tech/sources/arxiv-distributed-computing.md>), [arXiv: Machine Learning](<https://devfeed.tech/sources/arxiv-machine-learning.md>), [arXiv: Software Engineering](<https://devfeed.tech/sources/arxiv-software-engineering.md>)

Topics: [agentic workflows](<https://devfeed.tech/topics/agentic-workflows.md>), [Fortran](<https://devfeed.tech/topics/fortran.md>), [Kokkos](<https://devfeed.tech/topics/kokkos.md>), [AI-assisted coding](<https://devfeed.tech/topics/ai-assisted-coding.md>), [Agentic AI](<https://devfeed.tech/topics/what-is-agentic-ai.md>), [Multi Agent Systems](<https://devfeed.tech/topics/multi-agent-systems.md>), [High-Performance Computing](<https://devfeed.tech/topics/high-performance-computing.md>), [Large Language Model](<https://devfeed.tech/topics/llm.md>), [Supercomputing](<https://devfeed.tech/topics/supercomputing.md>), [Test automation](<https://devfeed.tech/topics/test-automation.md>), [llm-reasoning](<https://devfeed.tech/topics/llm-reasoning.md>)

Tags: [abstraction](<https://devfeed.tech/tags/abstraction.md>), [accelerated](<https://devfeed.tech/tags/accelerated.md>), [accelerators](<https://devfeed.tech/tags/accelerators.md>), [agentic](<https://devfeed.tech/tags/agentic.md>), [agentic-ai](<https://devfeed.tech/tags/agentic-ai.md>), [agentic-systems](<https://devfeed.tech/tags/agentic-systems.md>), [agents](<https://devfeed.tech/tags/agents.md>), [ai](<https://devfeed.tech/tags/ai.md>), [ai-workflow](<https://devfeed.tech/tags/ai-workflow.md>), [applications](<https://devfeed.tech/tags/applications.md>), [architectures](<https://devfeed.tech/tags/architectures.md>), [autonomous](<https://devfeed.tech/tags/autonomous.md>), [benchmark](<https://devfeed.tech/tags/benchmark.md>), [c-plus-plus](<https://devfeed.tech/tags/c-plus-plus.md>), [code](<https://devfeed.tech/tags/code.md>), [code-generation](<https://devfeed.tech/tags/code-generation.md>), [cs-ai](<https://devfeed.tech/tags/cs-ai.md>), [cs-dc](<https://devfeed.tech/tags/cs-dc.md>), [cs-lg](<https://devfeed.tech/tags/cs-lg.md>), [cs-se](<https://devfeed.tech/tags/cs-se.md>), [fortran](<https://devfeed.tech/tags/fortran.md>), [legacy](<https://devfeed.tech/tags/legacy.md>), [portable](<https://devfeed.tech/tags/portable.md>), [workflow](<https://devfeed.tech/tags/workflow.md>)

## AI overview

The paper reports an agentic workflow that uses specialized LLM agents to translate Fortran kernels into Kokkos C++, then validate, compile, run, test, debug, and optimize them for heterogeneous hardware. Across benchmark kernels, paid OpenAI models GPT-5 and o4-mini-high reportedly produced optimized codes that outperformed Fortran baselines at a cost of a few U.S. dollars per workflow run. Open-source Llama4-Maverick often failed to produce functional code. The evidence describes benchmark results and feasibility, not performance across all scientific applications.

## Source excerpt

arXiv:2509.12443v4 Announce Type: replace-cross Abstract: Scientific applications continue to rely on legacy Fortran codebases originally developed for homogeneous, CPU-based systems. As High-Performance Computing (HPC) shifts toward heterogeneous GPU-accelerated architectures, many accelerators lack native Fortran bindings, creating an urgent need to modernize legacy codes for portability. Frameworks like Kokkos provide performance portability and a single-source C++ abstraction, but manual Fortran-to-Kokkos porting demands significant expertise and time. Large language models (LLMs) have shown promise in source-to-source code generation, yet their use in fully autonomous workflows for translating and optimizing parallel code remains largely unexplored, especially for performance portability across diverse hardware. This paper presents an agentic AI workflow where specialized LLM "agents" collaborate to translate, validate, compile, run, test, debug, and optimize Fortran kernels into portable Kokkos C++ programs. Results show the pipeline modernizes a range of benchmark kernels, producing performance-portable Kokkos codes across hardware partitions. Paid OpenAI models such as GPT-5 and o4-mini-high executed the workflow for only a few U.S. dollars, generating optimized codes that surpassed Fortran baselines, whereas open-source models like Llama4-Maverick often failed to yield functional codes. This work demonstrates the feasibility of agentic AI for Fortran-to-Kokkos transformation and offers a pathway for autonomously modernizing legacy scientific applications to run portably and efficiently on diverse supercomputers. It further highlights the potential of LLM-driven agentic systems to perform structured, domain-specific reasoning tasks in scientific and systems-oriented applications.