Code Monkey home page Code Monkey logo

linking_matar's Introduction

linking_matar

Description

linking_matar is an example on how to link new projects to MATAR and Kokkos. To follow along with the example clone the repo

git clone --recursive https://github.com/yencal/linking_matar.git

Assume that the project we want to linked to MATAR and Kokkos is called some_project. In the some_project\CMakeLists.txt simply add

if (KOKKOS)
  add_definitions(-DHAVE_KOKKOS=1)
  if (CUDA)
    add_definitions(-DHAVE_CUDA=1)
  elseif (HIP)
    add_definitions(-DHAVE_HIP=1)
  elseif (OPENMP)
    add_definitions(-DHAVE_OPENMP=1)
  elseif (THREADS)
    add_definitions(-DHAVE_THREADS=1)
  #else ()
  endif()
endif()
set(MATAR_PATH "../MATAR") # path to where you have MATAR downloaded
add_subdirectory(${MATAR_PATH} matar)
include_directories("${MATAR_PATH}/src")

OpenMP build

Before you can build some_project, we need to specify an installation of Kokkos and a Kokkos_DIR. You can install Kokkos yourself or use one of the scripts in MATAR/scripts/. Lets use ../MATAR/scripts/kokkos-openmp

  • Step 1:
cd ../MATAR/scripts/kokkos-openmp
source build-it.sh
  • Step 2: Now set Kokkos_DIR as
export Kokkos_DIR=../MATAR/src/install-kokkos-openmp/kokkos/
  • Step 3: You can build some_project using
cmake . -DKOKKOS=ON -DOPENMP=ON
make

CUDA build

If you would like to do a CUDA, HIP, or THREADS build, make sure you have the correct version of Kokkos installed then follow the same steps as the OpenMP build. Lets do a CUDA build for example

  • Step 1:
cd ../MATAR/scripts/kokkos-cuda
source build-it.sh
  • Step 2:
export Kokkos_DIR=../MATAR/src/install-kokkos-cuda/kokkos/
  • Step 3:
cmake . -DKOKKOS=ON -DCUDA=ON
make

linking_matar's People

Contributors

yencal avatar

Watchers

 avatar

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.