Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

Commit

Permalink
Remove dependency to ComputeCpp-SDK module (#366)
Browse files Browse the repository at this point in the history
* FindComputeCpp.cmake is now copied from the SDK to SYCL-BLAS modules
* Remove remaining occurences to ComputeCpp-SDK include folder
* Set the VERSION property only for the shared object library
  • Loading branch information
Rbiessy authored Dec 23, 2022
1 parent 3de8a4c commit 1fdbd87
Show file tree
Hide file tree
Showing 8 changed files with 577 additions and 43 deletions.
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[submodule "include/computecpp-sdk"]
path = external/computecpp-sdk
url = https://github.com/codeplaysoftware/computecpp-sdk.git
[submodule "external/py_gen"]
path = external/py_gen
url = https://github.com/codeplaysoftware/py_gen.git
14 changes: 4 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ endif()
list(APPEND CMAKE_MODULE_PATH
${CMAKE_CURRENT_SOURCE_DIR}/cmake/
${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules
${CMAKE_CURRENT_SOURCE_DIR}/external/computecpp-sdk/cmake/Modules
)

# This turns the long file names that are generated into short versions using a hash
Expand Down Expand Up @@ -92,14 +91,13 @@ option(GEMM_VECTORIZATION_SUPPORT "Whether to enable vectorization in Gemm kerne
add_definitions(-DCL_TARGET_OPENCL_VERSION=220)

set(CBLAS_INCLUDE ${CMAKE_CURRENT_SOURCE_DIR}/external/cblas/include)
set(COMPUTECPP_SDK_INCLUDE ${CMAKE_CURRENT_SOURCE_DIR}/external/computecpp-sdk/include)
set(SYCLBLAS_GENERATED_SRC ${CMAKE_CURRENT_BINARY_DIR}/generated_src)
set(SYCLBLAS_INCLUDE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>)
set(SYCLBLAS_COMMON_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/common/include)
set(SYCLBLAS_SRC ${CMAKE_CURRENT_SOURCE_DIR}/src)
set(SYCLBLAS_SRC_GENERATOR ${CMAKE_CURRENT_SOURCE_DIR}/python_generator)
list(APPEND THIRD_PARTIES_INCLUDE ${CBLAS_INCLUDE} ${COMPUTECPP_SDK_INCLUDE})
list(APPEND THIRD_PARTIES_INCLUDE ${CBLAS_INCLUDE})

if(IMGDNN_DIR)
add_definitions(-DIMGDNN_LIBRARY)
Expand Down Expand Up @@ -156,15 +154,11 @@ else()
INTERFACE_LINK_LIBRARIES ${sycl_impl}
INTERFACE_INCLUDE_DIRECTORIES "${SYCLBLAS_INCLUDE}"
)
set_target_properties(sycl_blas PROPERTIES
VERSION ${PROJECT_VERSION}
)
endif()

set_target_properties(sycl_blas PROPERTIES
VERSION ${PROJECT_VERSION}
)
target_include_directories(sycl_blas INTERFACE
$<BUILD_INTERFACE:${COMPUTECPP_SDK_INCLUDE}>
)

include(CMakePackageConfigHelpers)
set(version_file "${CMAKE_CURRENT_BINARY_DIR}/cmake/sycl_blas-version.cmake")
write_basic_package_version_file(${version_file}
Expand Down
31 changes: 15 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -295,9 +295,6 @@ The project is developed using [ComputeCpp CE Edition](http://www.computecpp.com
using Ubuntu 16.04 on Intel OpenCL CPU and Intel GPU.
In order to build the sources, GCC 5.4 or higher is required.
The build system is CMake version 3.4.2 or higher.
We rely on the `FindComputeCpp.cmake` imported from the
[ComputeCpp SDK](https://github.com/codeplaysoftware/computecpp-sdk)
to build the project.

A BLAS library, such as [OpenBLAS](https://github.com/xianyi/OpenBLAS), is also
required to build and verify the test results.
Expand All @@ -320,7 +317,7 @@ been replaced by `TUNING_TARGET`, which accepts the same options.
triplet for DPC++ or the hipSYCL target. Please refer to the sections below for
setting them.

1. Clone the SYCL-BLAS repository, making sure to pass the `--recursive` option, in order to clone submodule(s), such as the computecpp-sdk.
1. Clone the SYCL-BLAS repository, making sure to pass the `--recursive` option, in order to clone submodule(s).
2. Create a build directory
3. Run `CMake` from the build directory (see options in the section below):

Expand Down Expand Up @@ -413,21 +410,23 @@ export COMPUTECPP_TOOLCHAIN_DIR="PATH TO TOOLCHAIN_DIR"
export COMPUTECPP_TARGET_TRIPLE="PATH TO TARGET_TRIPLE"
export COMPUTECPP_SYSROOT_DIR="$PATH TO SYSROOT_DIR"
```

Clone the [ComputeCpp-SDK](https://github.com/codeplaysoftware/computecpp-sdk) to retrieve the toolchain file.
The following CMake command can be used to cross-compile SYCL-BLAS:

```bash
cmake -GNinja \
${SOURCE_ROOT} \
-DCMAKE_PREFIX_PATH="${OPENBLAS_PATH}" \
-DComputeCpp_DIR="${COMPUTECPP_DEVICE_PATH}" \
-DComputeCpp_HOST_DIR="${COMPUTECPP_X86_PATH}" \
-DCMAKE_TOOLCHAIN_FILE="${SYCL_BLAS_PATH}/external/computecpp-sdk/cmake/toolchains/gcc-generic.cmake" \
-DCMAKE_BUILD_TYPE='Release' \
-DCMAKE_INSTALL_PREFIX=${CROSS_COMPILED_SYCLBLAS_INSTALL} \
-DOpenCL_INCLUDE_DIR="${OpenCL_Headers_PATH}" \
-DOpenCL_LIBRARY="${OpenCL_LIBRARY}" \
-DCOMPUTECPP_BITCODE="${DEVICE_BITCODE}" \
-DCMAKE_CXX_FLAGS='-O3' \
cmake -GNinja \
${SOURCE_ROOT} \
-DCMAKE_PREFIX_PATH="${OPENBLAS_PATH}" \
-DComputeCpp_DIR="${COMPUTECPP_DEVICE_PATH}" \
-DComputeCpp_HOST_DIR="${COMPUTECPP_X86_PATH}" \
-DCMAKE_TOOLCHAIN_FILE="/path/to/computecpp-sdk/cmake/toolchains/gcc-generic.cmake" \
-DCMAKE_BUILD_TYPE='Release' \
-DCMAKE_INSTALL_PREFIX=${CROSS_COMPILED_SYCLBLAS_INSTALL} \
-DOpenCL_INCLUDE_DIR="${OpenCL_Headers_PATH}" \
-DOpenCL_LIBRARY="${OpenCL_LIBRARY}" \
-DCOMPUTECPP_BITCODE="${DEVICE_BITCODE}" \
-DCMAKE_CXX_FLAGS='-O3' \
-DTUNING_TARGET="${CHOSEN_TARGET}"
```

Expand Down
Loading

0 comments on commit 1fdbd87

Please sign in to comment.