Skip to content

Commit

Permalink
Reverting PORTBLAS_SRC setting in cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
s-Nick committed Apr 24, 2024
1 parent b2297a9 commit b83d329
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,9 @@ set(PORTBLAS_INCLUDE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>)
set(PORTBLAS_COMMON_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/common/include)
if(INSTALL_HEADER_ONLY)
set(PORTBLAS_SRC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src> $<INSTALL_INTERFACE:src>)
else()
set(PORTBLAS_SRC ${CMAKE_CURRENT_SOURCE_DIR}/src)
set(PORTBLAS_INSTALL_SRC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src> $<INSTALL_INTERFACE:src>)
endif()
set(PORTBLAS_SRC ${CMAKE_CURRENT_SOURCE_DIR}/src)
set(PORTBLAS_SRC_GENERATOR ${CMAKE_CURRENT_SOURCE_DIR}/python_generator)
list(APPEND THIRD_PARTIES_INCLUDE ${CBLAS_INCLUDE})

Expand Down Expand Up @@ -146,10 +145,15 @@ include(CmakeFunctionHelper)
if (INSTALL_HEADER_ONLY)
add_library(portblas INTERFACE)
set_target_properties(portblas PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${PORTBLAS_INCLUDE};${PORTBLAS_SRC}"
)
target_compile_definitions(portblas INTERFACE "SB_ENABLE_USM")
target_compile_definitions(portblas INTERFACE "BLAS_ENABLE_COMPLEX=${BLAS_ENABLE_COMPLEX}")
INTERFACE_INCLUDE_DIRECTORIES "${PORTBLAS_INCLUDE};${PORTBLAS_INSTALL_SRC}")
include(CheckCXXCompilerFlag)
check_cxx_compiler_flag("-fsycl" is_dpcpp)
if(is_dpcpp)
target_compile_definitions(portblas INTERFACE "SB_ENABLE_USM")
endif()
if(${BLAS_ENABLE_COMPLEX})
target_compile_definitions(portblas INTERFACE "BLAS_ENABLE_COMPLEX")
endif()
target_compile_definitions(portblas INTERFACE ${TUNING_TARGET})
if((${CMAKE_CXX_COMPILER_ID} STREQUAL "IntelLLVM") AND NOT
(${TUNING_TARGET} STREQUAL "INTEL_GPU") )
Expand Down Expand Up @@ -215,7 +219,7 @@ install(DIRECTORY ${PORTBLAS_INCLUDE}
FILES_MATCHING PATTERN "*.h"
)
if (INSTALL_HEADER_ONLY)
install(DIRECTORY ${PORTBLAS_SRC}
install(DIRECTORY ${PORTBLAS_INSTALL_SRC}
DESTINATION ${CMAKE_INSTALL_PREFIX}
COMPONENT portblas
FILES_MATCHING PATTERN "*.hpp"
Expand Down

0 comments on commit b83d329

Please sign in to comment.