Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ __pycache__/

# CMake build and local install directory
build
_skbuild
build_cmake
install

Expand Down Expand Up @@ -104,3 +103,6 @@ dpctl/resources/cmake

# asv artifacts
*.asv*

# generated _version.py
dpctl/_version.py
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ target_link_libraries(DpctlCAPI INTERFACE DPCTLSyclInterfaceHeaders)

install(DIRECTORY
${CMAKE_CURRENT_SOURCE_DIR}/dpctl/apis/include/
DESTINATION ${CMAKE_INSTALL_PREFIX}/dpctl/include
DESTINATION dpctl/include
FILES_MATCHING REGEX "\\.h(pp)?$"
)

Expand Down
4 changes: 2 additions & 2 deletions conda-recipe/bld.bat
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ REM A workaround for activate-dpcpp.bat issue to be addressed in 2021.4
set "LIB=%BUILD_PREFIX%\Library\lib;%BUILD_PREFIX%\compiler\lib;%LIB%"
set "INCLUDE=%BUILD_PREFIX%\include;%INCLUDE%"

"%PYTHON%" setup.py clean --all

REM Overriding IPO is useful for building in resources constrained VMs (public CI)
if DEFINED OVERRIDE_INTEL_IPO (
set "CMAKE_ARGS=%CMAKE_ARGS% -DCMAKE_INTERPROCEDURAL_OPTIMIZATION:BOOL=FALSE"
Expand All @@ -23,6 +21,8 @@ set "CMAKE_GENERATOR=Ninja"
:: Make CMake verbose
set "VERBOSE=1"

set "SETUPTOOLS_SCM_PRETEND_VERSION=%PKG_VERSION%"

set "CMAKE_ARGS=%CMAKE_ARGS% -DDPCTL_LEVEL_ZERO_INCLUDE_DIR=%PREFIX:\=/%/Library/include/level_zero"

%PYTHON% -m build -w -n -x
Expand Down
6 changes: 2 additions & 4 deletions conda-recipe/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,15 @@ export ICXCFG
read -r GLIBC_MAJOR GLIBC_MINOR <<<"$(conda list '^sysroot_linux-64$' \
| tail -n 1 | awk '{print $2}' | grep -oP '\d+' | head -n 2 | tr '\n' ' ')"

if [ -e "_skbuild" ]; then
${PYTHON} setup.py clean --all
fi

export CC=icx
export CXX=icpx

export CMAKE_GENERATOR=Ninja
# Make CMake verbose
export VERBOSE=1

export SETUPTOOLS_SCM_PRETEND_VERSION=${PKG_VERSION}

CMAKE_ARGS="${CMAKE_ARGS} -DDPCTL_LEVEL_ZERO_INCLUDE_DIR=${PREFIX}/include/level_zero -DDPCTL_WITH_REDIST=ON"

# -wnx flags mean: --wheel --no-isolation --skip-dependency-check
Expand Down
4 changes: 0 additions & 4 deletions conda-recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ requirements:
- {{ pin_compatible('intel-cmplr-lib-rt', min_pin='x.x', max_pin='x') }}
# Ensure we are using latest version of setuptools, since we don't need
# editable environments for release.
- setuptools >=69
{% for dep in py_build_deps %}
{% if dep.startswith('ninja') %}
- {{ dep.split(';')[0] }} # [not win]
Expand All @@ -47,8 +46,6 @@ requirements:
- {{ dep|replace('_','-') }}
{% endif %}
{% endfor %}
# versioneer dependency
- tomli # [py<311]
run:
- python
- {{ pin_compatible('intel-sycl-rt', min_pin='x.x', max_pin='x') }}
Expand All @@ -61,7 +58,6 @@ test:
- {{ compiler('cxx') }}
- {{ stdlib('c') }}
- cython
- setuptools
- pytest

about:
Expand Down
2 changes: 1 addition & 1 deletion docs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ if (DPCTL_ENABLE_DOXYREST)
endif()

# Set the location where the generated docs are saved
set(DOC_OUTPUT_DIR ${CMAKE_INSTALL_PREFIX}/docs)
set(DOC_OUTPUT_DIR docs)

# set(INDEX_NO_DOXYREST_IN ${CMAKE_CURRENT_SOURCE_DIR}/index_no_doxyrest.rst.in)
# set(INDEX_DOXYREST_IN ${CMAKE_CURRENT_SOURCE_DIR}/index_doxyrest.rst.in)
Expand Down
12 changes: 6 additions & 6 deletions dpctl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ find_package(Python REQUIRED COMPONENTS NumPy)

# -t is to only Cythonize sources with timestamps newer than existing CXX files (if present)
# -w is to set working directory (and correctly set __pyx_f[] array of filenames)
set(CYTHON_FLAGS "-t -w \"${CMAKE_SOURCE_DIR}\"")
set(CYTHON_ARGS -t -w "${CMAKE_SOURCE_DIR}")
find_package(Cython REQUIRED)
include(UseCython)

if(WIN32)
string(CONCAT WARNING_FLAGS
Expand Down Expand Up @@ -106,8 +107,7 @@ set(CMAKE_INSTALL_RPATH "$ORIGIN")
function(build_dpctl_ext _trgt _src _dest)
set(options SYCL)
cmake_parse_arguments(BUILD_DPCTL_EXT "${options}" "RELATIVE_PATH" "" ${ARGN})
add_cython_target(${_trgt} ${_src} CXX OUTPUT_VAR _generated_src)
set(_cythonize_trgt "${_trgt}_cythonize_pyx")
cython_transpile(${_src} LANGUAGE CXX OUTPUT_VARIABLE _generated_src)
Python_add_library(${_trgt} MODULE WITH_SOABI ${_generated_src})
if (BUILD_DPCTL_EXT_SYCL)
add_sycl_to_target(TARGET ${_trgt} SOURCES ${_generated_src})
Expand Down Expand Up @@ -164,18 +164,18 @@ function(build_dpctl_ext _trgt _src _dest)
LIBRARY DESTINATION ${_dest})
install(FILES
${_generated_api_h}
DESTINATION ${CMAKE_INSTALL_PREFIX}/dpctl/include/${_dest}
DESTINATION dpctl/include/${_dest}
OPTIONAL)
install(FILES
${_generated_public_h}
DESTINATION ${CMAKE_INSTALL_PREFIX}/dpctl/include/${_dest}
DESTINATION dpctl/include/${_dest}
OPTIONAL)
if (DPCTL_GENERATE_COVERAGE)
get_filename_component(_original_src_dir ${_src} DIRECTORY)
file(RELATIVE_PATH _rel_dir ${CMAKE_SOURCE_DIR} ${_original_src_dir})
install(FILES
${_generated_src}
DESTINATION ${CMAKE_INSTALL_PREFIX}/${_rel_dir}
DESTINATION ${_rel_dir}
)
endif()

Expand Down
8 changes: 5 additions & 3 deletions dpctl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@
)
from ._sycl_queue_manager import get_device_cached_queue
from ._sycl_timer import SyclTimer
from ._version import get_versions

try:
from ._version import __version__
except ImportError:
__version__ = "0.0.0.unknown"
from .enum_types import (
backend_type,
device_type,
Expand Down Expand Up @@ -140,6 +144,4 @@ def get_include():
return os.path.join(os.path.dirname(__file__), "include")


__version__ = get_versions()["version"]
del get_versions
del _init_helper
Loading
Loading