Skip to content

A repository of GPU programming examples in Chapel

Notifications You must be signed in to change notification settings

e-kayrakli/ChapelOnGpu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

chapel logo

This repository contains GPU programming examples using Chapel.

Overview of Examples

Examples are in their own directories with an associated README file describing the concepts introduced very briefly alongside some links for further reading. These directories are

  • 00-intro: No GPU programming here, just fundamental Chapel concepts
  • 01-basics: Allocating Chapel arrays and running Chapel loops on GPU
  • 02-locale: Running the same code on the GPU and CPU using locale variables
  • 03-math-reduce: Kernels with some math operations and reductions
  • 04-math-reduce-comm: Same as above, but with CPU-GPU data transfers

Quickstart Instructions

Here's some quick start instructions. For more detailed information, please check out Chapel documentation and the GPU technical note. The following assumes that either nvcc or hipcc exists and accessible in the terminal session.

  1. Download the latest Chapel release
  2. Untar and go into the directory
$ tar xzvf chapel-X.Y.Z.tar.gz
$ cd chapel-X.Y.Z
  1. Set Chapel environment with GPU support enabled
$ source util/setchplenv.bash
$ export CHPL_LOCALE_MODEL=gpu # otherwise, GPU support is not enabled
  1. Build Chapel
$ make
  1. Compile and run examples
$ cd <path to this repo>
$ cd 00-intro
$ chpl 00-intro.chpl
$ ./00-intro

NOTE: If you expand on these examples and want to run some performance analysis, make sure to use --fast when compiling. e.g.

$ chpl --fast 00-intro.chpl

Other Resources

About

A repository of GPU programming examples in Chapel

Topics

Resources

Stars

Watchers

Forks

Languages