Skip to content

A simple example application using cmake build system, and kokkos as a third party

Notifications You must be signed in to change notification settings

pkestene/mandelbrot_kokkos_cmake

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mandelbrot_kokkos_cmake

This is a simple example to illustrate one possible way to use Kokkos inside an application built with CMake

Download / clone sources

Please note that, in this application, kokkos library is required.

  • if kokkos is already available, you just need to set CMAKE_PREFIX_PATH to point to its installation path
  • if kokkos is not availalble on your system, you can build by using cmake flag -DMANDELBROT_KOKKOS_BUILD=ON

In order to download mandelbrot_kokkos_cmake sources, use the following lines

git clone [email protected]:pkestene/mandelbrot_kokkos_cmake.git

How to build ?

Build with target device OpenMP

mkdir -p _build/openmp; cd _build/openmp
cmake -DMANDELBROT_KOKKOS_BUILD=ON -DMANDELBROT_KOKKOS_BACKEND=OpenMP ../..
make
# then you can run the application
./src/mandelbrot_kokkos_openmp

Optionnally you can enable HWLOC by passing -DKokkos_ENABLE_HWLOC=ON on cmake's command line (or in ccmake curse gui).

Build with target device CUDA

Of course you NEED to have nvcc compiler available on your system. Just a few notices:

  • if you do not have already kokkos library available, it be compiled for your.
  • if you're compiling on a platform equipped with an Nvidia GPU, the GPU architecture version will be detected by kokkos cmake build system.
  • if you don't have a GPU, you can still build the code (but not run); you can specify the target architecture using flag -DKokkos_ARCH.
mkdir _build/cuda; cd _build/cuda
cmake -DMANDELBROT_KOKKOS_BUILD=ON -DMANDELBROT_KOKKOS_BACKEND=Cuda -DKokkos_ENABLE_CUDA_LAMBDA=ON -DKokkos_ENABLE_HWLOC=ON ../..
make
# then you can run the application as before
./src/mandelbrot_kokkos_cuda

About

A simple example application using cmake build system, and kokkos as a third party

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published