Skip to content

Commit

Permalink
Add OpenMP-target implementation
Browse files Browse the repository at this point in the history
This code has been ported from https://github.com/UoB-HPC/bude-benchmark, the gpu branch.
The code works, but performance is low.

Contributes to #3
  • Loading branch information
andreipoe committed Oct 21, 2020
1 parent eeb80be commit 25648ec
Show file tree
Hide file tree
Showing 6 changed files with 573 additions and 0 deletions.
27 changes: 27 additions & 0 deletions openmp-target/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
SHELL := bash
.SHELLFLAGS := -eu -o pipefail -c
.DELETE_ON_ERROR:

MAKEFLAGS += --warn-undefined-variables --no-builtin-rules

# -------

CC = cc

ARCH = sm_70

CFLAGS = -O3 -fopenmp -fopenmp-targets=nvptx64 -Xopenmp-target -march=$(ARCH)
LDFLAGS = -lm

OBJ = $(patsubst %.c,%.o,$(wildcard *.c))

bude: Makefile $(OBJ)
$(CC) $(CFLAGS) $(OBJ) -o bude $(LDFLAGS)

%.o: %.c Makefile make.deps
$(CC) $(CFLAGS) -c $<

.PHONY: clean

clean:
rm -f bude *.ptx *.cub *.lst *.o *.optrpt
32 changes: 32 additions & 0 deletions openmp-target/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# BUDE OpenMP Target

This is a GPU implementation of BUDE using OpenMP target.

## Building

This implementations supports the following compilers:

* CCE (Cray)
* LLVM 10+ (built with offloading support)

```
make
```

The default compiler and flags can be overridden using `CC` and `CFLAGS`, respectively.

### Target Architecture

By default, the NVIDIA V100 is targetted, but this can be changed by setting the `ARCH` parameter to the name of the target GPU architecture.

For example, to target a P100:

```
make ARCH=sm_60
```

## Running

This implementation has no special run-time options.
The `-n` and `-i` parameters are available.
Run `bude -h` for a help message.
Loading

0 comments on commit 25648ec

Please sign in to comment.