Skip to content

Commit

Permalink
Merge branch 'sycl-develop' into python-interface-enable-sycl
Browse files Browse the repository at this point in the history
  • Loading branch information
aacostadiaz authored Nov 26, 2024
2 parents 5360aba + b4a9835 commit f4b9079
Show file tree
Hide file tree
Showing 22 changed files with 2,318 additions and 60 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ if (CUTLASS_ENABLE_SYCL)
add_compile_definitions(CUTLASS_SYCL_PROFILING_ENABLED)
add_compile_definitions(SYCLCOMPAT_PROFILING_ENABLED)
endif()

include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/onemkl.cmake)
endif()
find_package(Doxygen QUIET)

Expand Down
3 changes: 3 additions & 0 deletions benchmarks/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ function(cutlass_benchmark_add_executable NAME)
)

if (CUTLASS_ENABLE_SYCL)
add_dependencies(${NAME} onemkl_project)
target_include_directories(${NAME} PRIVATE ${ONEMKL_INCLUDE_DIR})
target_link_libraries(${NAME} PUBLIC ${ONEMKL_LIB})
add_sycl_to_target(TARGET ${NAME})
endif()

Expand Down
4 changes: 4 additions & 0 deletions cmake/FindDPCPP.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ if(NOT "${DPCPP_SYCL_ARCH}" STREQUAL "")
endif()
endif()

if("${DPCPP_SYCL_TARGET}" STREQUAL "intel_gpu_pvc")
list(APPEND DPCPP_FLAGS "-Xspirv-translator;--spirv-ext=+SPV_INTEL_split_barrier")
endif()

if(UNIX)
set_target_properties(DPCPP::DPCPP PROPERTIES
INTERFACE_COMPILE_OPTIONS "${DPCPP_FLAGS};${DPCPP_COMPILE_ONLY_FLAGS}"
Expand Down
62 changes: 62 additions & 0 deletions cmake/onemkl.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Copyright (c) 2024 - 2024 Codeplay Software Ltd. All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

include_guard()

include(ExternalProject)

set(ONEMKL_INSTALL_DIR ${CMAKE_BINARY_DIR}/deps/oneMKL)
set(ONEMKL_INCLUDE_DIR ${ONEMKL_INSTALL_DIR}/include)
set(ONEMKL_LIB_DIR ${ONEMKL_INSTALL_DIR}/lib)
set(ONEMKL_LIB ${ONEMKL_LIB_DIR}/libonemkl.so)

ExternalProject_Add(
onemkl_project

PREFIX ${ONEMKL_INSTALL_DIR}
GIT_REPOSITORY "https://github.com/oneapi-src/oneMKL.git"
GIT_TAG "v0.5"

CMAKE_ARGS
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
-DCMAKE_GENERATOR=${CMAKE_GENERATOR}
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DCMAKE_INSTALL_PREFIX=${ONEMKL_INSTALL_DIR}
-DCMAKE_SHARED_LINKER_FLAGS="-Wl,-rpath=${ONEMKL_LIB_DIR}"
-DENABLE_MKLCPU_BACKEND=OFF
-DENABLE_MKLGPU_BACKEND=OFF
-DBUILD_FUNCTIONAL_TESTS=OFF
-DBUILD_EXAMPLES=OFF
-DBUILD_DOC=OFF
-DTARGET_DOMAINS=rng
INSTALL_DIR ${ONEMKL_INSTALL_DIR}
BUILD_BYPRODUCTS ${ONEMKL_LIB}
)

add_library(oneMKL SHARED IMPORTED)
3 changes: 3 additions & 0 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ function(cutlass_example_add_executable NAME)
)

if (CUTLASS_ENABLE_SYCL)
add_dependencies(${NAME} onemkl_project)
target_include_directories(${NAME} PRIVATE ${ONEMKL_INCLUDE_DIR})
target_link_libraries(${NAME} PUBLIC ${ONEMKL_LIB})
add_sycl_to_target(TARGET ${NAME})
endif()

Expand Down
5 changes: 5 additions & 0 deletions examples/sycl/pvc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,8 @@ cutlass_example_add_executable(
pvc_collective_builder
pvc_collective_builder.cpp
)

cutlass_example_add_executable(
pvc_gemm_streamk
pvc_gemm_streamk.cpp
)
Loading

0 comments on commit f4b9079

Please sign in to comment.