Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Features/tensor refactor #115

Merged
merged 59 commits into from
May 24, 2021
Merged
Show file tree
Hide file tree
Changes from 57 commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
fbb870b
minimal refactoring of extents type.
Jan 13, 2021
d91b96d
adjusting extents with dynamic and static rank. minimizing the number…
Jan 18, 2021
5c7f82d
[tensor] type traits functions for extents and strides deleted and in…
Apr 24, 2021
e1819cc
clang warnings resolved.
Apr 25, 2021
4ab7566
clang tidy updated. warnings as errors reduced to clang static analyzer.
Apr 25, 2021
2c2f4ca
modification for c++20 usage with clang.
Apr 25, 2021
6dc44fb
updating github action yml files to support only cxxstd 20
Apr 26, 2021
9ef07ba
minor modifications for tensor and shape with static order.
Apr 26, 2021
b74f832
configuration files modified for github workflow
Apr 26, 2021
25ef38c
tests with static shape and shape with static rank modifed as msvc 19…
Apr 26, 2021
4d4f105
cleaning up code for clang-tidy.
Apr 29, 2021
8194c93
[FIX] fixes to all tensor tests to pass clang-tidy checks.
Apr 29, 2021
03a49a5
[FIX] fixes to all tensor tests to pass clang-tidy checks.
Apr 30, 2021
8905cd6
updating github action yml files for a more convenient usage.
Apr 30, 2021
23b56bc
freeing functions for the extents type.
May 2, 2021
cc5869d
minor changes on extents with dynamic and static order.
May 3, 2021
82fdf9b
Decouping the constructor from the type extent
amitsingh19975 May 7, 2021
af7da45
refactor code and add std::get to get the element from the extents
amitsingh19975 May 7, 2021
dcea355
simplify static strides using C++20
amitsingh19975 May 7, 2021
d526963
fix clang-tidy warnings
amitsingh19975 May 7, 2021
c6b0dae
refactor the calculation of strides
amitsingh19975 May 7, 2021
701f1b8
make reshape a free function and create new headers in order to decou…
amitsingh19975 May 8, 2021
f1c409f
fix reshape in the examples
amitsingh19975 May 8, 2021
533db85
add tuple header to get std::tuple_size
amitsingh19975 May 8, 2021
19e8c19
fix msvc bug
amitsingh19975 May 8, 2021
dd0da73
enable apple workflow
amitsingh19975 May 8, 2021
7e0a1de
refactor for_each_* implementation
amitsingh19975 May 8, 2021
3590dfb
delete move constructs from the tensor expression
amitsingh19975 May 8, 2021
a3294cd
update apple.yml to support MacOS 11.0
amitsingh19975 May 8, 2021
4f74397
reverting back to MacOS to 10.15 because 11.0 is a closed pool right now
amitsingh19975 May 8, 2021
f063976
add clang from brew
amitsingh19975 May 8, 2021
dfde228
fix b2 in apple.yml
amitsingh19975 May 8, 2021
dfe4022
decouple static product functions from function.hpp and refactor the …
amitsingh19975 May 9, 2021
c2e46da
put static_assert and remove dead variable
amitsingh19975 May 9, 2021
6d10110
decouple functions into their respective category
amitsingh19975 May 9, 2021
aaba544
fix clang-tidy warnings
amitsingh19975 May 9, 2021
1911be6
decouple ttt from function.hpp
amitsingh19975 May 9, 2021
d0e804c
fix unused variable
amitsingh19975 May 9, 2021
1b21fc4
function source files renamed
May 9, 2021
f2cefc5
inner_prod and reshape header files added.
May 9, 2021
3ec9c64
outer_prod source file added.
May 9, 2021
eaaf5b1
transposition source file added.
May 9, 2021
376a0ef
norm source file added.
May 9, 2021
e7e88ed
imag source file added.
May 9, 2021
1436326
real source file added.
May 10, 2021
e3da95c
new file conj and tensor_times_vector added.
May 10, 2021
92ebe80
tensor times matrix header added.
May 10, 2021
2574477
adding tensor times tensor source file.
May 12, 2021
f2dcdac
strides type removed and remaining tests and types adjusted.
May 20, 2021
d1e8c53
clang-tidy warnings fixed.
May 20, 2021
c55500a
github actions configuration files modified.
May 21, 2021
6459512
tensor-vector multiplication modified.
May 21, 2021
20e55cd
add basic support for concepts to the tensor
amitsingh19975 May 21, 2021
f161949
Merge branch 'features/tensor_refactor' of https://github.com/boostor…
May 21, 2021
1d64553
hotfix for is_matrix.
May 21, 2021
f95a196
hotfix msvc for std::max
May 21, 2021
4e040f6
updating README.md
May 23, 2021
4be5f81
removing .appveyor and .travis yml files.
May 23, 2021
8ed0ad2
fix for integer devision.
May 23, 2021
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
8 changes: 6 additions & 2 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
---
Checks: '-*,modernize-*,cppcoreguidelines-*,openmp-*,bugprone-*,performance-*,portability-*,readability-*,-modernize-use-trailing-return-type,-cppcoreguidelines-pro-bounds-pointer-arithmetic,-readability-uppercase-literal-suffix,-readability-braces-around-statements'
WarningsAsErrors: '-*,modernize-*,cppcoreguidelines-*,openmp-*,bugprone-*,performance-*,portability-*,readability-*,-modernize-use-trailing-return-type,-cppcoreguidelines-pro-bounds-pointer-arithmetic,-readability-uppercase-literal-suffix,-readability-braces-around-statements'
Checks: '-*,clang-*,bugprone-*,cppcoreguidelines-*,google-*,hicpp-*,modernize-*,performance-*,readability-*,portability-*,
-modernize-use-trailing-return-type, -readability-uppercase-literal-suffix, -readability-braces-around-statements, -hicpp-uppercase-literal-suffix, -hicpp-braces-around-statements, -hicpp-no-array-decay, -cppcoreguidelines-pro-bounds-constant-array-index, -cppcoreguidelines-pro-bounds-pointer-arithmetic, -cppcoreguidelines-pro-bounds-array-to-pointer-decay, -readability-avoid-const-params-in-decls, -google-readability-braces-around-statements,-google-explicit-constructor,-hicpp-vararg,-cppcoreguidelines-pro-type-vararg, -cppcoreguidelines-avoid-non-const-global-variables, -google-readability-todo, -cppcoreguidelines-pro-type-member-init, -hicpp-member-init'
HeaderFilterRegex: 'boost\/numeric\/ublas\/tensor\/.*'
AnalyzeTemporaryDtors: false
FormatStyle: file
User: ublas-developers
CheckOptions:
- key: modernize-use-nullptr.NullMacros
value: 'NULL'
- key: readability-magic-numbers.IgnoredIntegerValues
value: '1;2;3;4;5;6;7;8;9;'
- key: cppcoreguidelines-avoid-magic-numbers.IgnoredIntegerValues
value: '1;2;3;4;5;6;7;8;9;'
...
75 changes: 0 additions & 75 deletions .github/workflows/address_san.yml

This file was deleted.

41 changes: 20 additions & 21 deletions .github/workflows/apple_clang.yml → .github/workflows/apple.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Copyright (c) 2020 Mohammad Ashar Khan
# Copyright (c) 2021 Cem Bassoy
# Distributed under Boost Software License, Version 1.0
# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt)

name: Apple Clang
name: "Apple MacOS"

on:
push:
Expand All @@ -15,24 +16,26 @@ on:
- 'doc/**'
jobs:
build:
name: "Darwin 11.0 -std=c++${{matrix.cxxstd}}"
runs-on: macos-latest
name: "MacOS 10.15 clang -std=c++${{matrix.cxxstd}}"
runs-on: macos-10.15
strategy:
fail-fast: false
fail-fast: true
matrix:
cxxstd: [11, 17, 2a]
cxxstd: [2a]

steps:
- uses: actions/checkout@v2

- name: Prepare BOOST_ROOT
- name: Git Clone Boost.uBlas
run: |
cd ${GITHUB_WORKSPACE}
cd ..

git clone -b master --depth 1 https://github.com/boostorg/boost.git boost-root
cd boost-root

echo "BOOST_ROOT=${PWD}" >> ${GITHUB_ENV}
echo $BOOST_ROOT

git submodule update --init --depth=1 --jobs 8 tools/build
git submodule update --init --depth=1 --jobs 8 libs/config
git submodule update --init --depth=1 --jobs 8 tools/boostdep
Expand All @@ -41,33 +44,29 @@ jobs:
cp -rp ${GITHUB_WORKSPACE}/. libs/numeric/ublas
python tools/boostdep/depinst/depinst.py -g " --depth=1" -I benchmarks numeric/ublas

./bootstrap.sh
./b2 -j 8 headers

#echo ::set-env name=BOOST_ROOT::${PWD}
echo "BOOST_ROOT=${PWD}" >> ${GITHUB_ENV}

- name: Prepare Build
- name: Bootstrap and Compile Boost.uBlas
run: |
echo $BOOST_ROOT
cd $BOOST_ROOT

echo "using clang : : clang++ ;" >> ~/user-config.jam;

./bootstrap.sh
./b2 -j8 headers
echo "using clang : : $(brew --prefix llvm)/bin/clang++ ;" >> ~/user-config.jam;


- name: Test Benchmarks
run: |
cd $BOOST_ROOT
cd libs/numeric/ublas
$BOOST_ROOT/b2 -j 4 benchmarks toolset=clang cxxstd=${{matrix.cxxstd}}
$BOOST_ROOT/b2 -j8 benchmarks cxxstd=${{matrix.cxxstd}}

- name: Test Tensor Examples
run: |
cd $BOOST_ROOT
cd libs/numeric/ublas
$BOOST_ROOT/b2 -j 4 examples/tensor toolset=clang cxxstd=${{matrix.cxxstd}}
$BOOST_ROOT/b2 -j8 examples/tensor cxxstd=${{matrix.cxxstd}}

- name: Test Tensor
run: |
cd $BOOST_ROOT
cd libs/numeric/ublas
$BOOST_ROOT/b2 -j 4 test/tensor toolset=clang cxxstd=${{matrix.cxxstd}}
$BOOST_ROOT/b2 -j8 test/tensor cxxstd=${{matrix.cxxstd}}

Original file line number Diff line number Diff line change
@@ -1,26 +1,30 @@
# Copyright (c) 2020 Mohammad Ashar Khan
# Copyright (c) 2021 Cem Bassoy
# Distributed under Boost Software License, Version 1.0
# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt)

name: Clang tidy Review

on: [pull_request]

name: "Static Analysis"

on:
push:
paths-ignore:
- '**.md'
- 'doc/**'
pull_request:
paths-ignore:
- '**.md'
- 'doc/**'
jobs:
check:
name: Clang tidy Review
name: Linux Clang-Tidy
runs-on: ubuntu-20.04
if: github.event.pull_request.head.repo.full_name == github.repository
steps:
- uses: actions/checkout@v2
- name: "Install dependencies"
run: |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key 2>/dev/null | sudo apt-key add -
sudo add-apt-repository 'deb http://apt.llvm.org/focal llvm-toolchain-focal-10 main' -y
sudo apt-get update -q
sudo apt-get install -y clang-10 clang-tidy-10
- uses: actions/checkout@v2

- name: Install Clang 11
run: sudo apt-get update && sudo apt-get install -y clang-11 clang-tidy-11

- name: "Install Boost from Source"
- name: "Install Boost from Source"
run: |
cd ..
git clone --depth 1 https://github.com/boostorg/boost.git --recursive --shallow-submodules
Expand All @@ -29,19 +33,20 @@ jobs:
./b2 headers
sudo cp -r -L boost /usr/include
rm -rf boost

- name: "Run Clang-Tidy"
run: clang-tidy-11 examples/tensor/*.cpp test/tensor/*.cpp -- -Iinclude -std=c++20 > reports.txt

- name: "Print Clang-Tidy Report"
run: cat reports.txt

- uses: actions/setup-python@v2

- name: "Run clang-tidy check"
run: |
clang-tidy-10 examples/tensor/*.cpp -- -Iinclude -std=c++17 > reports.txt


- name: "Post review comments"
if: always()
if: github.event.pull_request.head.repo.full_name == github.repository
run: |
pip3 install 'unidiff~=0.6.0' --force-reinstall
pip3 install 'PyGithub~=1.51' --force-reinstall
pip3 install 'requests~=2.23' --force-reinstall

python ./.ci/post_review.py --repository ${{ github.repository }} --token ${{ github.token}} --pr ${{ github.event.pull_request.number }} --path reports.txt

python ./.ci/post_review.py --repository ${{ github.repository }} --token ${{ github.token}} --pr ${{ github.event.pull_request.number }} --path reports.txt

47 changes: 0 additions & 47 deletions .github/workflows/clangtidy_check.yml

This file was deleted.

12 changes: 6 additions & 6 deletions .github/workflows/code_format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Distributed under Boost Software License, Version 1.0
# (See accompanying file LICENSE_1_0.txt or copy at http://boost.org/LICENSE_1_0.txt)

name: "Code Format"
name: "Clang Code Format"

on:
push:
Expand All @@ -15,7 +15,7 @@ on:
- 'doc/**'
jobs:
format:
name: "Code Formatting Check"
name: "Clang Code Formatting Check"
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
Expand All @@ -24,8 +24,8 @@ jobs:
run: |
sudo apt-get install -y clang-format-10

- name: "Format Codes"
run: clang-format-10 -i examples/tensor/*.cpp test/tensor/*.cpp include/boost/numeric/ublas/tensor/*.hpp include/boost/numeric/ublas/tensor/*/*.hpp
# - name: "Format Codes"
# run: clang-format-10 -i examples/tensor/*.cpp test/tensor/*.cpp include/boost/numeric/ublas/tensor/*.hpp include/boost/numeric/ublas/tensor/*/*.hpp

- name: Check diff
run: git diff --exit-code HEAD
# - name: Check diff
# run: git diff --exit-code HEAD
Loading