Skip to content

Commit

Permalink
[BLAS, cuBLAS backend, hipSYCL] Add official hipsycl cuBLAS support (#…
Browse files Browse the repository at this point in the history
…166)

* Add hipSYCL cuBLAS support to the README

* Update find cuBLAS cmake for hipSYCL
  • Loading branch information
sbalint98 authored Sep 16, 2022
1 parent 39add2c commit 8bf615f
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 16 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ else()
message(STATUS "Looking for hipSYCL")
find_package(hipSYCL CONFIG REQUIRED)
set(USE_ADD_SYCL_TO_TARGET_INTEGRATION true)
set (CMAKE_CXX_STANDARD 17)
add_library(ONEMKL::SYCL::SYCL INTERFACE IMPORTED)
elseif(ONEMKL_SYCL_IMPLEMENTATION STREQUAL "dpc++")
message(STATUS "Looking for dpc++")
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ Supported domains: BLAS, LAPACK, RNG
<td align="center">NVIDIA GPU</td>
<td align="center">NVIDIA cuBLAS</td>
<td align="center">Dynamic, Static</td>
<td align="center">LLVM*</td>
<td align="center">LLVM*,hipSYCL</td>
</tr>
<tr>
<td align="center">x86 CPU</td>
Expand Down Expand Up @@ -382,7 +382,7 @@ Microsoft Windows* Server | 2016, 2019 | *Not supported*
</tr>
<td rowspan=2> Linux* only </td>
<td> NVIDIA GPU </td>
<td> Intel project for LLVM* technology </td>
<td> Intel project for LLVM* technology <br> or <br> hipSYCL with CUDA backend and dependencies </td>
<td> No </td>
<tr>
<td>AMD GPU</td>
Expand Down
44 changes: 30 additions & 14 deletions cmake/FindcuBLAS.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,36 @@ add_compile_definitions(CUDA_NO_HALF)
find_package(Threads REQUIRED)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(cuBLAS
REQUIRED_VARS
CUDA_TOOLKIT_INCLUDE
CUDA_cublas_LIBRARY
CUDA_LIBRARIES
CUDA_CUDA_LIBRARY
OPENCL_INCLUDE_DIR
)


if(NOT TARGET ONEMKL::cuBLAS::cuBLAS)
add_library(ONEMKL::cuBLAS::cuBLAS SHARED IMPORTED)
set_target_properties(ONEMKL::cuBLAS::cuBLAS PROPERTIES
IMPORTED_LOCATION ${CUDA_cublas_LIBRARY}
INTERFACE_INCLUDE_DIRECTORIES "${OPENCL_INCLUDE_DIR};${CUDA_TOOLKIT_INCLUDE}"
INTERFACE_LINK_LIBRARIES "Threads::Threads;${CUDA_CUDA_LIBRARY};${CUDA_LIBRARIES}"
)

if(USE_ADD_SYCL_TO_TARGET_INTEGRATION)
find_package_handle_standard_args(cuBLAS
REQUIRED_VARS
CUDA_TOOLKIT_INCLUDE
CUDA_cublas_LIBRARY
CUDA_LIBRARIES
CUDA_CUDART_LIBRARY
)
set_target_properties(ONEMKL::cuBLAS::cuBLAS PROPERTIES
IMPORTED_LOCATION ${CUDA_cublas_LIBRARY}
INTERFACE_INCLUDE_DIRECTORIES "${CUDA_TOOLKIT_INCLUDE}"
INTERFACE_LINK_LIBRARIES "Threads::Threads;${CUDA_LIBRARIES};${CUDA_CUDART_LIBRARY}"
)
else()
find_package_handle_standard_args(cuBLAS
REQUIRED_VARS
CUDA_TOOLKIT_INCLUDE
CUDA_cublas_LIBRARY
CUDA_LIBRARIES
CUDA_CUDA_LIBRARY
OPENCL_INCLUDE_DIR
)
set_target_properties(ONEMKL::cuBLAS::cuBLAS PROPERTIES
IMPORTED_LOCATION ${CUDA_cublas_LIBRARY}
INTERFACE_INCLUDE_DIRECTORIES "${OPENCL_INCLUDE_DIR};${CUDA_TOOLKIT_INCLUDE}"
INTERFACE_LINK_LIBRARIES "Threads::Threads;${CUDA_CUDA_LIBRARY};${CUDA_LIBRARIES}"
)
endif()
endif()

0 comments on commit 8bf615f

Please sign in to comment.