Giter VIP home page Giter VIP logo

openclada's Introduction

OpenCLAda - An Ada binding for the OpenCL host API

About

This is OpenCLAda, a thick Ada binding for the OpenCL host API. This binding enables you to write OpenCL hosts in Ada. It does not enable you to write OpenCL kernels in Ada.

Prerequisites

OpenCLAda currently supports MacOSX, Linux and Windows. You need to have

  • a GNAT compiler
  • an OpenCL implementation
  • optionally OpenGLAda (if you want to use the cl_gl extension)

available on your system. GNAT GPL Edition is available at the AdaCore website. OpenCL is usually available from your hardware vendor. On MacOSX, it's already part of the operating system. On Windows, you'll need an OpenCL.lib file to link against. This is usually not part of the OpenCL implementation, but can be acquired as part of an SDK from your hardware vendor (eg the AMD APP SDK).

OpenGLAda is required for OpenCL's cl_gl extension. Just download its source and make sure the path to opengl.gpr is included in the ADA_PROJECT_PATH environment variable. To compile the tests, you also need the GLFW library version 2, which is used for window construction in the cl_gl tests.

Compilation

On MacOSX and Linux, open a terminal, navigate to the OpenCLAda directory and do:

$ make

On Windows, it could work the same way if you're using MinGW or Cygwin. However, I didn't try either one. Anyway, to compile without make, just do

$ gnatmake -p -Popencl-cl_gl.gpr -XWindowing_System=windows

Note: The variable Windowing_System is shared with OpenGLAda. You have to provide it even when compiling without OpenGL support because it defines the way OpenCLAda links with your system libraries.

On Windows, the compiler needs to find the OpenCL.lib file mentioned above. If you're unsure how to achieve this, just copy it into C:\GNAT\[version]\lib or wherever you installed your GNAT compiler.

Note: The availability of an OpenCL implementation will not be tested when building OpenCLAda. So if you want to make sure that OpenCL is available, build the tests and see if they are linked properly (see below).

If you want to build OpenCLAda without the cl_gl extension, do

$ gprbuild -p -P opencl.gpr -XWindowing_System={windows|quartz|x11}

Note: The makefile does not support switching off cl_gl, because I'm lazy.

Installation

OpenCLAda is just a wrapper library and does not include an installation routine. You can just add it to your project.

Tests

OpenCLAda comes with some tests (or rather, examples). I wrote them to test some of the basic functionality of the API. You can build them with

$ make tests

or

$ gnatmake -p -P opencl_test.gpr -XGL_Backend={windows|quartz|x11}

A basic "hello world" example is also included. After compilation, the executables will be located in the bin directory. They can only be executed in the bin directory, as they load some OpenCL kernel files through relative paths.

Usage

There is some overview over the OpenCLAda API on the Wiki, which is outdated and will shortly replaced by a new documentation section on the homepage. For more information, please consult the Khronos OpenCL API Registry.

Contributing

You're welcome to contribute code or file bug reports on the project's page on GitHub.

License

This code is distributed under the terms of the ISC License, which you can find in the file COPYING.

openclada's People

Contributors

flyx avatar rashfael avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.