This commit is contained in:
Ruobing Han 2022-01-13 13:30:45 -05:00
parent addf0a95b7
commit 897af29748
8 changed files with 156 additions and 15 deletions

34
.github/workflows/build.yml vendored Normal file
View File

@ -0,0 +1,34 @@
name: build
on:
push:
paths-ignore:
- '*.md'
pull_request:
paths-ignore:
- '*.md'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Install LLVM and Clang
uses: KyleMayes/install-llvm-action@v1
with:
version: "10.0"
- name: Build project
run: |
mkdir build
cd build
cmake .. -DLLVM_CONFIG_PATH=`which llvm-config`
make
- name: Execute the test example
run: |
cd ${{ github.workspace }}/compilation/examples
bash run_example.sh

28
.github/workflows/lint.yml vendored Normal file
View File

@ -0,0 +1,28 @@
# copied from MMCV (github.com/open-mmlab/mmcv)
name: lint
on: [push, pull_request]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.7
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Install pre-commit hook
run: |
# markdownlint requires ruby >= 2.7
sudo apt-add-repository ppa:brightbox/ruby-ng -y
sudo apt-get update
sudo apt-get install -y ruby2.7
pip install pre-commit
pre-commit install
- name: Linting
run: pre-commit run --all-files

43
.gitignore vendored Normal file
View File

@ -0,0 +1,43 @@
# Prerequisites
*.d
# Compiled Object files
*.slo
*.lo
*.o
*.obj
# Precompiled Headers
*.gch
*.pch
# Compiled Dynamic libraries
*.so
*.dylib
*.dll
# Fortran module files
*.mod
*.smod
# Compiled Static libraries
*.lai
*.la
*.a
*.lib
# Executables
*.exe
*.out
*.app
# LLVM files
*.bc
# CMake temp files
Makefile
CMakeCache.txt
*.cmake
# Log files
*.log

20
.pre-commit-config.yaml Normal file
View File

@ -0,0 +1,20 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
- id: check-added-large-files
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v13.0.0
hooks:
- id: clang-format
- repo: https://github.com/cheshirekow/cmake-format-precommit
rev: v0.6.13
hooks:
- id: cmake-format
- id: cmake-lint
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.30.0
hooks:
- id: markdownlint-fix

View File

@ -1,10 +1,10 @@
# COX: CUDA on X86 # CuPBoP: Cuda for Parallelized and Broad-range Processors
## Introduction ## Introduction
This project consists of two parts: a series of LLVM passes that CuPBoP (Cuda for parallelized and broad-range processors) is a framework
achieve a SPMD NVVM IR as input, and output the corresponding aims to execute CUDA source code on non-NVIDIA devices,
MPMD+SIMD version of LLVM IR which can be execute on CPU devices. including CPU, GPU and other architectures.
## Install ## Install
@ -22,8 +22,8 @@ MPMD+SIMD version of LLVM IR which can be execute on CPU devices.
1. Clone from github 1. Clone from github
```bash ```bash
git clone https://github.com/drcut/open_source_template git clone https://github.com/cupbop/CuPBoP
cd open_source_template cd CuPBoP
``` ```
2. Build the transformer for NVVM IR to LLVM IR for X86 2. Build the transformer for NVVM IR to LLVM IR for X86
@ -55,8 +55,12 @@ g++ ../compilation/examples/vecadd/host.cpp \
./vecadd_example ./vecadd_example
``` ```
## Contribution
We sincerely appreciate all kinds of contributions.
Please refer to [CONTRIBUTING](docs/CONTRIBUTING.md) for the contributing guideline.
## Author ## Author
[Ruobing Han](https://drcut.github.io/) is a CS phd student in * [Ruobing Han](https://drcut.github.io/)
Georgia Institute Technology, under the supervision * [Hyesoon Kim](https://www.cc.gatech.edu/~hyesoon/)
of Prof. [Hyesoon Kim](https://www.cc.gatech.edu/~hyesoon/).

View File

@ -1,6 +1,6 @@
# Contributing to COX # Contributing to CuPBoP
Thank you for your interest in contributing to COX! Thank you for your interest in contributing to CuPBoP!
We appreciate all contributions, including but not limited to: We appreciate all contributions, including but not limited to:
- Add documentation - Add documentation
@ -10,9 +10,9 @@ We appreciate all contributions, including but not limited to:
## How to contribute? ## How to contribute?
0. (Optional) Open an issue and discuss your idea before start 0. (Optional) Open an issue and discuss your idea before start
1. Fork the latest version COX 1. Fork the latest version CuPBoP
2. Commit to the forked repo 2. Commit to the forked repo
3. Create a Pull Request to COX main branch 3. Create a Pull Request to CuPBoP main branch
## Code style ## Code style
@ -21,14 +21,15 @@ To make sure your contribution is following the correct style,
we highly recommend you to install [pre-commit](https://pre-commit.com/) before development. we highly recommend you to install [pre-commit](https://pre-commit.com/) before development.
```bash ```bash
# Python environment is required # Python3 environment is required
pip install pre-commit pip install pre-commit
``` ```
Then, from the repository folder, execute the following instruction: Then, from the repository folder, execute the following instruction:
```bash ```bash
pre-commit install # execute in CuPBoP's root folder
pre-commit install
``` ```
With pre-commit plugin, each local commit will be automatically checked. With pre-commit plugin, each local commit will be automatically checked.

BIN
docs/figures/workflow.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 KiB

11
docs/workflow.md Normal file
View File

@ -0,0 +1,11 @@
# The workflow of CuPBoP
The workflow of CuPBoP is described as following:
![The workflow of executing CUDA applications on CuPBoP.](figures/workflow.png)
First, CuPBoP uses Clang to compile the CUDA source code into NVVM IR,
which consists of two parts: Host part and Kernel Part.
In the next step, CuPBoP-compilation parses and transforms these NVVM IRs
to make it suitable for executing on specific architectures.
The CuPBoP-runtime compiles the transformed Host IR and executes the generated programs,
which will compile the transformed Kernel IR and
upload the compiled kernel programs to specific architectures.