skip to main content
research-article

Nikola: embedding compiled GPU functions in Haskell

Published:30 September 2010Publication History
Skip Abstract Section

Abstract

We describe Nikola, a first-order language of array computations embedded in Haskell that compiles to GPUs via CUDA using a new set of type-directed techniques to support re-usable computations. Nikola automatically handles a range of low-level details for Haskell programmers, such as marshaling data to/from the GPU, size inference for buffers, memory management, and automatic loop parallelization. Additionally, Nikola supports both compile-time and run-time code generation, making it possible for programmers to choose when and where to specialize embedded programs.

Skip Supplemental Material Section

Supplemental Material

haskell-1330-mainland.mov

References

  1. }}Robert Atkey, Sam Lindley, and Jeremy Yallop. Unembedding domain-specific languages. In Proceedings of the 2nd ACM SIGPLAN Symposium on Haskell (Haskell '09), pages 37--48, Edinburgh, Scotland, 2009. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. }}Per Bjesse, Koen Claessen, Mary Sheeran, and Satnam Singh. Lava: hardware design in haskell. In Proceedings of the 3rd ACM SIGPLAN International Conference on Functional Programming (ICFP '98), pages 174--184, Baltimore, Maryland, United States, 1998. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. }}Guy E Blelloch. Prefix sums and their applications. Technical Report CMU-CS-90-190, School of Computer Science, Carnegie Mellon University, 1990.Google ScholarGoogle Scholar
  4. }}Guy E. Blelloch, Jonathan C. Hardwick, Jay Sipelstein, Marco Zagha, and Siddhartha Chatterjee. Implementation of a portable nested data-parallel language. Journal of Parallel and Distributed Computing, 21 (1): 4--14, 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. }}Manuel Chakravarty, Gabriele Keller, and Sean Lee. accelerate, October 2009. URL http://www.cse.unsw.edu.au/~chak/project/accelerate/.Google ScholarGoogle Scholar
  6. }}Koen Claessen and David Sands. Observable sharing for functional circuit description. In Proceedings of the 5th Asian Computing Science Conference on Advances in Computing Science, pages 62--73. Springer-Verlag, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. }}Conal Elliott. Functional images. In The Fun of Programming, "Cornerstones of Computing" series. Palgrave, March 2003.Google ScholarGoogle Scholar
  8. }}Conal Elliott. Programming graphics processors functionally. In Proceedings of the 2004 ACM SIGPLAN Workshop on Haskell (Haskell '04), pages 45--56, Snowbird, Utah, USA, 2004. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. }}Conal Elliott, Sigbjörn Finne, and Oege De Moor. Compiling embedded languages. Journal of Functional Programming, 13 (3): 455--481, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. }}David Gay, Philip Levis, J. Robert von Behren, Matt Welsh, Eric A. Brewer, and David E. Culler. The nesC language: A holistic approach to networked embedded systems. In Proceedings of the ACM SIGPLAN 2003 conference on Programming Language Design and Implementation (PLDI '03), page 1--11. ACM, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. }}Andy Gill. Type-safe observable sharing in haskell. In Proceedings of the 2nd ACM SIGPLAN Symposium on Haskell (Haskell '09), pages 117--128, Edinburgh, Scotland, 2009. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. }}John Hughes. The design of a pretty-printing library. In J. Jeuring and E. Meijer, editors, Advanced Functional Programming, pages 53--96. Springer Verlag, LNCS 925, 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. }}Graham Hutton. Higher-order functions for parsing. Journal of Functional Programming, 2 (3): 323---343, July 1992.Google ScholarGoogle ScholarCross RefCross Ref
  14. }}Andreas Klöckner, Nicolas Pinto, Yunsup Lee, Bryan Catanzaro, Paul Ivanov, and Ahmed Fasih. PyCUDA: GPU Run-Time code generation for High-Performance computing. 0911.3456, November 2009.Google ScholarGoogle Scholar
  15. }}Sean Lee, Manuel Chakravarty, Vinod Grover, and Gabriele Keller. GPU kernels as Data-Parallel array computations in haskell. In Workshop on Exploiting Parallelism using GPUs and other Hardware-Assisted Methods (EPAHM 2009), 2009.Google ScholarGoogle Scholar
  16. }}Daan Leijen and Erik Meijer. Domain specific embedded compilers. In Proceedings of the 2nd conference on Domain-specific languages, pages 109--122, Austin, Texas, United States, 1999. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. }}Roman Leshchinskiy. vector: Efficient arrays, February 2010. URL http://hackage.haskell.org/package/vector.Google ScholarGoogle Scholar
  18. }}Geoffrey Mainland. Why it's nice to be quoted: quasiquoting for haskell. In Proceedings of the ACM SIGPLAN Workshop on Haskell (Haskell '07), page 73--82, New York, NY, USA, 2007. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. }}Geoffrey Mainland, Greg Morrisett, and Matt Welsh. Flask: Staged functional programming for sensor networks. In Proceeding of the 13th ACM SIGPLAN International Conference on Functional Programming (ICFP '08), page 335--346, New York, NY, USA, 2008. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. }}John T. O'Donnell. Generating netlists from executable circuit specifications. In Proceedings of the 1992 Glasgow Workshop on Functional Programming, pages 178--194. Springer-Verlag, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. }}Izzet Pembeci, Henrik Nilsson, and Gregory Hager. Functional reactive robotics: an exercise in principled integration of domain-specific languages. In Proceedings of the 4th ACM SIGPLAN International Conference on Principles and Practice of Declarative Programming, pages 168--179, Pittsburgh, PA, USA, 2002. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. }}Simon L. Peyton Jones, Roman Leshchinskiy, and Manuel Chakravarty. Harnessing the multicores: Nested data parallelism in haskell. In Programming Languages and Systems, page 138. 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. }}F. Pfenning and C. Elliot. Higher-order abstract syntax. In Proceedings of the ACM SIGPLAN 1988 conference on Programming Language Design and Implementation (PLDI '88), pages 199--208, Atlanta, Georgia, United States, 1988. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. }}Tim Sheard and Simon L. Peyton Jones. Template meta-programming for haskell. In Proceedings of the 2002 ACM SIGPLAN Workshop on Haskell (Haskell '02), pages 1--16, Pittsburgh, Pennsylvania, 2002. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. }}Joel Svensson, Koen Claessen, and Mary Sheeran. Obsidian: A domain specific embedded language for parallel programming of graphics processors. In Proceedings of 20th International Symposium on the Implementation and Application of Functional Languages (IFL '08), Hatfield, UK, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. }}Joel Svensson, Koen Claessen, and Mary Sheeran. GPGPU kernel implementation using an embedded language: a status report. Technical Report 2010:01, Chalmers University of Technology, January 2010.Google ScholarGoogle Scholar
  27. }}Walid Taha and Tim Sheard. Multi-stage programming with explicit annotations. In Proceedings of the 1997 ACM SIGPLAN symposium on Partial Evaluation and Semantics-Based Program Manipulation (PEPM '97), pages 203--217, Amsterdam, The Netherlands, 1997. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Nikola: embedding compiled GPU functions in Haskell

    Recommendations

    Comments

    Login options

    Check if you have access through your login credentials or your institution to get full access on this article.

    Sign in

    Full Access

    • Published in

      cover image ACM SIGPLAN Notices
      ACM SIGPLAN Notices  Volume 45, Issue 11
      HASKELL '10
      November 2010
      156 pages
      ISSN:0362-1340
      EISSN:1558-1160
      DOI:10.1145/2088456
      Issue’s Table of Contents
      • cover image ACM Conferences
        Haskell '10: Proceedings of the third ACM Haskell symposium on Haskell
        September 2010
        166 pages
        ISBN:9781450302524
        DOI:10.1145/1863523

      Copyright © 2010 ACM

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 30 September 2010

      Check for updates

      Qualifiers

      • research-article

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader
    About Cookies On This Site

    We use cookies to ensure that we give you the best experience on our website.

    Learn more

    Got it!