Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
88c57b4
made lib compare
Gitubrr Apr 21, 2026
f6c9ff1
added more comparison points
Gitubrr Apr 25, 2026
7419e16
added list of dependences
Gitubrr Apr 28, 2026
21279b0
CI -> +
Gitubrr Apr 29, 2026
e2a2ad1
Just formatting changes to README
Gitubrr Apr 29, 2026
2ed3b03
added config params info
Gitubrr May 4, 2026
fc33885
added config structure
Gitubrr May 4, 2026
d680949
formatting only
Gitubrr May 4, 2026
de27aa7
added performance parameter
Gitubrr May 4, 2026
e0c9b47
formatting only
Gitubrr May 4, 2026
0b8ca49
formatting
Gitubrr May 5, 2026
b880e9e
added 2 libs, removed 'Пакетные менеджеры'
Gitubrr May 5, 2026
e0c730b
added SPLA usage scenarios
Gitubrr May 11, 2026
b5b7580
making defolt scenario
Gitubrr May 19, 2026
af09acd
added 1 question about errors
Gitubrr May 19, 2026
627b027
added new scenaries
Gitubrr Jun 1, 2026
c1b7f2d
added manual
Gitubrr Jul 9, 2026
8c9ddff
Fixed the incorrect format name in 1 example in CONFIGURATION FALE se…
Gitubrr Jul 10, 2026
c90f185
add parsers
Gitubrr Jul 26, 2026
82028eb
fixed formatting errors
Gitubrr Jul 26, 2026
464aaa0
changed cli parser, file parser, made validate
Gitubrr Jul 28, 2026
f8cea29
changed init
Gitubrr Jul 28, 2026
0af1432
made apply() and started changing cl_accelerator.cpp,.hpp + added num…
Gitubrr Jul 29, 2026
73045f1
removed apply(), changed init() -> init(conf)
Gitubrr Jul 29, 2026
a28e55e
for formatter only
Gitubrr Jul 29, 2026
8e333d8
add configuration mechanism
Gitubrr Aug 31, 2026
c9b84f3
made UserManual and UserGuide
Gitubrr Sep 8, 2026
3e87443
unnecessary changes
Gitubrr Sep 8, 2026
aa11385
fixed
Gitubrr Sep 20, 2026
60ecdff
for formatter and ubuntu build
Gitubrr Sep 20, 2026
53fb6c4
changed make file
Gitubrr Sep 20, 2026
5aa6e52
changed deps in make file
Gitubrr Sep 20, 2026
54b10b1
! grep -qE \[ FAILED \]
Gitubrr Sep 20, 2026
24dcab7
CL_TARGET_OPENCL_VERSION=300
Gitubrr Sep 20, 2026
2291458
made verbosity
Gitubrr Sep 22, 2026
3082114
added MIT license back
Gitubrr Sep 23, 2026
0b14b37
add MIT license to cl_configure
Gitubrr Sep 23, 2026
48613f8
made new user guide
Gitubrr Sep 24, 2026
ac5f337
chanjed config structure
Gitubrr Sep 25, 2026
60f09aa
added new params to cnfig
Gitubrr Sep 27, 2026
7586978
fixed build err
Gitubrr Sep 27, 2026
ec9897a
CL_TARGET_OPENCL_VERSION=300 -> 120 back
Gitubrr Sep 27, 2026
788e7b4
fixed CL_HPP_MINIMUM_OPENCL_VERSION
Gitubrr Sep 28, 2026
b895cd9
for deps
Gitubrr Sep 28, 2026
3e7f817
for formatter
Gitubrr Sep 28, 2026
17ec47a
removed base from UserGuide
Gitubrr Oct 3, 2026
73a39f6
removed "configs" and "current_config"
Gitubrr Oct 6, 2026
103f80e
added about how to run with user conf
Gitubrr Oct 7, 2026
4f9309f
fixed ci scenar
Gitubrr Oct 7, 2026
e6a8c45
Запуск с -> Запуск ci с
Gitubrr Oct 7, 2026
0dc7fba
added new configuration func
Gitubrr Oct 13, 2026
ae1209d
removed comment
Gitubrr Oct 13, 2026
2b2448e
fix for windows
Gitubrr Oct 13, 2026
66f1a3a
deleted and renamed files
Gitubrr Oct 13, 2026
14c6bf1
cl_config_status.hpp -> config_status.hpp
Gitubrr Oct 13, 2026
e31094b
chanjed ci back
Gitubrr Oct 13, 2026
0a82109
chanjed lang to english
Gitubrr Oct 13, 2026
6042947
chacged logs
Gitubrr Oct 14, 2026
c190a0c
chacged logic
Gitubrr Oct 23, 2026
7edb644
fixed sources
Gitubrr Oct 23, 2026
010b864
win error
Gitubrr Oct 23, 2026
3a3277c
removed unnecessary
Gitubrr Oct 24, 2026
7461633
for clang
Gitubrr Oct 24, 2026
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
87 changes: 74 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
cmake_minimum_required(VERSION 3.15 FATAL_ERROR)
project(spla LANGUAGES CXX)

######################################################################
## Package version
## python/VERSION.md is the single source of truth for the version:
## python/setup.py reads it for the PyPI package and the C++ library
## gets it as the SPLA_VERSION compile definition.

file(READ "${CMAKE_CURRENT_LIST_DIR}/python/VERSION.md" SPLA_VERSION_RAW)
string(STRIP "${SPLA_VERSION_RAW}" SPLA_VERSION)
message(STATUS "SPLA package version: ${SPLA_VERSION}")

######################################################################
## public options

option(SPLA_BUILD_TESTS "Build test folder with modules tests" YES)
option(SPLA_BUILD_EXAMPLES "Build library example applications with algorithms" YES)
option(SPLA_BUILD_TOOLS "Build command line tools (spla)" YES)
option(SPLA_BUILD_OPENCL "Build library with opencl backend" YES)

######################################################################
Expand Down Expand Up @@ -178,18 +189,40 @@ endfunction()
add_subdirectory(deps/robin_hood)
add_subdirectory(deps/svector)

message(STATUS "Add CLI11 as CLI/ENV parser")
include(FetchContent)

FetchContent_Declare(CLI11
GIT_REPOSITORY https://github.com/CLIUtils/CLI11.git
GIT_TAG v2.4.2
)
FetchContent_MakeAvailable(CLI11)

message(STATUS "Add nlohmann/json as JSON parser")
FetchContent_Declare(nlohmann_json
GIT_REPOSITORY https://github.com/nlohmann/json.git
GIT_TAG v3.11.3
)
FetchContent_MakeAvailable(nlohmann_json)

if (SPLA_BUILD_OPENCL)
if (SPLA_TARGET_MACOSX)
message(STATUS "Add standard Apple OpenCL package")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why these changes required?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My code requirs newer OpenCL headers. Apple removed them from macOS SDKs, so find_package fails. I bundle Khronos headers to build new code, while linking the system framework for macOS compatibility

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your code? Your code just configure existing library. Why it requires newer OpenCL?

find_package(OpenCL REQUIRED)
message(STATUS "Use Apple OpenCL framework for linking, headers from deps")
find_library(OPENCL_FRAMEWORK OpenCL REQUIRED)

add_library(OpenCLHeaders INTERFACE)
add_library(OpenCL::Headers ALIAS OpenCLHeaders)
target_include_directories(OpenCLHeaders INTERFACE ${OpenCL_INCLUDE_DIRS})

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And this.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I explicitly point to local Khronos headers in deps/ because Apple no longer ships OpenCL header files in the SDK

target_include_directories(OpenCLHeaders INTERFACE
${CMAKE_CURRENT_SOURCE_DIR}/deps/opencl-headers)

add_library(HeadersCpp INTERFACE)
add_library(OpenCL::HeadersCpp ALIAS HeadersCpp)
target_include_directories(HeadersCpp INTERFACE
${CMAKE_CURRENT_SOURCE_DIR}/deps/opencl-headers-hpp/include)
target_link_libraries(HeadersCpp INTERFACE OpenCL::Headers)

add_library(OpenCL INTERFACE)
target_include_directories(OpenCL INTERFACE ${OpenCL_INCLUDE_DIRS})
target_link_libraries(OpenCL INTERFACE ${OpenCL_LIBRARIES})
target_link_libraries(OpenCL INTERFACE ${OPENCL_FRAMEWORK})
else ()
message(STATUS "Add Khronos OpenCL C API header files")
add_subdirectory(deps/opencl-headers)
Expand All @@ -199,14 +232,13 @@ if (SPLA_BUILD_OPENCL)
set(OPENCL_ICD_LOADER_BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE)
set(OPENCL_ICD_LOADER_BUILD_TESTING OFF CACHE BOOL "" FORCE)
add_subdirectory(deps/opencl-icd-loader)
endif ()


message(STATUS "Add Khronos OpenCL HPP bindings")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And this.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It made to prevent linking against the Apple framework on Linux/Windows

add_library(HeadersCpp INTERFACE)
add_library(OpenCL::HeadersCpp ALIAS HeadersCpp)
target_include_directories(HeadersCpp INTERFACE deps/opencl-headers-hpp/include)
target_link_libraries(HeadersCpp INTERFACE OpenCL::Headers)
message(STATUS "Add Khronos OpenCL HPP bindings")
add_library(HeadersCpp INTERFACE)
add_library(OpenCL::HeadersCpp ALIAS HeadersCpp)
target_include_directories(HeadersCpp INTERFACE deps/opencl-headers-hpp/include)
target_link_libraries(HeadersCpp INTERFACE OpenCL::Headers)
endif ()
endif ()

if (SPLA_BUILD_EXAMPLES)
Expand Down Expand Up @@ -297,6 +329,9 @@ add_library(spla SHARED
include/spla/vector.hpp
src/core/accelerator.hpp
src/core/common.hpp
src/core/config_status.hpp
src/core/configure.cpp
src/core/configure.hpp
src/core/dispatcher.cpp
src/core/dispatcher.hpp
src/core/logger.cpp
Expand Down Expand Up @@ -368,21 +403,35 @@ target_include_directories(spla PRIVATE ${CMAKE_CURRENT_LIST_DIR}/src)

set_target_properties(spla PROPERTIES OUTPUT_NAME "spla_${SPLA_ARCH}")
target_compile_definitions(spla PRIVATE SPLA_EXPORTS)
target_compile_definitions(spla PRIVATE SPLA_VERSION="${SPLA_VERSION}")

target_link_libraries(spla PRIVATE robin_hood)
target_link_libraries(spla PRIVATE svector)
target_link_libraries(spla PRIVATE CLI11::CLI11)
target_link_libraries(spla PRIVATE nlohmann_json::nlohmann_json)
target_link_libraries(spla PRIVATE ${CMAKE_DL_LIBS})

if (SPLA_BUILD_OPENCL)
target_link_libraries(spla PUBLIC OpenCL)
target_link_libraries(spla PUBLIC OpenCL::HeadersCpp)
target_compile_definitions(spla PUBLIC CL_TARGET_OPENCL_VERSION=120)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What the reason of these changes?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

locked C++ bindings to 1.2, same as C bindings

target_compile_definitions(spla PUBLIC
CL_TARGET_OPENCL_VERSION=120
CL_HPP_TARGET_OPENCL_VERSION=120
CL_HPP_MINIMUM_OPENCL_VERSION=120)
list(APPEND SPLA_DEFINES SPLA_BUILD_OPENCL)
endif ()

spla_target_compile_definitions(spla)
spla_target_compile_options(spla)
spla_target_link_options(spla)

set(SPLA_CONF_SRC "${CMAKE_CURRENT_LIST_DIR}/python/pyspla/spla_conf.json")
set(SPLA_CONF_DST "${CMAKE_BINARY_DIR}/spla_conf.json")
add_custom_command(TARGET spla POST_BUILD
COMMAND "${CMAKE_COMMAND}" -E copy_if_different
"${SPLA_CONF_SRC}" "${SPLA_CONF_DST}"
COMMENT "Copying shipped configuration file spla_conf.json next to the library")

######################################################################
## Add examples directory

Expand All @@ -404,6 +453,18 @@ if (SPLA_BUILD_EXAMPLES)
spla_example_application(convert)
endif ()

######################################################################
## Add command line tools

if (SPLA_BUILD_TOOLS)
message(STATUS "Add command line tools to build")

add_executable(spla_cli tools/soft_check.cpp)
target_link_libraries(spla_cli PRIVATE spla)
target_link_libraries(spla_cli PRIVATE CLI11::CLI11)
set_target_properties(spla_cli PROPERTIES OUTPUT_NAME spla)
endif ()

######################################################################
## Add unit-tests directory

Expand Down
2 changes: 2 additions & 0 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def main():
parser.add_argument("--build-type", default="Release", help="type of build: `Debug`, `Release` or `RelWithDebInfo`")
parser.add_argument("--tests", default="YES", help="build tests")
parser.add_argument("--examples", default="YES", help="build example applications")
parser.add_argument("--tools", default="YES", help="build command line tools")
parser.add_argument("--opencl", default="YES", help="build opencl acceleration backend")
parser.add_argument("--target", default="all", help="which target to build")
parser.add_argument("--nt", default="4", help="number of os threads for build")
Expand All @@ -44,6 +45,7 @@ def main():

build_config_args = ["cmake", ".", "-B", args.build_dir, "-G", "Ninja", f"-DCMAKE_BUILD_TYPE={args.build_type}",
f"-DSPLA_BUILD_TESTS={args.tests}", f"-DSPLA_BUILD_EXAMPLES={args.examples}",
f"-DSPLA_BUILD_TOOLS={args.tools}",
f"-DSPLA_BUILD_OPENCL={args.opencl}"]

if args.arch:
Expand Down
Loading
Loading