Skip to content

Commit

Permalink
[blas::portBLAS] Update portBLAS cmake (#480)
Browse files Browse the repository at this point in the history
Signed-off-by: nscipione <nicolo.scipione@codeplay.com>
  • Loading branch information
s-Nick authored May 3, 2024
1 parent 990e4ab commit 99e85be
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions src/blas/backends/portblas/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,11 @@ if (NOT PORTBLAS_FOUND)
set(BLAS_ENABLE_BENCHMARK OFF)
set(BLAS_ENABLE_TESTING OFF)
set(ENABLE_EXPRESSION_TESTS OFF)
if(NOT PORTBLAS_TUNING_TARGET)
set(PORTBLAS_TUNING_TARGET "DEFAULT")
endif()
# Following variable TUNING_TARGET will be used in portBLAS internal configuration
set(TUNING_TARGET ${PORTBLAS_TUNING_TARGET})
set(BLAS_ENABLE_COMPLEX ON)
# Set the policy to forward variables to portBLAS configure step
set(CMAKE_POLICY_DEFAULT_CMP0077 NEW)
Expand All @@ -155,23 +160,14 @@ if (NOT PORTBLAS_FOUND)
GIT_REPOSITORY https://github.com/codeplaysoftware/portBLAS
GIT_TAG master
)
FetchContent_MakeAvailable(portBLAS)
FetchContent_MakeAvailable(portblas)
message(STATUS "Looking for portBLAS - downloaded")

add_library(PORTBLAS::portblas INTERFACE IMPORTED)
target_include_directories(PORTBLAS::portblas
INTERFACE ${FETCHCONTENT_BASE_DIR}/portblas-src/include
INTERFACE ${FETCHCONTENT_BASE_DIR}/portblas-src/src
)
else()
message(STATUS "Looking for portBLAS - found")
add_library(portblas ALIAS PORTBLAS::portblas)
endif()

# This define is tuning portBLAS in header-only mode
target_compile_definitions(PORTBLAS::portblas INTERFACE ${PORTBLAS_TUNING_TARGET})
target_compile_definitions(PORTBLAS::portblas INTERFACE BLAS_ENABLE_COMPLEX=1)
target_compile_options(ONEMKL::SYCL::SYCL INTERFACE "-DSB_ENABLE_USM=ON")

set(SOURCES
portblas_level1_double.cpp portblas_level1_float.cpp
portblas_level2_double.cpp portblas_level2_float.cpp
Expand All @@ -196,7 +192,7 @@ target_include_directories(${LIB_OBJ}
)

target_compile_options(${LIB_OBJ} PRIVATE ${ONEMKL_BUILD_COPT})
target_link_libraries(${LIB_OBJ} PUBLIC ONEMKL::SYCL::SYCL PORTBLAS::portblas)
target_link_libraries(${LIB_OBJ} PUBLIC ONEMKL::SYCL::SYCL portblas)

set_target_properties(${LIB_OBJ} PROPERTIES
POSITION_INDEPENDENT_CODE ON)
Expand Down

0 comments on commit 99e85be

Please sign in to comment.