Giter Club home page Giter Club logo

alcl's Introduction

  ___   _     _____  _       _____     _             _       _ 
 / _ \ | |   /  __ \| |     |_   _|   | |           (_)     | |
/ /_\ \| |   | /  \/| |       | |_   _| |_ ___  _ __ _  __ _| |
|  _  || |   | |    | |       | | | | | __/ _ \| '__| |/ _` | |
| | | || |___| \__/\| |____   | | |_| | || (_) | |  | | (_| | |
\_| |_/\_____/\____/\_____/   \_/\__,_|\__\___/|_|  |_|\__,_|_|
                                                               
                                                               

Argonne Leadership Computing Facility OpenCL / L0 tutorial.

Examples are provided in C, C++, Python and Ruby.

# Create all the executable
make
# Run all the executable
make run

For Python examples you need to have pyopencl installed. For Ruby you need the opencl_ruby_ffi gem installed.

Introduction to the API

platform (Python: query_platform.py)

  • Simple OpenCL C example to list your platform
  • make run_platform

tiny_clinfo

  • List all the device for all the platform in your system (inspired by the "standard" clinfo tools)
  • make run_tiny_clinfo

Hello world and ID

my_first_kernel

  • Hello world kernel. Each work-item will print is global_id (rank in MPI terminology)
  • make run_my_first_kernel
  • Usage: ./my_first_kernel platform_id device_id global_size local_size

verbose

  • Verbose kernel, more introspective. Each work-item will print is global and local id. And the associated total size.
  • make run_verbose
  • Usage: ./my_first_kernel platform_id device_id global_size local_size

Where do I put my kernel?

read_cl

  • Similar to verbose, but we read the kernel string from a file
  • make run_read_cl
  • Usage: ./read_cl platform_id device_id global_size local_size

read_bincl

  • Similar to verbose, but we precopile the kernel and then read it
  • make run_read_bincl
  • Usage: ./read_bincl platform_id device_id global_size local_size

read_elfcl (C and C++ only)

  • Similar to verbose, but store the precompiler opencl kernel inside the execetuable.
  • make run_read_elfcf
  • Usage: ./read_elfcl platform_id device_id global_size local_size

Buffer

buffer (Python: buffer_usage.py)

  • How to create and use buffer
  • make run_buffer

Ordering

event_unorder

  • How to use and out of order queue
  • make run_event_unorder
  • Usage: ./event_unorder platform_id device_id global_size local_size number_of_kernel_launch

event_order

  • How to use and out of order queue and event to impose and order
  • make run_event_order
  • Usage: ./event_unorder platform_id device_id global_size local_size number_of_kernel_launch

Profiling

profiling

  • How to measure exution time of a kernel
  • make run_profiling

alcl's People

Contributors

kerilk avatar tapplencourt avatar servesh 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.