Skip to content

Commit 4430704

Browse files
shoikedakurbeco
authored andcommitted
MiniDxNn v0.1.0
0 parents  commit 4430704

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+6026
-0
lines changed

.github/workflows/cmake.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: CMake build on Windows
2+
3+
on:
4+
push:
5+
branches: [main, feature/coop-vec-mlp-inference1]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
build:
11+
runs-on: windows-latest
12+
steps:
13+
- name: Checkout source
14+
uses: actions/checkout@v4
15+
with:
16+
submodules: recursive
17+
18+
- name: Install CMake
19+
uses: jwlawson/actions-setup-cmake@v1
20+
with:
21+
cmake-version: '4.2'
22+
23+
- name: Configure
24+
run: cmake -B build -DCMAKE_BUILD_TYPE=Release
25+

.gitignore

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Prerequisites
2+
*.d
3+
4+
# Compiled Object files
5+
*.slo
6+
*.lo
7+
*.o
8+
*.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
21+
*.so
22+
*.dylib
23+
*.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
36+
*.exe
37+
*.out
38+
*.app
39+
40+
# debug information files
41+
*.dwo
42+
43+
#
44+
clang/
45+
tmp/
46+
.cache/
47+
.vscode/
48+
49+
# Build
50+
build/*
51+
!/build/.gitkeep
52+
53+
# Runtime
54+
unittest/runtime/*
55+
!/unittest/runtime/.gitkeep
56+
57+
# CMake
58+
CMakeLists.txt.user
59+
CMakeCache.txt
60+
CMakeFiles
61+
CMakeScripts
62+
Testing
63+
Makefile
64+
cmake_install.cmake
65+
install_manifest.txt
66+
compile_commands.json
67+
CTestTestfile.cmake
68+
_deps
69+
CMakeUserPresets.json
70+
71+
# CLion
72+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
73+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
74+
# and can be added to the global gitignore or merged into this file. For a more nuclear
75+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
76+
#cmake-build-*

.gitmodules

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[submodule "third_party/gfx"]
2+
path = third_party/gfx_dep/gfx
3+
url = https://github.com/gboisse/gfx.git
4+
[submodule "third_party/googletest"]
5+
path = third_party/gtest_dep/googletest
6+
url = https://github.com/google/googletest.git
7+
[submodule "third_party/cli11_dep/CLI11"]
8+
path = third_party/cli11_dep/CLI11
9+
url = https://github.com/CLIUtils/CLI11.git

CMakeLists.txt

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
#
2+
# file: CMakeLists.txt
3+
# author: Sho Ikeda
4+
#
5+
# Copyright (c) 2026 Advanced Micro Devices, Inc. All Rights Reserved.
6+
#
7+
# SPDX-License-Identifier: MIT
8+
#
9+
10+
cmake_minimum_required(VERSION 3.21)
11+
12+
# CMake dependencies
13+
include(${CMAKE_CURRENT_LIST_DIR}/cmake/options.cmake)
14+
include(${CMAKE_CURRENT_LIST_DIR}/cmake/project.cmake)
15+
include(${CMAKE_CURRENT_LIST_DIR}/cmake/utility.cmake)
16+
17+
set(project_desc "A minimal DirectX-based neural network library")
18+
project(MiniDxNN DESCRIPTION ${project_desc} VERSION 0.1.0 LANGUAGES CXX)
19+
20+
# Configure project options (build flags, sanitizers, etc.)
21+
setProjectOptions()
22+
23+
# Top-level project configuration
24+
# Only applied when MiniDxNN is the main project (not when included as a subproject)
25+
if(PROJECT_IS_TOP_LEVEL)
26+
# Configure available build types (multi-config generators like Visual Studio)
27+
set(CMAKE_CONFIGURATION_TYPES "Debug" "RelWithDebInfo" "Release")
28+
29+
# Set default build type for single-config generators (Unix Makefiles, Ninja)
30+
if(NOT CMAKE_BUILD_TYPE)
31+
set(CMAKE_BUILD_TYPE "Debug")
32+
message(STATUS "CMAKE_BUILD_TYPE not set, defaulting to Debug")
33+
endif()
34+
35+
# Generate compile_commands.json for IDE integration and tools (clangd, clang-tidy, etc.)
36+
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
37+
endif()
38+
39+
# Build third-party dependencies
40+
add_subdirectory("${PROJECT_SOURCE_DIR}/third_party" "${PROJECT_BINARY_DIR}/third_party")
41+
42+
# Configure MiniDxNN core library
43+
setMiniDxNNCore(minidxnn-core)
44+
checkTarget(minidxnn-core)
45+
46+
# Configure and build examples
47+
if(PROJECT_IS_TOP_LEVEL AND MINIDXNN_BUILD_EXAMPLES)
48+
message(STATUS "Enable examples")
49+
add_subdirectory("${PROJECT_SOURCE_DIR}/example" "${PROJECT_BINARY_DIR}/example")
50+
endif()
51+
52+
# Configure and build unit tests
53+
if(PROJECT_IS_TOP_LEVEL AND MINIDXNN_BUILD_TESTS)
54+
message(STATUS "Enable unittests")
55+
enable_testing()
56+
add_subdirectory("${PROJECT_SOURCE_DIR}/unittest" "${PROJECT_BINARY_DIR}/unittest")
57+
endif()

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 Advanced Micro Devices, Inc. All rights reserved.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

NOTICE.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# MiniDxNn - Third Party Notices
2+
3+
This product includes software developed by other organizations
4+
and contains third-party components under various open source licenses.
5+
6+
* [Half-precision floating-point library](https://half.sourceforge.net/)
7+
- **used for:** To introduce 16-bit float
8+
- **license:** MIT License
9+
* [gfx](https://github.com/gboisse/gfx)
10+
- **used for:** To introduce Direct3D12 framework
11+
- **license:** MIT license
12+
* [CLI11](https://github.com/CLIUtils/CLI11)
13+
- **used for:** Command line parser for C++
14+
- **license:** BSD-3-Clause license
15+
* [GoogleTest](https://github.com/google/googletest)
16+
- **used for:** To introduce testing framework
17+
- **license:** BSD-3-Clause license

0 commit comments

Comments
 (0)