-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e73665f
commit 5d63af1
Showing
124 changed files
with
12,919 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -178,6 +178,7 @@ Copyright (c) 2015-2017 Martin Hensel | |
Copyright (c) 2007, Apostolos Syropoulos (<[email protected]) | ||
|
||
ComputeCPP SDK (cmake/FindComputeCpp.cmake) | ||
Copyright 2016-2018 Codeplay Software Ltd. | ||
Xbyak_aarch64 (src/cpu/aarch64/xbyak_aarch64/) | ||
Copyright 2019-2020 FUJITSU LIMITED | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#=============================================================================== | ||
# Copyright 2020 Intel Corporation | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
#=============================================================================== | ||
|
||
find_library(PI_CUDA_LIBRARIES | ||
NAMES pi_cuda libpi_cuda.so PATHS | ||
PATH_SUFFIXES lib) | ||
|
||
find_package_handle_standard_args(PI_CUDA REQUIRED_VARS PI_CUDA_LIBRARIES) | ||
|
||
if(TARGET PI_CUDA::PI_CUDA OR NOT PI_CUDA_FOUND) | ||
return() | ||
endif() | ||
|
||
add_library(PI_CUDA::PI_CUDA UNKNOWN IMPORTED) | ||
set_target_properties(PI_CUDA::PI_CUDA PROPERTIES | ||
IMPORTED_LOCATION ${PI_CUDA_LIBRARIES}) | ||
|
||
mark_as_advanced(PI_CUDA_LIBRARIES) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#=============================================================================== | ||
# Copyright 2020 Intel Corporation | ||
# Copyright 2020 Codeplay Software Limited | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
#=============================================================================== | ||
|
||
find_package(CUDA 10.0 REQUIRED) | ||
find_package(Threads REQUIRED) | ||
|
||
find_path(CUBLAS_INCLUDE_DIR "cublas_v2.h" | ||
HINTS ${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES}) | ||
find_library(CUBLAS_LIBRARY cublas) | ||
find_library(CUDA_DRIVER_LIBRARY cuda) | ||
|
||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args(cuBLAS | ||
REQUIRED_VARS | ||
CUBLAS_INCLUDE_DIR | ||
CUDA_INCLUDE_DIRS | ||
CUBLAS_LIBRARY | ||
CUDA_LIBRARIES | ||
CUDA_DRIVER_LIBRARY | ||
) | ||
|
||
if(NOT TARGET cuBLAS::cuBLAS) | ||
add_library(cuBLAS::cuBLAS SHARED IMPORTED) | ||
set_target_properties(cuBLAS::cuBLAS PROPERTIES | ||
IMPORTED_LOCATION ${CUBLAS_LIBRARY} | ||
INTERFACE_INCLUDE_DIRECTORIES | ||
"${CUBLAS_INCLUDE_DIR};${CUDA_INCLUDE_DIRS}" | ||
INTERFACE_LINK_LIBRARIES | ||
"Threads::Threads;${CUDA_DRIVER_LIBRARY};${CUDA_LIBRARIES}" | ||
INTERFACE_COMPILE_DEFINITIONS CUDA_NO_HALF) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#=============================================================================== | ||
# Copyright 2020 Intel Corporation | ||
# Copyright 2020 Codeplay Software Limited | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
#=============================================================================== | ||
|
||
find_package(CUDA 10.0 REQUIRED) | ||
|
||
find_path(CUDNN_INCLUDE_DIR "cudnn.h" | ||
HINTS ${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES}) | ||
find_library(CUDNN_LIBRARY cudnn) | ||
find_library(CUDA_DRIVER_LIBRARY cuda) | ||
# this is work around to avoid duplication half creation in both cuda and SYCL | ||
|
||
find_package(Threads REQUIRED) | ||
|
||
include(FindPackageHandleStandardArgs) | ||
|
||
find_library( | ||
CUDNN_LIBRARY cudnn | ||
HINTS ${CUDA_TOOLKIT_ROOT_DIR} | ||
PATH_SUFFIXES lib lib64 bin) | ||
|
||
find_package_handle_standard_args(cuDNN | ||
REQUIRED_VARS | ||
CUDNN_INCLUDE_DIR | ||
CUDA_INCLUDE_DIRS | ||
CUDNN_LIBRARY | ||
CUDA_LIBRARIES | ||
CUDA_DRIVER_LIBRARY | ||
) | ||
|
||
if(NOT TARGET cuDNN::cuDNN) | ||
add_library(cuDNN::cuDNN SHARED IMPORTED) | ||
set_target_properties(cuDNN::cuDNN PROPERTIES | ||
IMPORTED_LOCATION | ||
${CUDNN_LIBRARY} | ||
INTERFACE_INCLUDE_DIRECTORIES | ||
"${CUDA_INCLUDE_DIRS};${CUDNN_INCLUDE_DIR}" | ||
INTERFACE_LINK_LIBRARIES | ||
"Threads::Threads;${CUDA_DRIVER_LIBRARY};${CUDA_LIBRARIES}" | ||
INTERFACE_COMPILE_DEFINITIONS | ||
CUDA_NO_HALF) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#=============================================================================== | ||
# Copyright 2020 Intel Corporation | ||
# Copyright 2020 Codeplay Software Limited | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
#=============================================================================== | ||
|
||
file(GLOB_RECURSE SOURCES | ||
${CMAKE_CURRENT_SOURCE_DIR}/*.hpp | ||
${CMAKE_CURRENT_SOURCE_DIR}/*.cpp | ||
) | ||
|
||
set(OBJ_LIB ${LIB_NAME}_sycl_nvidia) | ||
add_library(${OBJ_LIB} OBJECT ${SOURCES}) | ||
|
||
find_package(OpenCL REQUIRED) | ||
|
||
set_target_properties( | ||
${OBJ_LIB} | ||
PROPERTIES | ||
COMPILE_DEFINITIONS | ||
"$<TARGET_PROPERTY:cuBLAS::cuBLAS,INTERFACE_COMPILE_DEFINITIONS>;$<TARGET_PROPERTY:cuDNN::cuDNN,INTERFACE_COMPILE_DEFINITIONS>" | ||
COMPILE_OPTIONS | ||
"$<TARGET_PROPERTY:cuBLAS::cuBLAS,INTERFACE_COMPILE_OPTIONS>;$<TARGET_PROPERTY:cuDNN::cuDNN,INTERFACE_COMPILE_OPTIONS>;$<TARGET_PROPERTY:OpenCL::OpenCL,INTERFACE_COMPILE_OPTIONS>" | ||
) | ||
target_include_directories( | ||
${OBJ_LIB} | ||
PRIVATE $<TARGET_PROPERTY:OpenCL::OpenCL,INTERFACE_INCLUDE_DIRECTORIES> | ||
$<TARGET_PROPERTY:cuDNN::cuDNN,INTERFACE_INCLUDE_DIRECTORIES> | ||
$<TARGET_PROPERTY:cuBLAS::cuBLAS,INTERFACE_INCLUDE_DIRECTORIES>) | ||
|
||
add_library(${OBJ_LIB}_interface INTERFACE) | ||
target_link_libraries(${OBJ_LIB}_interface INTERFACE cuBLAS::cuBLAS | ||
cuDNN::cuDNN | ||
OpenCL::OpenCL) | ||
set_property(GLOBAL APPEND PROPERTY DNNL_LIB_DEPS | ||
$<TARGET_OBJECTS:${OBJ_LIB}>) | ||
|
||
set(${LIB_NAME}_INTERFACE | ||
${${LIB_NAME}_INTERFACE} ${OBJ_LIB}_interface | ||
PARENT_SCOPE) |
Oops, something went wrong.