|
| 1 | +Simple Test Case for Kokkos |
| 2 | +---- |
| 3 | + |
| 4 | +This is a simple standalone test case taken from the Kokkos repository & packaged up here for use with SYCL. |
| 5 | +It's doing a vector-matrix-vector product. It's an identity matrix with two vectors of 1s, so the expected answer |
| 6 | +is just equal to the problem size. |
| 7 | + |
| 8 | +Building the test case |
| 9 | +----- |
| 10 | + |
| 11 | +test_case.cpp contains a simple kernel which has been copied straight from the Kokkos Tutorials (Exercises/02/Solution). |
| 12 | + |
| 13 | +Build it with build.sh, after setting the environment variable: |
| 14 | +``` |
| 15 | +Kokkos_ROOT="[your/kokkos/installation]/lib/cmake/Kokkos" |
| 16 | +``` |
| 17 | + |
| 18 | +Running the test case |
| 19 | +---- |
| 20 | + |
| 21 | +Just launch it! There are optional flags: |
| 22 | + |
| 23 | +-N : number of rows |
| 24 | +-M : number of columns |
| 25 | +-S : total size |
| 26 | +-nrepeat : how many times to repeat the test (default 100) |
| 27 | + |
| 28 | +Obviously, not all of N, M & S should be set. The test case will sanity check your args anyway. |
| 29 | + |
| 30 | +Building Kokkos |
| 31 | +------ |
| 32 | + |
| 33 | +In case you don't have an existing Kokkos build, there are some build scripts in `./kokkos_build_scripts`. |
| 34 | +There are scripts for building Kokkos with SYCL, or CUDA (nvcc or clang). |
| 35 | + |
| 36 | +Set the following environment variables: |
| 37 | +``` |
| 38 | +KOKKOS_INSTALL_DIR=[/your/install/dir] |
| 39 | +KOKKOS_SOURCE_DIR=[/your/source/dir] |
| 40 | +HWLOC_DIR=[/your/hwloc/dir] |
| 41 | +``` |
| 42 | + |
| 43 | +HWLOC |
| 44 | +------ |
| 45 | + |
| 46 | +The [Portable Hardware Locality](https://www.open-mpi.org/projects/hwloc/) (hwloc) package is an optional dependency which enables Kokkos to query the hardware topology of the system on which it is running. If you do not have a HWLOC installation, this option can be removed & Kokkos will be built without HWLOC support. |
| 47 | + |
| 48 | +SYCL backend |
| 49 | +------------- |
| 50 | + |
| 51 | +Kokkos should work with any SYCL backend, though the focus of this examples repo is SYCL-For-CUDA. |
| 52 | +Previous work at Codeplay has involved running Kokkos with SYCL on Nvidia hardware with Ampere architecture, hence the flag: |
| 53 | +``` |
| 54 | + -DKokkos_ARCH_AMPERE80=ON \ |
| 55 | +``` |
| 56 | +This flag is not strictly necessary, but it enables Ahead of Time (AoT) compilation, which can give a significant performance gain when building large projects built on Kokkos. |
| 57 | +You should modify the cmake command for your GPU arch. |
| 58 | + |
| 59 | + |
| 60 | + |
0 commit comments