Code Monkey home page Code Monkey logo

cl's Introduction

Accelerated computing with OpenCL

Open Compute Language (OpenCL) provides a programming framework for harnessing the compute capabilities of multicore processors. In this teaching series we cover a majority of the concepts for working with OpenCL in the context of supercomputing. We use the OpenCL 3.0 standard.

Folder structure

  • course_material - contains the course material.
  • deployment - contains tools for deploying course material to Github and managing users.
  • resources - helpful tools and information for use within the course.

Syllabus

In this course we cover the following topics. Each topic is a subfolder in course_material.

  • Lesson 1 - Introduction to OpenCL and high level features
  • Lesson 2 - How to build and run OpenCL applications on Cray AMD systems like Frontier and Setonix
  • Lesson 3 - A complete example of matrix multiplication, explained line by line
  • Lesson 4 - Debugging OpenCL applications
  • Lesson 5 - Measuring the performance of OpenCL applications with profiling and tracing tools
  • Lesson 6 - Memory management
  • Lesson 7 - Shared virtual memory
  • Lesson 8 - Strategies for improving the performance of OpenCL kernels
  • Lesson 9 - Strategies for optimising application performance with concurrent IO.

Format

Lessons are in the form of Jupyter notebooks which can be viewed on the student's machine with JupyterLab or html files that can be viewed with a web browser. All exercises may be performed on the command line using an SSH connection to a remote server that has one or more implementations of OpenCL installed.

Installation and dependencies

Anaconda Python (optional)

A recent version of Anaconda Python is helpful for viewing the notebook files. Once Anaconda is installed create a new environment

conda create --name opencl_course python=3.10 nodejs=18.15.0
conda activate opencl_course

A list of helpful packages for viewing the material may then be installed with this command when run from the OpenCL_Course folder.

pip install -r deployment/requirements.txt

then run

jupyter-lab

from the command line to start the Jupyter Lab environment. The command

conda activate opencl_course

is to enter the created environment, and the command

conda deactivate

will leave the environment.

Compiler

A C++ compiler must be installed and available through the CC command.

OpenCL

Access to at least one OpenCL implementation is necessary. For teaching purposes it is preferred to have at least one CPU implementation and at least one GPU implementation installed, each with their icd files placed in /etc/OpenCL/vendors. The path to the OpenCL ICD loader libOpenCL.so must be in both LIBRARY_PATH and LD_LIBRARY_PATH. The location of the OpenCL headers, the CL directory (i.e where the file opencl.h lives) must be in CPATH. Khronos has a recent ICD loader and headers that can be used to compile with and link against. Alternatively a fairly recent package for the OpenCL headers and ICD loader may be installed through a package manager.

OpenCL implementations

Here are some computing frameworks that contain OpenCL implementations. The trademark for each company is the property of their respective owners.

Oclgrind

The debugging sections of this course use the excellent open source tool Oclgrind. This can be installed through a package manager.

Tau

Tau stands for Tuning and Analysis Utilities. In the profiling section we use Tau to trace OpenCL calls.

CLBlast

CLBlast is a linear algebra library we use to compare the performance of OpenCL kernels. This may be installed through a package manager.

cl's People

Contributors

drtpotter 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.