Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use cmake_minimum_required with min...max #1424

Merged
merged 1 commit into from
Sep 28, 2023
Merged
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
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
cmake_minimum_required(VERSION 3.21...3.27 FATAL_ERROR)

project(dpctl
VERSION 0.15
LANGUAGES CXX
DESCRIPTION "Python interface for XPU programming"
)
Expand Down
12 changes: 6 additions & 6 deletions examples/pybind11/external_usm_allocation/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
cmake_minimum_required(VERSION 3.21)
cmake_minimum_required(VERSION 3.21...3.27 FATAL_ERROR)

project(external_usm_allocation LANGUAGES CXX)
project(external_usm_allocation VERSION 0.1 LANGUAGES CXX
DESCRIPTION "Example of passing external C++ USM allocation to Python")

set(DPCTL_CMAKE_MODULES_PATH "${CMAKE_SOURCE_DIR}/../../../cmake")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${DPCTL_CMAKE_MODULES_PATH})
Expand All @@ -13,14 +14,13 @@ set(CMAKE_CXX_STANDARD_REQUIRED True)
include(FetchContent)
FetchContent_Declare(
pybind11
URL https://github.com/pybind/pybind11/archive/refs/tags/v2.10.2.tar.gz
URL_HASH SHA256=93bd1e625e43e03028a3ea7389bba5d3f9f2596abc074b068e70f4ef9b1314ae
URL https://github.com/pybind/pybind11/archive/refs/tags/v2.11.1.tar.gz
URL_HASH SHA256=d475978da0cdc2d43b73f30910786759d593a9d8ee05b1b6846d1eb16c6d2e0c
)
FetchContent_MakeAvailable(pybind11)

find_package(PythonExtensions REQUIRED)
find_package(Python REQUIRED COMPONENTS Development.Module NumPy)
find_package(Dpctl REQUIRED)
find_package(NumPy REQUIRED)

set(py_module_name _external_usm_alloc)
pybind11_add_module(${py_module_name}
Expand Down
11 changes: 6 additions & 5 deletions examples/pybind11/onemkl_gemv/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
cmake_minimum_required(VERSION 3.22 FATAL_ERROR)
cmake_minimum_required(VERSION 3.22...3.27 FATAL_ERROR)

project(example_use_mkl_gemm LANGUAGES CXX)
project(example_use_mkl_gemm VERSION 0.1 LANGUAGES CXX
DESCRIPTION "Example of using Python wrapper to oneMKL function")
set(DPCTL_CMAKE_MODULES_PATH "${CMAKE_SOURCE_DIR}/../../../cmake")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${DPCTL_CMAKE_MODULES_PATH})
find_package(IntelDPCPP REQUIRED PATHS ${DPCTL_CMAKE_MODULES_PATH} NO_DEFAULT_PATH)
Expand All @@ -17,12 +18,12 @@ include(GNUInstallDirs)
include(FetchContent)
FetchContent_Declare(
pybind11
URL https://github.com/pybind/pybind11/archive/refs/tags/v2.10.2.tar.gz
URL_HASH SHA256=93bd1e625e43e03028a3ea7389bba5d3f9f2596abc074b068e70f4ef9b1314ae
URL https://github.com/pybind/pybind11/archive/refs/tags/v2.11.1.tar.gz
URL_HASH SHA256=d475978da0cdc2d43b73f30910786759d593a9d8ee05b1b6846d1eb16c6d2e0c
)
FetchContent_MakeAvailable(pybind11)

find_package(PythonExtensions REQUIRED)
find_package(Python REQUIRED COMPONENTS Development.Module NumPy)
find_package(Dpctl REQUIRED)

find_library(mkl_core NAMES mkl_core PATHS ${MKL_LIBRARY_DIR} REQUIRED)
Expand Down
8 changes: 4 additions & 4 deletions examples/pybind11/use_dpctl_sycl_kernel/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
cmake_minimum_required(VERSION 3.21)
cmake_minimum_required(VERSION 3.21...3.27 FATAL_ERROR)

project(use_queue_device LANGUAGES CXX)
project(use_queue_device VERSION 0.1 LANGUAGES CXX
DESCRIPTION "Example of using dpctl.program.SyclKernel <-> sycl::kernel type casting")

set(DPCTL_CMAKE_MODULES_PATH "${CMAKE_SOURCE_DIR}/../../../cmake")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${DPCTL_CMAKE_MODULES_PATH})
Expand All @@ -19,9 +20,8 @@ FetchContent_Declare(
)
FetchContent_MakeAvailable(pybind11)

find_package(PythonExtensions REQUIRED)
find_package(Python REQUIRED COMPONENTS Development.Module NumPy)
find_package(Dpctl REQUIRED)
find_package(NumPy REQUIRED)

set(py_module_name _use_kernel)
pybind11_add_module(${py_module_name}
Expand Down
12 changes: 6 additions & 6 deletions examples/pybind11/use_dpctl_sycl_queue/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
cmake_minimum_required(VERSION 3.21)
cmake_minimum_required(VERSION 3.21...3.27 FATAL_ERROR)

project(use_queue_device LANGUAGES CXX)
project(use_queue_device VERSION 0.1 LANGUAGES CXX
DESCRIPTION "Example of using dpctl.SyclQueue <-> sycl::queue type caster")

set(DPCTL_CMAKE_MODULES_PATH "${CMAKE_SOURCE_DIR}/../../../cmake")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${DPCTL_CMAKE_MODULES_PATH})
Expand All @@ -13,14 +14,13 @@ set(CMAKE_CXX_STANDARD_REQUIRED True)
include(FetchContent)
FetchContent_Declare(
pybind11
URL https://github.com/pybind/pybind11/archive/refs/tags/v2.10.2.tar.gz
URL_HASH SHA256=93bd1e625e43e03028a3ea7389bba5d3f9f2596abc074b068e70f4ef9b1314ae
URL https://github.com/pybind/pybind11/archive/refs/tags/v2.11.1.tar.gz
URL_HASH SHA256=d475978da0cdc2d43b73f30910786759d593a9d8ee05b1b6846d1eb16c6d2e0c
)
FetchContent_MakeAvailable(pybind11)

find_package(PythonExtensions REQUIRED)
find_package(Python REQUIRED COMPONENTS Development.Module NumPy)
find_package(Dpctl REQUIRED)
find_package(NumPy REQUIRED)

set(py_module_name _use_queue_device)
pybind11_add_module(${py_module_name}
Expand Down
2 changes: 1 addition & 1 deletion libsyclinterface/cmake/modules/GetProjectVersion.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
# VERSION_MINOR
# VERSION
# SEMVER
cmake_minimum_required( VERSION 3.14.0 )
cmake_minimum_required(VERSION 3.14...3.27 FATAL_ERROR )

function(get_version)
# Use git describe to get latest tag name
Expand Down