{"id":20789716,"url":"https://github.com/jjfumero/marawacc","last_synced_at":"2025-08-13T02:46:30.620Z","repository":{"id":197970568,"uuid":"319253934","full_name":"jjfumero/marawacc","owner":"jjfumero","description":"Parallel programming framework for accelerating Java programs on GPUs and multi-core CPUs. ","archived":false,"fork":false,"pushed_at":"2021-04-11T06:32:35.000Z","size":821,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-07-26T07:44:31.249Z","etag":null,"topics":["acceleleration","code-generation","gpus","graal","graalvm","java","jit","jvm","opencl","phd-thesis"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jjfumero.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2020-12-07T08:34:37.000Z","updated_at":"2024-08-18T06:28:57.000Z","dependencies_parsed_at":"2023-10-23T05:30:35.900Z","dependency_job_id":null,"html_url":"https://github.com/jjfumero/marawacc","commit_stats":null,"previous_names":["jjfumero/marawacc"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jjfumero/marawacc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jjfumero%2Fmarawacc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jjfumero%2Fmarawacc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jjfumero%2Fmarawacc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jjfumero%2Fmarawacc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jjfumero","download_url":"https://codeload.github.com/jjfumero/marawacc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jjfumero%2Fmarawacc/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270170397,"owners_count":24539357,"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","status":"online","status_checked_at":"2025-08-13T02:00:09.904Z","response_time":66,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["acceleleration","code-generation","gpus","graal","graalvm","java","jit","jvm","opencl","phd-thesis"],"created_at":"2024-11-17T15:26:30.450Z","updated_at":"2025-08-13T02:46:30.047Z","avatar_url":"https://github.com/jjfumero.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# README #\n\nMarawacc is a compiler framework for OpenCL Just-In-Time (JIT) that automatically compiles a subset of the Java bytecode into OpenCL, and a runtime system that orchestrates the execution of the GPU program within Java. Marawacc is a research prototype. \n\nMarawacc makes use of the Graal compiler and Truffle DSL ([https://github.com/graalvm/graal](https://github.com/graalvm/graal)) to optimise Java and R programs on top of the JVM. \n\nMarawacc integrates an API, called **JPAI** (Java Parallel Array Interface) [2] to develop GPU and multi-core Java applications using the Function interface in Java 8.\n\nJPAI is a new Java API based on Java 8 Stream for parallel and heterogeneous programming. JPAI uses algorithmic skeletons and the new feature of Java lambda expressions to facilitate the programmability and readability.  Parallel operations using map/reduce in JPAI can be composed and reused. \n\n\n### Install Marawacc ###\n\nSee the [INSTALL.md](INSTALL.md) in this repository. \n\n\n### Run Marawacc ###\n\nOnce Marawacc is compiled, it runs within the Graal VM. To enable OpenCL JIT compilation you need the following flags:\n\n\n```bash\n-jvmci -XX:-BootstrapJVMCI -XX:-UseJVMCIClassLoader -Dmarawacc.printOCLKernel=true \n```\n\n### Marawacc Options ###\n\nSee DOCUMENTATION_OPTIONS.md file in this repository. \n\n\n### Example in JPAI ###\n\nMarawacc is the backend that generates OpenCL code at runtime from the Graal IR and executes the GPU program. \nJPAI is the interface to program GPUs and multi-core CPUs. For GPU execution, JPAI invokes Marawacc. This section shows a full example in JPAI.\n\n\n```java\n\npublic class Hello {\n\n    public static void main(String[] args) {\n\n        // Main Function in JPAI is the ArrayFunction\u003cT, R\u003e\n        // ArrayFunction computes a function from types T to R \n        ArrayFunction\u003cTuple2\u003cInteger, Integer\u003e, Double\u003e computation = new MapAccelerator\u003c\u003e(vectors -\u003e (2.5 * vectors._1() + vectors._2());\n\n        // Prepare the input data\n        int size = 262144;\n        PArray\u003cTuple2\u003cInteger, Integer\u003e\u003e input = new PArray\u003c\u003e(size, TypeFactory.Tuple(\"Tuple2\u003cInteger, Integer\u003e\"));\n        for (int i = 0; i \u003c size; ++i) {\n            input.put(i, new Tuple2\u003c\u003e((double) i, (double) (i + 2)));\n        }\n\n        // Compute on the GPU. The apply method will generate the OpenCL code and execute it on the GPU. \n        PArray\u003cDouble\u003e output = computation.apply(input);\n    }\n}\n\n```\n\n* ArrayFunction\u003cT, R\u003e: it is the main class in JPAI. It extends the Function interface in Java 8 with algorithmic skeletons such as map and reduce. \n* PArray\u003cT\u003e: Portable Array (PArray) is a data structure created for avoiding the data transformation between Java and OpenCL (marshalling) and increase the overall performance. Details of the PArray data structure in [1].\n\n\n# Publications \n\n  [1] Juan Jos� Fumero, Toomas Remmelg, Michel Steuwer, and Christophe Dubach. 2015. **Runtime Code Generation and Data Management for Heterogeneous Computing in Java.** In Proceedings of the Principles and Practices of Programming on The Java Platform (PPPJ '15). ACM, New York, NY, USA, 16-26. DOI: http://dx.doi.org/10.1145/2807426.2807428 \n\n  [2] Juan José Fumero, Michel Steuwer, and Christophe Dubach. 2014. **A Composable Array Function Interface for Heterogeneous Computing in Java.** In Proceedings of ACM SIGPLAN International Workshop on Libraries, Languages, and Compilers for Array Programming (ARRAY'14). ACM, New York, NY, USA, Pages 44, 6 pages. DOI=http://dx.doi.org/10.1145/2627373.2627381\n\n*Marawacc is used as a backend for FastR+GPU project (OpenCL JIT compilation for the R programs using Partial Evaluation in Graal)*\n\n  [3] Juan Fumero, Michel Steuwer, Lukas Stadler, and Christophe Dubach. 2017. **Just-In-Time GPU Compilation for Interpreted Languages with Partial Evaluation.** In Proceedings of the 13th ACM SIGPLAN/SIGOPS International Conference on Virtual Execution Environments (VEE '17). ACM, New York, NY, USA, 60-73. DOI: https://doi.org/10.1145/3050748.3050761\n \n  [4] Juan Fumero, Michel Steuwer, Lukas Stadler, Christophe Dubach. **OpenCL JIT Compilation for Dynamic Programming Language.** MoreVMs 2017. [http://conf.researchr.org/event/MoreVMs-2017/morevms-2017-papers-opencl-jit-compilation-for-dynamic-programming-languages](http://conf.researchr.org/event/MoreVMs-2017/morevms-2017-papers-opencl-jit-compilation-for-dynamic-programming-languages)\n\n  [5] Juan Fumero. **Accelerating interpreted programming languages on GPUs with just-in-time compilation and runtime optimisations**. PhD Dissertation, 30/11/2017 - [Link](https://era.ed.ac.uk/handle/1842/28718)\n\n### License ###\n\nGPL V2\n\n### Who do I talk to? ###\n\nMarawacc project is a part of my PhD at the University of Edinburgh. My PhD has been partially funded by Oracle Labs.\n\n#### Main Developer\n\n* Juan Fumero \u003cjuan.fumero @ manchester.ac.uk\u003e\n\n#### Supervisors\n\n* Christophe Dubach \u003cchristophe.dubach @ ed.ac.uk\u003e \n* Michel Steuwer \u003cmichel.steuwer @ ed.ac.uk \u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjjfumero%2Fmarawacc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjjfumero%2Fmarawacc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjjfumero%2Fmarawacc/lists"}