-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e5d2909
commit f10d72a
Showing
55 changed files
with
2,120 additions
and
1,525 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
BasedOnStyle: LLVM | ||
IndentWidth: 4 | ||
PointerAlignment: Left | ||
ColumnLimit: 120 | ||
BasedOnStyle: LLVM | ||
IndentWidth: 4 | ||
PointerAlignment: Left | ||
ColumnLimit: 120 | ||
AlwaysBreakTemplateDeclarations: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,34 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: main | ||
paths: ['**.cu','**.c','**.cpp', '**.h', '**CMakeLists.txt'] | ||
pull_request: | ||
branches: main | ||
paths: ['**.cu','**.c','**.cpp', '**.h', '**CMakeLists.txt'] | ||
|
||
jobs: | ||
build-and-test: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.10' | ||
|
||
- name: Install dependencies | ||
run: | | ||
pip install pandas | ||
- name: Build project | ||
run: | | ||
make build | ||
- name: Run test suite | ||
run: | | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: main | ||
paths: ['**.cu','**.c','**.cpp', '**.h', '**CMakeLists.txt'] | ||
pull_request: | ||
branches: main | ||
paths: ['**.cu','**.c','**.cpp', '**.h', '**CMakeLists.txt'] | ||
|
||
jobs: | ||
build-and-test: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.10' | ||
|
||
- name: Install dependencies | ||
run: | | ||
pip install pandas | ||
- name: Build project | ||
run: | | ||
make build | ||
- name: Run test suite | ||
run: | | ||
make test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,33 @@ | ||
name: cpp-linter | ||
on: | ||
pull_request: | ||
branches: main | ||
paths: ['**.cu','**.cpp','**.c', '**.h', '**CMakeLists.txt'] | ||
push: | ||
branches: main | ||
paths: ['**.cu','**.cpp','**.c', '**.h', '**CMakeLists.txt'] | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
actions: write | ||
|
||
jobs: | ||
cpp-linter: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: cpp-linter/cpp-linter-action@v2 | ||
id: linter | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
style: 'file' # Use .clang-format config file. | ||
tidy-checks: '-*' # disable clang-tidy checks. | ||
version: 17 | ||
thread-comments: true | ||
format-review: true | ||
|
||
- name: Run clang-format | ||
if: steps.linter.outputs.clang-format-checks-failed > 0 | ||
run: exit 1 | ||
name: cpp-linter | ||
on: | ||
pull_request: | ||
branches: main | ||
paths: ['**.cu','**.cpp','**.c', '**.h', '**CMakeLists.txt'] | ||
push: | ||
branches: main | ||
paths: ['**.cu','**.cpp','**.c', '**.h', '**CMakeLists.txt'] | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
actions: write | ||
|
||
jobs: | ||
cpp-linter: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: cpp-linter/cpp-linter-action@v2 | ||
id: linter | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
style: 'file' # Use .clang-format config file. | ||
tidy-checks: '-*' # disable clang-tidy checks. | ||
version: 17 | ||
thread-comments: true | ||
format-review: true | ||
|
||
- name: Run clang-format | ||
if: steps.linter.outputs.clang-format-checks-failed > 0 | ||
run: exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,44 @@ | ||
# Prerequisites | ||
*.d | ||
|
||
# Compiled Object files | ||
*.slo | ||
*.lo | ||
*.o | ||
*.obj | ||
|
||
# Precompiled Headers | ||
*.gch | ||
*.pch | ||
|
||
# Compiled Dynamic libraries | ||
*.so | ||
*.dylib | ||
*.dll | ||
|
||
# Fortran module files | ||
*.mod | ||
*.smod | ||
|
||
# Compiled Static libraries | ||
*.lai | ||
*.la | ||
*.a | ||
*.lib | ||
|
||
# Executables | ||
*.exe | ||
*.out | ||
*.app | ||
speed_cpu | ||
speed_gpu | ||
|
||
# Misc | ||
.vscode/ | ||
build/ | ||
bin/ | ||
tensors/ | ||
results.csv | ||
tensors/ | ||
perf.data | ||
perf.data.old | ||
# Prerequisites | ||
*.d | ||
|
||
# Compiled Object files | ||
*.slo | ||
*.lo | ||
*.o | ||
*.obj | ||
|
||
# Precompiled Headers | ||
*.gch | ||
*.pch | ||
|
||
# Compiled Dynamic libraries | ||
*.so | ||
*.dylib | ||
*.dll | ||
|
||
# Fortran module files | ||
*.mod | ||
*.smod | ||
|
||
# Compiled Static libraries | ||
*.lai | ||
*.la | ||
*.a | ||
*.lib | ||
|
||
# Executables | ||
*.exe | ||
*.out | ||
*.app | ||
speed_cpu | ||
speed_gpu | ||
|
||
# Misc | ||
.vscode/ | ||
build/ | ||
build_gpu/ | ||
bin/ | ||
results.csv | ||
tensors/ | ||
perf.data | ||
perf.data.old |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,33 @@ | ||
cmake_minimum_required(VERSION 3.16) | ||
|
||
# Set the project name | ||
project(ichida-algo) | ||
|
||
set(CMAKE_C_FLAGS "-O3 -march=native -ffast-math -funroll-loops -fopenmp -Wall -Wextra") | ||
|
||
set(CMAKE_C_STANDARD 11) | ||
set(CMAKE_C_STANDARD_REQUIRED True) | ||
# set(CMAKE_VERBOSE_MAKEFILE ON) | ||
|
||
set(SRC_DIR src) | ||
set(INC_DIR include) | ||
set(LIB_DIR lib) | ||
set(TEST_DIR test) | ||
set(BENCHMARK_DIR benchmark) | ||
|
||
# Source files | ||
file(GLOB_RECURSE SOURCE_FILES ${SRC_DIR}/*.c) | ||
|
||
include_directories(include) | ||
|
||
add_executable(speed_cpu ${SOURCE_FILES}) | ||
# add_executable(benchmark ${SRC_DIR}/matrix.c ${BENCHMARK_DIR}/benchmark.c) | ||
|
||
target_link_libraries(speed_cpu m pthread) | ||
# target_link_libraries(benchmark m) | ||
|
||
|
||
|
||
cmake_minimum_required(VERSION 3.16) | ||
|
||
project(ichida-algo LANGUAGES C CXX CUDA) | ||
|
||
set(CMAKE_C_FLAGS "-O3 -march=native -ffast-math -funroll-loops -fopenmp -Wall -Wextra") | ||
set(CMAKE_C_STANDARD 11) | ||
set(CMAKE_C_STANDARD_REQUIRED True) | ||
set(CMAKE_VERBOSE_MAKEFILE ON) | ||
|
||
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -Xptxas -O3 --use_fast_math -Xcompiler -march=native -unroll-aggressive -arch=sm_80") | ||
|
||
set(INC_DIR include) | ||
set(SRC_DIR src) | ||
set(CUDA_SRC_DIR cuda/src) | ||
|
||
include_directories(${INC_DIR}) | ||
|
||
file(GLOB_RECURSE SOURCE_FILES ${SRC_DIR}/*.c) | ||
|
||
file(GLOB_RECURSE CUDA_SOURCE_FILES ${CUDA_SRC_DIR}/*.cu) | ||
|
||
add_executable(speed_cpu ${SOURCE_FILES}) | ||
target_link_libraries(speed_cpu m pthread gomp) | ||
|
||
find_package(MPI REQUIRED) | ||
include_directories(${MPI_INCLUDE_PATH}) | ||
|
||
add_executable(speed_gpu ${CUDA_SOURCE_FILES}) | ||
set_target_properties(speed_gpu PROPERTIES CUDA_SEPARABLE_COMPILATION ON) | ||
target_link_libraries(speed_gpu m ${MPI_LIBRARIES}) | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2024 kachi-group | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. | ||
MIT License | ||
Copyright (c) 2024 kachi-group | ||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
Oops, something went wrong.