Skip to content

Commit 79cb2a4

Browse files
Apply remarks for CMake files
1 parent 17ca9ab commit 79cb2a4

2 files changed

Lines changed: 23 additions & 25 deletions

File tree

dpctl_ext/CMakeLists.txt

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,7 @@
2727
# THE POSSIBILITY OF SUCH DAMAGE.
2828
# *****************************************************************************
2929

30-
find_package(Python REQUIRED COMPONENTS NumPy)
31-
32-
# -t is to only Cythonize sources with timestamps newer than existing CXX files (if present)
33-
# -w is to set working directory (and correctly set __pyx_f[] array of filenames)
34-
set(CYTHON_FLAGS "-t -w \"${CMAKE_SOURCE_DIR}\"")
35-
find_package(Cython REQUIRED)
36-
30+
# TODO: rework this logic to remove current duplication
3731
if(WIN32)
3832
string(
3933
CONCAT WARNING_FLAGS
@@ -118,7 +112,7 @@ else()
118112
endif()
119113

120114
# at build time create include/ directory and copy header files over
121-
set(DPCTL_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include)
115+
# set(DPCTL_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include)
122116

123117
set(CMAKE_INSTALL_RPATH "$ORIGIN")
124118

dpctl_ext/tensor/CMakeLists.txt

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,10 @@
2727
# THE POSSIBILITY OF SUCH DAMAGE.
2828
# *****************************************************************************
2929

30+
find_package(Python COMPONENTS Development)
31+
3032
if(WIN32)
31-
if(${CMAKE_VERSION} VERSION_LESS "3.23")
33+
if(${CMAKE_VERSION} VERSION_LESS "3.27")
3234
# this is a work-around for target_link_options inserting option after -link option, cause
3335
# linker to ignore it.
3436
set(CMAKE_CXX_LINK_FLAGS
@@ -37,6 +39,7 @@ if(WIN32)
3739
endif()
3840
endif()
3941

42+
# TODO: reuse this library for dpnp ufunc extension build
4043
set(_static_lib_sources
4144
${CMAKE_CURRENT_SOURCE_DIR}/libtensor/source/simplify_iteration_space.cpp
4245
)
@@ -67,11 +70,11 @@ add_library(${_static_lib_trgt} STATIC ${_static_lib_sources})
6770
target_include_directories(
6871
${_static_lib_trgt}
6972
PRIVATE
70-
${Python_INCLUDE_DIRS}
71-
${DPCTL_INCLUDE_DIR}
73+
# ${Python_INCLUDE_DIRS}
74+
# ${Dpctl_INCLUDE_DIR}
7275
${CMAKE_CURRENT_SOURCE_DIR}/libtensor/include
7376
)
74-
target_link_libraries(${_static_lib_trgt} PRIVATE pybind11::headers ${Python_LIBRARIES})
77+
target_link_libraries(${_static_lib_trgt} PRIVATE pybind11::headers Python::Python)
7578
set_target_properties(${_static_lib_trgt} PROPERTIES POSITION_INDEPENDENT_CODE ON)
7679

7780
set(_py_trgts)
@@ -94,14 +97,14 @@ set(_no_fast_math_sources
9497
# ${CMAKE_CURRENT_SOURCE_DIR}/libtensor/source/clip.cpp
9598
# ${CMAKE_CURRENT_SOURCE_DIR}/libtensor/source/where.cpp
9699
)
97-
list(
98-
APPEND _no_fast_math_sources
99-
# ${_elementwise_sources}
100-
# ${_reduction_sources}
101-
# ${_sorting_sources}
102-
# ${_linalg_sources}
103-
# ${_accumulator_sources}
104-
)
100+
#list(
101+
#APPEND _no_fast_math_sources
102+
# ${_elementwise_sources}
103+
# ${_reduction_sources}
104+
# ${_sorting_sources}
105+
# ${_linalg_sources}
106+
# ${_accumulator_sources}
107+
#)
105108

106109
foreach(_src_fn ${_no_fast_math_sources})
107110
get_source_file_property(_cmpl_options_prop ${_src_fn} COMPILE_OPTIONS)
@@ -114,7 +117,7 @@ endforeach()
114117

115118
set(_compiler_definitions "")
116119

117-
set(_linker_options "LINKER:${DPCTL_LDFLAGS}")
120+
set(_linker_options "LINKER:${DPNP_LDFLAGS}")
118121
foreach(python_module_name ${_py_trgts})
119122
target_compile_options(
120123
${python_module_name}
@@ -124,6 +127,7 @@ foreach(python_module_name ${_py_trgts})
124127
${python_module_name}
125128
PRIVATE -fsycl-device-code-split=per_kernel
126129
)
130+
# TODO: expand DPCTL_OFFLOAD_COMPRESS to the whole dpnp level
127131
if(DPCTL_OFFLOAD_COMPRESS)
128132
target_link_options(${python_module_name} PRIVATE --offload-compress)
129133
endif()
@@ -149,22 +153,22 @@ foreach(python_module_name ${_py_trgts})
149153
PRIVATE -fprofile-instr-generate -fcoverage-mapping
150154
)
151155
endif()
152-
if(_dpctl_sycl_targets)
156+
if(_dpnp_sycl_targets)
153157
# make fat binary
154158
target_compile_options(
155159
${python_module_name}
156-
PRIVATE ${_dpctl_sycl_target_compile_options}
160+
PRIVATE ${_dpnp_sycl_target_compile_options}
157161
)
158162
target_link_options(
159163
${python_module_name}
160-
PRIVATE ${_dpctl_sycl_target_link_options}
164+
PRIVATE ${_dpnp_sycl_target_link_options}
161165
)
162166
endif()
163167
# TODO: update source so they reference individual libraries instead of
164168
# dpctl4pybind11.hpp. It will allow to simplify dependency tree
165169
# NOTE: dpctl C-API is resolved at runtime via Python
166170
# target_link_libraries(${python_module_name} PRIVATE DpctlCAPI)
167-
if(DPCTL_WITH_REDIST)
171+
if(DPNP_WITH_REDIST)
168172
set_target_properties(
169173
${python_module_name}
170174
PROPERTIES INSTALL_RPATH "$ORIGIN/../../../.."

0 commit comments

Comments
 (0)