Orchestra: CPU-GPU Cooperative Programming in Elixir
Resumo
This paper presents Orchestra, a set of abstractions embedded in the Elixir language for defining parallel kernels that can be easily executed on CPUs and GPUs. This execution model enables heterogeneous cooperative programming, where different processors (the CPU and GPU) work together to solve a computational problem. Building upon the PolyHok DSL, Orchestra’s kernels are polymorphic and higher-order, enabling the construction of parallel abstractions such as algorithmic skeletons that can execute across different devices. Orchestra is compatible with the Elixir Nx tensor library and combines low-level control over computation with high-level facilities, such as dynamic typing, garbage-collected CPU and GPU memory, and simplified host-device data transfers.
Palavras-chave:
DSL, Elixir, Parallel Programming, Heterogeneous Computing
Referências
Cédric Augonnet, Samuel Thibault, Raymond Namyst, and Pierre-André Wacrenier. 2011. StarPU: a unified platform for task scheduling on heterogeneous multicore architectures. Concurrency and Computation: Practice and Experience (Feb. 2011), 187–198. DOI: 10.1002/cpe.1631
Tim Besard, Christophe Foket, and Bjorn De Sutter. 2019. Effective Extensible Programming: Unleashing Julia on GPUs. IEEE Transactions on Parallel and Distributed Systems (April 2019). DOI: 10.1109/TPDS.2018.2872064
Kevin J. Brown, HyoukJoong Lee, Tiark Rompf, Arvind K. Sujeeth, Christopher De Sa, Christopher Aberger, and Kunle Olukotun. 2016. Have abstraction and eat performance, too: optimized heterogeneous computing with parallel patterns. In Proceedings of the 2016 International Symposium on Code Generation and Optimization (Barcelona, Spain) (CGO ’16). Association for Computing Machinery, New York, NY, USA, 194–205. DOI: 10.1145/2854038.2854042
Kevin J. Brown, Arvind K. Sujeeth, Hyouk Joong Lee, Tiark Rompf, Hassan Chafi, Martin Odersky, and Kunle Olukotun. 2011. A Heterogeneous Parallel Framework for Domain-Specific Languages. In Proceedings of the 2011 International Conference on Parallel Architectures and Compilation Techniques. IEEE Computer Society. DOI: 10.1109/PACT.2011.15
Nicola Capodieci, Roberto Cavicchioli, and Andrea Marongiu. 2022. A Taxonomy of Modern GPGPU Programming Methods: On the Benefits of a Unified Specification. IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems 41, 6 (2022), 1649–1662. DOI: 10.1109/TCAD.2021.3082863
Manuel M.T. Chakravarty, Gabriele Keller, Sean Lee, Trevor L. McDonell, and Vinod Grover. 2011. Accelerating Haskell array codes with multicore GPUs. In Proceedings of the SixthWorkshop on Declarative Aspects of Multicore Programming. Association for Computing Machinery. DOI: 10.1145/1926354.1926358
María Angélica Dávila Guzmán, Raúl Nozal, Rubén Gran Tejero, María Villarroya-Gaudó, Darío Suárez Gracia, and Jose Luis Bosque. 2019. Cooperative CPU, GPU, and FPGA heterogeneous execution with EngineCL. J. Supercomput. (March 2019). DOI: 10.1007/s11227-019-02768-y
André Du Bois, Tiago Perlin, Frederico Antunes, and Gerson Cavalheiro. 2024. Hok: Higher-Order GPU kernels in Elixir. In Anais SBLP 2024. SBC, Porto Alegre, RS, Brasil, 71–80. DOI: 10.5753/sblp.2024.3690
Andre Rauber Du Bois and Gerson Cavalheiro. 2023. GPotion: An embedded DSL for GPU programming in Elixir. In Proc. SBLP 2023 (Campo Grande, MS, Brazil). ACM, New York, USA, 1–8. DOI: 10.1145/3624309.3624314
André Rauber Du Bois and Gerson Cavalheiro. 2025. Polymorphic Higher-Order GPU Kernels. In Euro-Par 2025: 31st European Conference on Parallel and Distributed Processing, Proceedings, Part I (Dresden, Germany). Springer-Verlag, Berlin, Heidelberg, 100–113. DOI: 10.1007/978-3-031-99854-6_7
Elixir Team. 2026. Elixir Lang. Doc. The Elixir Team. [link] Disponível em: [link].
August Ernstsson, Johan Ahlqvist, Stavroula Zouzoula, and Christoph Kessler. 2021. SkePU 3: Portable High-Level Programming of Heterogeneous Systems and HPC Clusters. International Journal of Parallel Programming (Dec. 2021). DOI: 10.1007/s10766-021-00704-3
Leonardo Faé and Dalvan Griebler. 2025. Towards GPU Parallelism Abstractions in Rust: A Case Study with Linear Pipelines. In Anais do XXIX Simpósio Brasileiro de Linguagens de Programação. SBC. DOI: 10.5753/sblp.2025.13152
Juan Gómez-Luna, Izzat El Hajj, Victor Chang, Li-Wen Garcia-Flores, Simon Garcia de Gonzalo, Thomas Jablin, Antonio J Pena, and Wen-mei Hwu. 2017. Chai: Collaborative Heterogeneous Applications for Integrated-architectures. In Performance Analysis of Systems and Software (ISPASS), 2017 IEEE International Symposium on. IEEE.
Dalvan Griebler, Marco Danelutto, Massimo Torquati, and Luiz Gustavo Fernandes. 2017. SPar: A DSL for High-Level and Productive Stream Parallelism. Parallel Processing Letters (2017). DOI: 10.1142/S0129626417400059
Troels Henriksen, Niels G. W. Serup, Martin Elsman, Fritz Henglein, and Cosmin E. Oancea. 2017. Futhark: purely functional GPU-programming with nested parallelism and in-place array updates. SIGPLAN Not. (June 2017). DOI: 10.1145/3140587.3062354
Intel. 2023. Heterogeneous vs. Homogeneous Computing Environments. [link]. [Accessed 29-05-2026].
Laxmikant V. Kalé and David M. Kunzman. 2011. Programming Heterogeneous Systems . In 2013 IEEE International Symposium on Parallel & Distributed Processing, Workshops and Phd Forum. IEEE Computer Society, Los Alamitos, CA, USA, 2061–2064. DOI: 10.1109/IPDPS.2011.377
Khronos OpenCL Working Group. 2026. The OpenCL™ Specification. [link]. Version v3.1.1, [Accessed 30-05-2026].
Jure Leskovec and Andrej Krevl. 2014. SNAP Datasets: Stanford Large Network Dataset Collection. [link].
Michael D. Linderman, Jamison D. Collins, HongWang, and Teresa H. Meng. 2008. Merge: a programming model for heterogeneous multi-core systems. SIGOPS Oper. Syst. Rev. (March 2008), 287–296. DOI: 10.1145/1353535.1346318
Rita Loogen, Ortega-Mallén Yolanda, and Ricardo Peña. 2005. Parallel functional programming in Eden. J. Funct. Program. 15 (05 2005), 431–475. DOI: 10.1017/S0956796805005526
Nurlan Nazaraliyev, Elaheh Sadredini, and Nael Abu-Ghazaleh. 2025. DREAM: Device-Driven Efficient Access to Virtual Memory. In Proceedings of the 39th ACM International Conference on Supercomputing (ICS ’25). Association for Computing Machinery, New York, NY, USA, 1190–1205. DOI: 10.1145/3721145.3725748
Henrique Gabriel Rodrigues, André Rauber Du Bois, and Gerson Geraldo H. Cavalheiro. 2026. Kernels de Ordem Superior para GPUs Compatíveis com OpenCL Utilizando Metaprogramação em Elixir. In Anais do Seminário Integrado de Software e Hardware (SEMISH).
Oren Segal, Philip Colangelo, Nasibeh Nasiri, Zhuo Qian, and Martin Margala. 2015. SparkCL: A Unified Programming Framework for Accelerators on Heterogeneous Clusters. arXiv:1505.01120 [cs.DC] [link]
Amar Shan. 2006. Heterogeneous Processing: a Strategy for Augmenting Moore’s Law. [link]. [Accessed 29-05-2026].
Ding Tang, Jiecheng Zhou, Jiakai Hu, Shengwei Li, Huihuang Zheng, Zhilin Pei, Hui Wang, and Xingcheng Zhang. 2025. H2:Towards Efficient Large-Scale LLM Training on Hyper-Heterogeneous Cluster over 1,000 Chips. arXiv:2505.17548 [cs.DC] [link]
Lanjun Wan, Weihua Zheng, and Xinpan Yuan. 2021. HCE: A Runtime System for Efficiently Supporting Heterogeneous Cooperative Execution. IEEE Access (2021). DOI: 10.1109/ACCESS.2021.3124856
Tim Besard, Christophe Foket, and Bjorn De Sutter. 2019. Effective Extensible Programming: Unleashing Julia on GPUs. IEEE Transactions on Parallel and Distributed Systems (April 2019). DOI: 10.1109/TPDS.2018.2872064
Kevin J. Brown, HyoukJoong Lee, Tiark Rompf, Arvind K. Sujeeth, Christopher De Sa, Christopher Aberger, and Kunle Olukotun. 2016. Have abstraction and eat performance, too: optimized heterogeneous computing with parallel patterns. In Proceedings of the 2016 International Symposium on Code Generation and Optimization (Barcelona, Spain) (CGO ’16). Association for Computing Machinery, New York, NY, USA, 194–205. DOI: 10.1145/2854038.2854042
Kevin J. Brown, Arvind K. Sujeeth, Hyouk Joong Lee, Tiark Rompf, Hassan Chafi, Martin Odersky, and Kunle Olukotun. 2011. A Heterogeneous Parallel Framework for Domain-Specific Languages. In Proceedings of the 2011 International Conference on Parallel Architectures and Compilation Techniques. IEEE Computer Society. DOI: 10.1109/PACT.2011.15
Nicola Capodieci, Roberto Cavicchioli, and Andrea Marongiu. 2022. A Taxonomy of Modern GPGPU Programming Methods: On the Benefits of a Unified Specification. IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems 41, 6 (2022), 1649–1662. DOI: 10.1109/TCAD.2021.3082863
Manuel M.T. Chakravarty, Gabriele Keller, Sean Lee, Trevor L. McDonell, and Vinod Grover. 2011. Accelerating Haskell array codes with multicore GPUs. In Proceedings of the SixthWorkshop on Declarative Aspects of Multicore Programming. Association for Computing Machinery. DOI: 10.1145/1926354.1926358
María Angélica Dávila Guzmán, Raúl Nozal, Rubén Gran Tejero, María Villarroya-Gaudó, Darío Suárez Gracia, and Jose Luis Bosque. 2019. Cooperative CPU, GPU, and FPGA heterogeneous execution with EngineCL. J. Supercomput. (March 2019). DOI: 10.1007/s11227-019-02768-y
André Du Bois, Tiago Perlin, Frederico Antunes, and Gerson Cavalheiro. 2024. Hok: Higher-Order GPU kernels in Elixir. In Anais SBLP 2024. SBC, Porto Alegre, RS, Brasil, 71–80. DOI: 10.5753/sblp.2024.3690
Andre Rauber Du Bois and Gerson Cavalheiro. 2023. GPotion: An embedded DSL for GPU programming in Elixir. In Proc. SBLP 2023 (Campo Grande, MS, Brazil). ACM, New York, USA, 1–8. DOI: 10.1145/3624309.3624314
André Rauber Du Bois and Gerson Cavalheiro. 2025. Polymorphic Higher-Order GPU Kernels. In Euro-Par 2025: 31st European Conference on Parallel and Distributed Processing, Proceedings, Part I (Dresden, Germany). Springer-Verlag, Berlin, Heidelberg, 100–113. DOI: 10.1007/978-3-031-99854-6_7
Elixir Team. 2026. Elixir Lang. Doc. The Elixir Team. [link] Disponível em: [link].
August Ernstsson, Johan Ahlqvist, Stavroula Zouzoula, and Christoph Kessler. 2021. SkePU 3: Portable High-Level Programming of Heterogeneous Systems and HPC Clusters. International Journal of Parallel Programming (Dec. 2021). DOI: 10.1007/s10766-021-00704-3
Leonardo Faé and Dalvan Griebler. 2025. Towards GPU Parallelism Abstractions in Rust: A Case Study with Linear Pipelines. In Anais do XXIX Simpósio Brasileiro de Linguagens de Programação. SBC. DOI: 10.5753/sblp.2025.13152
Juan Gómez-Luna, Izzat El Hajj, Victor Chang, Li-Wen Garcia-Flores, Simon Garcia de Gonzalo, Thomas Jablin, Antonio J Pena, and Wen-mei Hwu. 2017. Chai: Collaborative Heterogeneous Applications for Integrated-architectures. In Performance Analysis of Systems and Software (ISPASS), 2017 IEEE International Symposium on. IEEE.
Dalvan Griebler, Marco Danelutto, Massimo Torquati, and Luiz Gustavo Fernandes. 2017. SPar: A DSL for High-Level and Productive Stream Parallelism. Parallel Processing Letters (2017). DOI: 10.1142/S0129626417400059
Troels Henriksen, Niels G. W. Serup, Martin Elsman, Fritz Henglein, and Cosmin E. Oancea. 2017. Futhark: purely functional GPU-programming with nested parallelism and in-place array updates. SIGPLAN Not. (June 2017). DOI: 10.1145/3140587.3062354
Intel. 2023. Heterogeneous vs. Homogeneous Computing Environments. [link]. [Accessed 29-05-2026].
Laxmikant V. Kalé and David M. Kunzman. 2011. Programming Heterogeneous Systems . In 2013 IEEE International Symposium on Parallel & Distributed Processing, Workshops and Phd Forum. IEEE Computer Society, Los Alamitos, CA, USA, 2061–2064. DOI: 10.1109/IPDPS.2011.377
Khronos OpenCL Working Group. 2026. The OpenCL™ Specification. [link]. Version v3.1.1, [Accessed 30-05-2026].
Jure Leskovec and Andrej Krevl. 2014. SNAP Datasets: Stanford Large Network Dataset Collection. [link].
Michael D. Linderman, Jamison D. Collins, HongWang, and Teresa H. Meng. 2008. Merge: a programming model for heterogeneous multi-core systems. SIGOPS Oper. Syst. Rev. (March 2008), 287–296. DOI: 10.1145/1353535.1346318
Rita Loogen, Ortega-Mallén Yolanda, and Ricardo Peña. 2005. Parallel functional programming in Eden. J. Funct. Program. 15 (05 2005), 431–475. DOI: 10.1017/S0956796805005526
Nurlan Nazaraliyev, Elaheh Sadredini, and Nael Abu-Ghazaleh. 2025. DREAM: Device-Driven Efficient Access to Virtual Memory. In Proceedings of the 39th ACM International Conference on Supercomputing (ICS ’25). Association for Computing Machinery, New York, NY, USA, 1190–1205. DOI: 10.1145/3721145.3725748
Henrique Gabriel Rodrigues, André Rauber Du Bois, and Gerson Geraldo H. Cavalheiro. 2026. Kernels de Ordem Superior para GPUs Compatíveis com OpenCL Utilizando Metaprogramação em Elixir. In Anais do Seminário Integrado de Software e Hardware (SEMISH).
Oren Segal, Philip Colangelo, Nasibeh Nasiri, Zhuo Qian, and Martin Margala. 2015. SparkCL: A Unified Programming Framework for Accelerators on Heterogeneous Clusters. arXiv:1505.01120 [cs.DC] [link]
Amar Shan. 2006. Heterogeneous Processing: a Strategy for Augmenting Moore’s Law. [link]. [Accessed 29-05-2026].
Ding Tang, Jiecheng Zhou, Jiakai Hu, Shengwei Li, Huihuang Zheng, Zhilin Pei, Hui Wang, and Xingcheng Zhang. 2025. H2:Towards Efficient Large-Scale LLM Training on Hyper-Heterogeneous Cluster over 1,000 Chips. arXiv:2505.17548 [cs.DC] [link]
Lanjun Wan, Weihua Zheng, and Xinpan Yuan. 2021. HCE: A Runtime System for Efficiently Supporting Heterogeneous Cooperative Execution. IEEE Access (2021). DOI: 10.1109/ACCESS.2021.3124856
Publicado
08/09/2026
Como Citar
RODRIGUES, Henrique Gabriel; MAILAN, Eduardo Beloni; CAVALHEIRO, Gerson Geraldo H.; DU BOIS, André Rauber.
Orchestra: CPU-GPU Cooperative Programming in Elixir. In: SIMPÓSIO BRASILEIRO DE LINGUAGENS DE PROGRAMAÇÃO (SBLP), 30. , 2026, São Paulo/SP.
Anais [...].
Porto Alegre: Sociedade Brasileira de Computação,
2026
.
p. 98-106.
DOI: https://doi.org/10.5753/sblp.2026.28573.
