Skip to content

Commit 6f8f4a2

Browse files
Make _usmarray dependencies conditional in backend extensions
1 parent e023f2f commit 6f8f4a2

8 files changed

Lines changed: 32 additions & 8 deletions

File tree

dpnp/backend/extensions/blas/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,10 @@ pybind11_add_module(${python_module_name} MODULE ${_module_src})
4040
add_sycl_to_target(TARGET ${python_module_name} SOURCES ${_module_src})
4141

4242
# Ensure Cython modules build first so _usmarray.h exists
43-
add_dependencies(${python_module_name} _usmarray)
43+
# Only add dependency if tensor module is being built (not in SKIP_TENSOR mode)
44+
if(TARGET _usmarray)
45+
add_dependencies(${python_module_name} _usmarray)
46+
endif()
4447

4548
if(_dpnp_sycl_targets)
4649
# make fat binary

dpnp/backend/extensions/fft/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@ pybind11_add_module(${python_module_name} MODULE ${_module_src})
3434
add_sycl_to_target(TARGET ${python_module_name} SOURCES ${_module_src})
3535

3636
# Ensure Cython modules build first so _usmarray.h exists
37-
add_dependencies(${python_module_name} _usmarray)
37+
# Only add dependency if tensor module is being built (not in SKIP_TENSOR mode)
38+
if(TARGET _usmarray)
39+
add_dependencies(${python_module_name} _usmarray)
40+
endif()
3841

3942
if(_dpnp_sycl_targets)
4043
# make fat binary

dpnp/backend/extensions/indexing/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,10 @@ pybind11_add_module(${python_module_name} MODULE ${_module_src})
3737
add_sycl_to_target(TARGET ${python_module_name} SOURCES ${_module_src})
3838

3939
# Ensure Cython modules build first so _usmarray.h exists
40-
add_dependencies(${python_module_name} _usmarray)
40+
# Only add dependency if tensor module is being built (not in SKIP_TENSOR mode)
41+
if(TARGET _usmarray)
42+
add_dependencies(${python_module_name} _usmarray)
43+
endif()
4144

4245
if(_dpnp_sycl_targets)
4346
# make fat binary

dpnp/backend/extensions/lapack/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,10 @@ pybind11_add_module(${python_module_name} MODULE ${_module_src})
5757
add_sycl_to_target(TARGET ${python_module_name} SOURCES ${_module_src})
5858

5959
# Ensure Cython modules build first so _usmarray.h exists
60-
add_dependencies(${python_module_name} _usmarray)
60+
# Only add dependency if tensor module is being built (not in SKIP_TENSOR mode)
61+
if(TARGET _usmarray)
62+
add_dependencies(${python_module_name} _usmarray)
63+
endif()
6164

6265
if(_dpnp_sycl_targets)
6366
# make fat binary

dpnp/backend/extensions/statistics/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,10 @@ pybind11_add_module(${python_module_name} MODULE ${_module_src})
4242
add_sycl_to_target(TARGET ${python_module_name} SOURCES ${_module_src})
4343

4444
# Ensure Cython modules build first so _usmarray.h exists
45-
add_dependencies(${python_module_name} _usmarray)
45+
# Only add dependency if tensor module is being built (not in SKIP_TENSOR mode)
46+
if(TARGET _usmarray)
47+
add_dependencies(${python_module_name} _usmarray)
48+
endif()
4649

4750
if(_dpnp_sycl_targets)
4851
# make fat binary

dpnp/backend/extensions/ufunc/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,10 @@ pybind11_add_module(${python_module_name} MODULE ${_module_src})
6868
add_sycl_to_target(TARGET ${python_module_name} SOURCES ${_module_src})
6969

7070
# Ensure Cython modules build first so _usmarray.h exists
71-
add_dependencies(${python_module_name} _usmarray)
71+
# Only add dependency if tensor module is being built (not in SKIP_TENSOR mode)
72+
if(TARGET _usmarray)
73+
add_dependencies(${python_module_name} _usmarray)
74+
endif()
7275

7376
if(WIN32)
7477
if(${CMAKE_VERSION} VERSION_LESS "3.27")

dpnp/backend/extensions/vm/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,10 @@ pybind11_add_module(${python_module_name} MODULE ${_module_src})
9191
add_sycl_to_target(TARGET ${python_module_name} SOURCES ${_module_src})
9292

9393
# Ensure Cython modules build first so _usmarray.h exists
94-
add_dependencies(${python_module_name} _usmarray)
94+
# Only add dependency if tensor module is being built (not in SKIP_TENSOR mode)
95+
if(TARGET _usmarray)
96+
add_dependencies(${python_module_name} _usmarray)
97+
endif()
9598

9699
if(WIN32)
97100
if(${CMAKE_VERSION} VERSION_LESS "3.27")

dpnp/backend/extensions/window/CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,10 @@ pybind11_add_module(${python_module_name} MODULE ${_module_src})
3737
add_sycl_to_target(TARGET ${python_module_name} SOURCES ${_module_src})
3838

3939
# Ensure Cython modules build first so _usmarray.h exists
40-
add_dependencies(${python_module_name} _usmarray)
40+
# Only add dependency if tensor module is being built (not in SKIP_TENSOR mode)
41+
if(TARGET _usmarray)
42+
add_dependencies(${python_module_name} _usmarray)
43+
endif()
4144

4245
if(_dpnp_sycl_targets)
4346
# make fat binary

0 commit comments

Comments
 (0)