https://github.com/e-kayrakli/chapelongpu
A repository of GPU programming examples in Chapel
https://github.com/e-kayrakli/chapelongpu
chapel examples gpu
Last synced: 3 months ago
JSON representation
A repository of GPU programming examples in Chapel
- Host: GitHub
- URL: https://github.com/e-kayrakli/chapelongpu
- Owner: e-kayrakli
- Created: 2025-01-08T00:13:56.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2025-01-08T01:10:43.000Z (4 months ago)
- Last Synced: 2025-01-08T01:24:56.790Z (4 months ago)
- Topics: chapel, examples, gpu
- Language: Chapel
- Homepage: https://chapel-lang.org/
- Size: 11.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README

This repository contains GPU programming examples using
[Chapel](https://chapel-lang.org/).### 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](https://github.com/e-kayrakli/ChapelOnGpu/tree/main/00-intro): No
GPU programming here, just fundamental Chapel concepts
- [01-basics](https://github.com/e-kayrakli/ChapelOnGpu/tree/main/01-basics):
Allocating Chapel arrays and running Chapel loops on GPU
- [02-locale](https://github.com/e-kayrakli/ChapelOnGpu/tree/main/02-locale):
Running the same code on the GPU and CPU using `locale` variables
- [03-math-reduce](https://github.com/e-kayrakli/ChapelOnGpu/tree/main/03-math-reduce):
Kernels with some math operations and reductions
- [04-math-reduce-comm](https://github.com/e-kayrakli/ChapelOnGpu/tree/main/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](https://chapel-lang.org/docs/usingchapel/index.html) and the [GPU
technical note](https://chapel-lang.org/docs/technotes/gpu.html). The following
assumes that either `nvcc` or `hipcc` exists and accessible in the terminal
session.1. Download the latest Chapel
[release](https://github.com/chapel-lang/chapel/releases)
2. Untar and go into the directory```shell
$ tar xzvf chapel-X.Y.Z.tar.gz
$ cd chapel-X.Y.Z
```3. Set Chapel environment with GPU support enabled
```shell
$ source util/setchplenv.bash
$ export CHPL_LOCALE_MODEL=gpu # otherwise, GPU support is not enabled
```4. Build Chapel
```shell
$ make
```4. Compile and run examples
```
$ cd
$ 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.```shell
$ chpl --fast 00-intro.chpl
```### Other Resources
- [GPU Programming in
Chapel](https://chapel-lang.org/blog/series/gpu-programming-in-chapel/) blog
series
- [GPU Technote](https://chapel-lang.org/docs/technotes/gpu.html)
- [Vendor-Neutral GPU Programming in
Chapel](https://www.youtube.com/watch?v=nj-WqhGEy24&t=1s&ab_channel=HewlettPackardEnterprise),
an HPE Developer community talk
- or a playlist of [short live
demos](https://www.youtube.com/watch?v=h1V7QuJ9mzk&list=PLuqM5RJ2KYFgNM62w9QdRTcWPpf3rfSwr)
contained in it
- A recorded [live demo session](https://www.youtube.com/watch?v=5OqjQhfGKes)
going over similar examples