OOP on the GPU: An OpenCLS Extension

Student thesis: Master thesis (including HD thesis)

  • Mads Emil Bøgh Holm
  • Minh Hieu Nguyen
  • Stefan Mathias Holst Christiansen
  • Jonas Martin Kærlev
4. term, Software, Master (Master Programme)
This report details the development of OpenCLS
2, an extension of the OpenCLS 1
project. The OpenCLS 2 project aims to reduce
split codebases for GPU development,
by allowing CPU code (C#) to be compiled
to GPU code (OpenCL C) and executed
on the GPU. The focus of OpenCLS
2 is to extend the set of features that the
OpenCLS projects support, by implementing
support for object-oriented programming
(OOP) through the three OOP pillars: inheritance,
encapsulation and polymorphism.
This is achieved through the Roslyn platform
and the OpenCL wrapper CLOO. The Roslyn
platform is utilized to build a syntax tree for
C# code, which OpenCLS 2 iterates through
to generate OpenCL C code. The OpenCL
C code is then executed on the GPU using
CLOO. The implementations of inheritance,
encapsulation and polymorphism are tested
through unit tests, design pattern tests, all
of which OpenCLS 2 passes. OpenCLS 2
achieves similar performance to related work,
and better performance than the CPU by a
factor of 3.5 for large computation and without
host-device communication.
LanguageEnglish
Publication date13 Jun 2016
Number of pages102
ID: 235162855