simdpunk 0.1.0.dev1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- simdpunk-0.1.0.dev1/CMakeLists.txt +59 -0
- simdpunk-0.1.0.dev1/LICENSE +661 -0
- simdpunk-0.1.0.dev1/PKG-INFO +102 -0
- simdpunk-0.1.0.dev1/include/simdpunk/arm.h +85 -0
- simdpunk-0.1.0.dev1/include/simdpunk/exec.h +48 -0
- simdpunk-0.1.0.dev1/include/simdpunk/exec_openmp.h +43 -0
- simdpunk-0.1.0.dev1/include/simdpunk/extents.h +73 -0
- simdpunk-0.1.0.dev1/include/simdpunk/isa.h +43 -0
- simdpunk-0.1.0.dev1/include/simdpunk/kern/scalar_arms.h +199 -0
- simdpunk-0.1.0.dev1/include/simdpunk/layout.h +36 -0
- simdpunk-0.1.0.dev1/include/simdpunk/num.h +47 -0
- simdpunk-0.1.0.dev1/include/simdpunk/params.h +83 -0
- simdpunk-0.1.0.dev1/include/simdpunk/recipe.h +37 -0
- simdpunk-0.1.0.dev1/include/simdpunk/ref/adam.h +42 -0
- simdpunk-0.1.0.dev1/include/simdpunk/ref/gemm.h +72 -0
- simdpunk-0.1.0.dev1/include/simdpunk/ref/nn.h +78 -0
- simdpunk-0.1.0.dev1/include/simdpunk/ref/quantize.h +74 -0
- simdpunk-0.1.0.dev1/include/simdpunk/registry.h +95 -0
- simdpunk-0.1.0.dev1/include/simdpunk/slots.h +101 -0
- simdpunk-0.1.0.dev1/pyproject.toml +59 -0
- simdpunk-0.1.0.dev1/python/CMakeLists.txt +42 -0
- simdpunk-0.1.0.dev1/python/README.md +82 -0
- simdpunk-0.1.0.dev1/python/build.py +40 -0
- simdpunk-0.1.0.dev1/python/simdpunk/__init__.py +170 -0
- simdpunk-0.1.0.dev1/python/simdpunk/mnist.py +250 -0
- simdpunk-0.1.0.dev1/python/simdpunk_c.cpp +189 -0
- simdpunk-0.1.0.dev1/python/tests/test_simdpunk.py +68 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
2
|
+
# Copyright (C) 2026 Complement Alimentaire
|
|
3
|
+
#
|
|
4
|
+
# This file is part of simdpunk.
|
|
5
|
+
#
|
|
6
|
+
# simdpunk is free software: you can redistribute it and/or modify
|
|
7
|
+
# it under the terms of the GNU Affero General Public License as published by
|
|
8
|
+
# the Free Software Foundation, either version 3 of the License, or
|
|
9
|
+
# (at your option) any later version.
|
|
10
|
+
#
|
|
11
|
+
# simdpunk is distributed in the hope that it will be useful,
|
|
12
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
+
# GNU Affero General Public License for more details.
|
|
15
|
+
#
|
|
16
|
+
# You should have received a copy of the GNU Affero General Public License
|
|
17
|
+
# along with simdpunk. If not, see <https://www.gnu.org/licenses/>.
|
|
18
|
+
|
|
19
|
+
# simdpunk — header-only quantized-tensor library.
|
|
20
|
+
|
|
21
|
+
cmake_minimum_required(VERSION 3.16)
|
|
22
|
+
project(simdpunk LANGUAGES CXX)
|
|
23
|
+
|
|
24
|
+
add_library(simdpunk INTERFACE)
|
|
25
|
+
target_compile_features(simdpunk INTERFACE cxx_std_23)
|
|
26
|
+
target_include_directories(simdpunk INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/include)
|
|
27
|
+
|
|
28
|
+
if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
|
|
29
|
+
set(_SP_TOP ON)
|
|
30
|
+
else()
|
|
31
|
+
set(_SP_TOP OFF)
|
|
32
|
+
endif()
|
|
33
|
+
|
|
34
|
+
option(SIMDPUNK_TESTS "Build + register simdpunk tests" ON)
|
|
35
|
+
option(SIMDPUNK_EXAMPLES "Build examples" ${_SP_TOP})
|
|
36
|
+
|
|
37
|
+
if(SIMDPUNK_TESTS)
|
|
38
|
+
if(_SP_TOP)
|
|
39
|
+
include(CTest)
|
|
40
|
+
endif()
|
|
41
|
+
find_package(Catch2 3 REQUIRED)
|
|
42
|
+
|
|
43
|
+
include(CheckCXXCompilerFlag)
|
|
44
|
+
check_cxx_compiler_flag(-mfma SIMDPUNK_HAVE_MFMA)
|
|
45
|
+
set(SIMDPUNK_CANARY_ARCH_FLAGS "")
|
|
46
|
+
if(SIMDPUNK_HAVE_MFMA)
|
|
47
|
+
set(SIMDPUNK_CANARY_ARCH_FLAGS -mfma) # implies __AVX__ + __FMA__ ⇒ the vector pair too
|
|
48
|
+
endif()
|
|
49
|
+
|
|
50
|
+
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
|
51
|
+
list(APPEND SIMDPUNK_CANARY_ARCH_FLAGS --param=avoid-fma-max-bits=0 -fno-tree-vectorize)
|
|
52
|
+
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
|
53
|
+
list(APPEND SIMDPUNK_CANARY_ARCH_FLAGS -fno-vectorize -fno-slp-vectorize)
|
|
54
|
+
endif()
|
|
55
|
+
endif()
|
|
56
|
+
|
|
57
|
+
#if(SIMDPUNK_EXAMPLES)
|
|
58
|
+
# add_subdirectory(examples)
|
|
59
|
+
#endif()
|