Skip to content

Commit 87e129c

Browse files
committed
Tensor: update CMake, prepare examples folder, sync install/export with root CMake
1 parent 5b03513 commit 87e129c

7 files changed

Lines changed: 932 additions & 115 deletions

File tree

.gitignore

Lines changed: 12 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,19 @@
1-
# Prerequisites
2-
*.d
3-
4-
# Compiled Object files
5-
*.slo
6-
*.lo
1+
/build*/
2+
out/
3+
.vscode/
4+
.idea/
75
*.o
86
*.obj
9-
10-
# Precompiled Headers
11-
*.gch
12-
*.pch
13-
14-
# Linker files
15-
*.ilk
16-
17-
# Debugger Files
18-
*.pdb
19-
20-
# Compiled Dynamic libraries
7+
*.a
8+
*.lib
219
*.so
2210
*.dylib
2311
*.dll
24-
25-
# Fortran module files
26-
*.mod
27-
*.smod
28-
29-
# Compiled Static libraries
30-
*.lai
31-
*.la
32-
*.a
33-
*.lib
34-
35-
# Executables
3612
*.exe
37-
*.out
38-
*.app
13+
compile_commands.json
14+
CMakeFiles/
15+
CMakeCache.txt
16+
cmake-build-*/
17+
cmd.md
18+
3919

40-
# debug information files
41-
*.dwo
42-
cmd.md

CHANGELOG.md

Lines changed: 42 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,46 @@
1-
# 🧠 Changelog — vix-ai-core
1+
# Changelog
22

3-
Ce fichier suit les changements majeurs du module **vix-ai-core**.
4-
Le format est inspiré de [Keep a Changelog](https://keepachangelog.com/fr/1.0.0/)
5-
et respecte le [Semantic Versioning](https://semver.org/lang/fr/).
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
---
9+
10+
## [Unreleased]
11+
12+
### Added
13+
- Support for basic tensor operations (addition, multiplication, indexing).
14+
- Device abstraction for CPU (future GPU support planned).
15+
- Engine for executing tensor operations efficiently.
16+
- Version tracking for library.
17+
- Unit tests and smoke tests for tensor functionality.
18+
19+
### Changed
20+
- N/A
21+
22+
### Fixed
23+
- N/A
624

725
---
826

9-
## [v0.1.0] — 2025-11-05
10-
### 🚀 Initial release
11-
- Initialisation du module **vix-ai-core**
12-
- Ajout des dossiers `include/`, `src/`, `scripts/`, `CMakeLists.txt`, et `Makefile`
13-
- Première intégration avec le projet parent **vix-ai**
27+
## [0.1.0] - 2026-03-13
28+
29+
### Added
30+
- Initial release of Vix AI Tensor library.
31+
- Core classes:
32+
- `Tensor` for multi-dimensional arrays.
33+
- `Device` to manage CPU computation context.
34+
- `Engine` for executing operations on tensors.
35+
- Library CMake build with:
36+
- Build tests option
37+
- Warnings configuration
38+
- Installation support
39+
- Export targets for `find_package()` integration.
40+
- Example smoke test (`tests/smoke.cpp`) to verify basic functionality.
41+
42+
### Changed
43+
- N/A
44+
45+
### Fixed
46+
- N/A

CMakeLists.txt

Lines changed: 27 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,33 +5,31 @@ project(tensor
55
DESCRIPTION "Vix AI Tensor: tiny device/tensor/engine primitives"
66
LANGUAGES CXX)
77

8-
# ---- Options ---------------------------------------------------------------
9-
option(VIX_AI_TENSOR_BUILD_TESTS "Build tensor tests" ON)
10-
option(VIX_AI_TENSOR_INSTALL "Install tensor targets" ON)
11-
option(VIX_AI_TENSOR_WARNINGS "Enable extra warnings" ON)
8+
option(VIX_AI_TENSOR_BUILD_TESTS ON)
9+
option(VIX_AI_TENSOR_INSTALL ON)
10+
option(VIX_AI_TENSOR_WARNINGS ON)
1211

13-
# ---- Library ----------------------------------------------------------------
1412
add_library(vix_ai_tensor
1513
src/Version.cpp
1614
src/Tensor.cpp
1715
src/Device.cpp
1816
src/Engine.cpp
1917
)
2018

21-
add_library(Vix::ai::tensor ALIAS vix_ai_tensor)
19+
add_library(vix::ai::tensor ALIAS vix_ai_tensor)
2220

23-
# Public headers
2421
target_include_directories(vix_ai_tensor
2522
PUBLIC
2623
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
2724
$<INSTALL_INTERFACE:include>
2825
)
2926

30-
# C++ standard & version
3127
target_compile_features(vix_ai_tensor PUBLIC cxx_std_20)
32-
target_compile_definitions(vix_ai_tensor PUBLIC VIX_AI_TENSOR_VERSION="${PROJECT_VERSION}")
3328

34-
# Warnings
29+
target_compile_definitions(vix_ai_tensor
30+
PUBLIC VIX_AI_TENSOR_VERSION="${PROJECT_VERSION}"
31+
)
32+
3533
if(VIX_AI_TENSOR_WARNINGS)
3634
if(MSVC)
3735
target_compile_options(vix_ai_tensor PRIVATE /W4 /permissive-)
@@ -40,16 +38,16 @@ if(VIX_AI_TENSOR_WARNINGS)
4038
endif()
4139
endif()
4240

43-
# Good defaults
4441
set_target_properties(vix_ai_tensor PROPERTIES
4542
POSITION_INDEPENDENT_CODE ON
46-
VERSION ${PROJECT_VERSION}
43+
VERSION ${PROJECT_VERSION}
4744
SOVERSION ${PROJECT_VERSION_MAJOR}
4845
EXPORT_NAME tensor
4946
)
5047

51-
# ---- Install / package -----------------------------------------------------
48+
# ---- Install ---------------------------------------------------------------
5249
if(VIX_AI_TENSOR_INSTALL)
50+
5351
include(GNUInstallDirs)
5452
include(CMakePackageConfigHelpers)
5553

@@ -60,16 +58,15 @@ if(VIX_AI_TENSOR_INSTALL)
6058
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
6159
)
6260

63-
install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
61+
install(DIRECTORY include/
62+
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
6463

65-
# Export targets for find_package()
6664
install(EXPORT vix_ai_tensorTargets
6765
FILE vix_ai_tensorTargets.cmake
68-
NAMESPACE Vix::AI::
66+
NAMESPACE vix::ai::
6967
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/vix_ai/tensor
7068
)
7169

72-
# Config + version files
7370
write_basic_package_version_file(
7471
${CMAKE_CURRENT_BINARY_DIR}/vix_ai_tensorConfigVersion.cmake
7572
VERSION ${PROJECT_VERSION}
@@ -84,12 +81,22 @@ if(VIX_AI_TENSOR_INSTALL)
8481
${CMAKE_CURRENT_BINARY_DIR}/vix_ai_tensorConfigVersion.cmake
8582
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/vix_ai/tensor
8683
)
84+
8785
endif()
8886

8987
# ---- Tests -----------------------------------------------------------------
9088
if(VIX_AI_TENSOR_BUILD_TESTS AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/tests")
89+
9190
enable_testing()
92-
add_executable(vix_ai_tensor_smoke tests/smoke.cpp)
93-
target_link_libraries(vix_ai_tensor_smoke PRIVATE vix_ai_tensor)
94-
add_test(NAME smoke COMMAND vix_ai_tensor_smoke)
91+
92+
add_executable(vix_ai_tensor_smoke
93+
tests/smoke.cpp
94+
)
95+
96+
target_link_libraries(vix_ai_tensor_smoke
97+
PRIVATE vix_ai_tensor
98+
)
99+
100+
add_test(NAME tensor_smoke COMMAND vix_ai_tensor_smoke)
101+
95102
endif()

0 commit comments

Comments
 (0)