Giter VIP home page Giter VIP logo

cupbop-amd's Introduction

CuPBoP-AMD: Extending CUDA to AMD Platforms

Copyright © 2023

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Introduction

CuPBoP-AMD (Extending CUDA to AMD Platforms) is a extension of the framework of CuPBoP following similar architecture. However, CuPBoP-AMD has its over version of kernerl and host translators and runtime implementation. CuPBoP-AMD currently supports many of the Rodinia benchmarks and more support than AMD HIPIFY.

Install

Prerequisites

Installation

  1. Clone from github

    git clone --recursive [email protected]:gthparch/CuPBoP-AMD.git
    cd CuPBoP-AMD
  2. Build LLVM using the llvm-16-init branch and the ROCm suites

    Edit the build-rocm.sh script under the scripts/ folder, replace BUILD_LLVM=0 with BUILD_LLVM=1.

    ./scripts/build-rocm.sh

    Ensure the compiled LLVM binaries are in the PATH variable.

  3. Build CuPBoP-AMD

    mkdir build && cd build
    cmake .. \
       -DLLVM_CONFIG_PATH=`which llvm-config` \
       -DCUDA_PATH=$CUDA_PATH
    cmake --build . -j$(nproc)
  4. Set the environment variables

    export ROCM_PATH="<path_to_rocm>"
    export HIP_PATH="$ROCM_PATH/hip"
    export DEVICE_LIB_PATH="$ROCM_PATH/amdgcn/bitcode"
    export HIP_DEVICE_LIB_PATH="$ROCM_PATH/amdgcn/bitcode"
    export HIP_CLANG_PATH="<path_to_compiled_llvm>"
    export HIPCC_COMPILE_FLAGS_APPEND="--rocm-path=$ROCM_PATH"
    export CMAKE_PREFIX_PATH="$ROCM_PATH/hip:$ROCM_PATH:$CMAKE_PREFIX_PATH"
    export ROCMINFO_PATH="$ROCM_PATH"
    export LD_LIBRARY_PATH="$ROCM_PATH/lib64:$ROCM_PATH/lib:$LD_LIBRARY_PATH"
    export PATH="<path_to_compiled_binaries>:$PATH"

Run Rodinia Benchmark example

In this section, we provide an example of how to use CuPBoP-AMD to execute a CUDA program.

# Run rodinia benchmarks. Ensure all environment variables are set.
$ cd benchmarks/rodinia

# Download Rodinia benchmark dataset
# This script automatically downloads the dataset required to run the rodinia
# suite of benchmarks to the rodinia-data folder
$ ./download-data.sh

# Take the `bfs` benchmark for an example
$ cd bfs && ./run.sh

How to contribute?

Any kinds of contributions are welcome. Please refer to Contribution.md for more detail.

Related publications

If you want to refer CuPBoP in your projects, please cite the related papers:

Contributors

Acknowledgements

cupbop-amd's People

Contributors

jchen706 avatar supermarcus avatar cjzhuoanlu avatar

Stargazers

 avatar XianyanLin avatar  avatar Dammian Miller avatar Ryuta Suzuki avatar  avatar zhengjia avatar G.A. vd. Hoorn avatar Matthias Fauconneau avatar  avatar  avatar  avatar Hannah Bollar avatar  avatar Xuanteng Huang avatar lafaer avatar eatcosmos avatar Chenxiao Wang avatar  avatar Eadral avatar  avatar chaoqin avatar  avatar  avatar  avatar Shaoqian Zhou avatar  avatar Taekyung Heo avatar Hirohisa Mitsuishi avatar Yanglin Zhang avatar

Watchers

Matthias Fauconneau avatar Hyesoon Kim avatar  avatar Seonjin Na  avatar  avatar  avatar

cupbop-amd's Issues

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.