Skip to content

Tool to show information about available SYCL implementations

Notifications You must be signed in to change notification settings

codeplaysoftware/sycl-info

Repository files navigation

sycl-info

Welcome to sycl-info!

This is the readme for sycl-info, a tool designed to report the SYCL platforms that are available to the system.

Getting sycl-info

Packages
CMake
v3.5
find_package(sycl-info REQUIRED)
add_custom_target(print-sycl-info SYCL::sycl-info)
find_package(target-selector REQUIRED) target_link_libraries(app PRIVATE Codeplay::target-selector)
PkgConfig
sycl-info
pkg-config target-selector --cflags --libs
Arch Linux AUR
AUR version
yay -S sycl-info-git

Using sycl-info

The sycl-info man page for instruction on how to use sycl-info.

This is also generated as an HTML and additionally as a man page on Linux.

You can find the generated html document here:

<sycl_info_install_dir>/share/doc/sycl-info.1.html

Linux:

On Linux you can view the man page by doing:

man <sycl_info_install_dir>/share/man/man1/sycl-info.1

Building

Options

CMake Conan Default Notes
BUILD_TESTING build_testing OFF/False Builds the unit tests. Requires doctest.
BUILD_DOCS build_docs OFF/False Builds the man page. Requires ronn.
BUILD_SHARED_LIBS shared OFF/False

Conan (>= 1.18)

Building:

git clone https://github.com/codeplaysoftware/sycl-info.git
mkdir -p build install
conan install sycl-info/ --build missing -if build/ \
    --profile default --profile sycl-info/config/conan/profiles/build-tools \
    # Optional flags:
    # [-obuild_testing=False] [-obuild_docs=False]
conan build sycl-info -bf build/ -pf install/
conan package sycl-info -bf build/ -pf install/

Plain CMake

For an example of how a complete script looks like refer to the PKGBUILD on the AUR.

Dependencies

Build Dependencies

Check Dependencies

mkdir -p dep-install/include
git clone https://github.com/KhronosGroup/OpenCL-Headers OpenCL-Headers
git clone https://github.com/KhronosGroup/OpenCL-ICD-Loader OpenCL-ICD-Loader
git clone https://github.com/nlohmann/json json
git clone https://github.com/bfgroup/Lyra Lyra
git clone https://github.com/onqtam/doctest doctest # Only needed for the tests
gem install ronn # Only needed to build the man page
cp -r OpenCL-Headers/CL install/include/
cp -r Lyra/include/lyra install/include/

for dep in OpenCL-ICD-Loader json doctest; do
    mkdir ${dep}-build
    cmake -S $dep -B ${dep}-build \
        -DCMAKE_INSTALL_PREFIX=install \
        -DCMAKE_BUILD_TYPE=Release
    cmake --build ${dep}-build --target install
done

mkdir build install
git clone https://this/repo.git sycl-info
cmake -S sycl-info -B build \
    # Optional flags:
    # [-DBUILD_TESTING=OFF] [-DBUILD_DOCS=OFF] \
    -DCMAKE_PREFIX_PATH=dep-install \
    -DCMAKE_INSTALL_PREFIX=install \
    -DCMAKE_BUILD_TYPE=Release
cmake --build build/ --target install

Packaging

After sycl-info is built it can be packaged into a .deb, .rpm, or a tarball using CPack:

Tarball:

conan install ..
    # Optional, but recommended:
    # -obuild_docs=True -oshared=True
conan build ..
source ./activate_run.sh
cpack -G TXZ

Source Tarball:

conan install ..
conan build .. -c # configure only
source ./activate_run.sh
cpack -G TXZ --config CPackSourceConfig.cmake

Ubuntu:

conan install ..
    # Optional, but recommended:
    # -obuild_docs=True -oshared=True
conan build ..
source ./activate_run.sh
cpack -G DEB
sudo dpkg -i packages/sycl-info-0.1-Linux.deb packages/target-selector-0.1-Linux.deb
sycl-info --help
man sycl-info

The generated packages will end up in build/packages.

About

Tool to show information about available SYCL implementations

Topics

Resources

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •