Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
782ce16
readme updated.
Mar 3, 2019
1f5105a
Adds code coverage to ublas
coder3101 May 12, 2019
cf72d03
Merge pull request #69 from BoostGSoC19/pr-codecov
bassoy May 19, 2019
a490a29
Disable coverage for non-tensor unit tests
coder3101 May 20, 2019
005b606
Adding the expr_template and framework branch builds
coder3101 May 20, 2019
8654ba7
Adding tags and badges to README
coder3101 May 20, 2019
832bc70
Add all badges with refactoring
coder3101 May 20, 2019
0a37700
Update README.md
coder3101 May 20, 2019
b31dee5
Disable running unit tests of non-tensor modules
coder3101 May 20, 2019
cdf219c
Fix for Appveyor CI Failures
coder3101 Aug 18, 2019
1e8689b
Merge pull request #72 from coder3101/develop
bassoy Mar 14, 2020
e68819c
Phase 1: adding static extents and static strides
amitsingh19975 Apr 14, 2020
cb3bf69
Merge pull request #80 from BoostGSoC19/framework_static_extents_strides
bassoy Apr 18, 2020
8dc3f04
Update README.md
bassoy Apr 18, 2020
8938db5
Decoupling the tensor into three tensor different tensor types (#81)
amitsingh19975 May 3, 2020
47a314d
C++20/gcc10 removed allocator construct/destroy (#83)
poelmanc May 11, 2020
6f823d1
bug in test/tensor/test_static_functions.cpp with memory leak fixed. …
bassoy Jun 23, 2020
0584e2a
GSoC20 Phase 1: Enhance CI workflows and switch to Github Actions (#89)
coder3101 Jul 11, 2020
7cc02bf
Disable brranch coverage (#91)
coder3101 Jul 12, 2020
4640322
hotfix: no review for outside repo PR (#98)
coder3101 Aug 4, 2020
a31e5cf
Remove deprecated inheritance from std::iterator (#97)
poelmanc Aug 4, 2020
a23a903
Support the C++ allocator model (#103)
glenfe Aug 12, 2020
92177ce
Do not trigger Github Actions for doc or Readme changes (#102)
coder3101 Aug 12, 2020
799ef70
Introducing a new and versatile way to create the tensor interface. (…
amitsingh19975 Dec 10, 2020
a81712c
fixing github action ymls (#107)
bassoy Dec 10, 2020
f0e0578
adjusting qt files and examples. (#109)
bassoy Jan 12, 2021
a880b91
[skip ci] Add "cxxstd" json field (#110)
eldiener Jan 23, 2021
32795e1
Update libraries.json
bassoy Jan 23, 2021
231ba5f
refactor(core): simplify and eliminate auxiliary tensor types (#115)
bassoy May 24, 2021
e09bdeb
refactor(docs): convert HTML documentation using AsciiDoc
shikharvashistha Jun 7, 2021
09db8ba
fix: update windows.yml for Github Actions
bassoy Sep 6, 2021
d07ab80
docs: update README.md
bassoy Sep 12, 2021
dae5364
ci: add CI for asciidoc documentation compilation (#143)
shikharvashistha Nov 6, 2021
f5bf276
refactor(test): Improve unit test source files (#122)
amitsingh19975 Feb 3, 2022
c5850f6
refactor(tensor): Improve functions for enabling compiler optimizatio…
Neel-Shah-29 Feb 6, 2022
3a4fe24
chore: bump macos runner version (#177)
renbaoshuo Aug 2, 2022
8934b49
Add CMakeLists.txt. Closes #142.
pdimov Nov 22, 2023
8708cbf
Remove dependencies on Boost.StaticAssert. (#198)
Lastique May 5, 2026
1203497
Make the library modular usable. (#196)
grafikrobot Sep 10, 2026
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
73 changes: 0 additions & 73 deletions .appveyor.yml

This file was deleted.

3 changes: 3 additions & 0 deletions .ci/install-clblas.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@
wget https://github.com/clMathLibraries/clBLAS/releases/download/v2.12/clBLAS-2.12.0-Linux-x64.tar.gz
tar xvf clBLAS-2.12.0-Linux-x64.tar.gz
if [ ${CLBLAS_PREFIX} ]; then
echo "Installing clBLAS-2.12.0"
mkdir -p ${CLBLAS_PREFIX}/lib/
cp -r clBLAS-2.12.0-Linux-x64/include ${CLBLAS_PREFIX}/include
cp -r clBLAS-2.12.0-Linux-x64/lib64/* ${CLBLAS_PREFIX}/lib/
cp -r clBLAS-2.12.0-Linux-x64/bin ${CLBLAS_PREFIX}/bin
else
echo "CLBLAS_PREFIX is not set. Skipping CLBLAS Installation"
fi
221 changes: 221 additions & 0 deletions .ci/post_review.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,221 @@
#! usr/bin/env python3

# Automatically create review from clang-tidy report
# Copyright (c) 2020 Ashar Khan <ashar786khan.at.gmail.com>
# Licensed under Boost Software License 1.0

import argparse
from github import Github
import unidiff
import os
import requests


def fetch_diff(repository, pr, token):
"""
Fetch the diff of PR from repository using Github Authentication token
"""
headers = {
"Accept": "application/vnd.github.v3.diff",
"Authorization": f"token {token}",
}
url = f"https://api.github.com/repos/{repository}/pulls/{pr}"
response = requests.get(url, headers=headers)
response.raise_for_status()

return unidiff.PatchSet(response.text)


def parse_report_file(content):
"""
Parses clang-tidy stdout content to a list of tuple(relpath, line, comment), this tuple is called reports throughout the docs.
relpath: The relative path of source that generated clang-tidy warning or error
line: Line number in the above soure to which the error or warning belongs
comment: The actual clang-tidy error or warning for above line and source
"""
root_path = os.getcwd()
parsed_report = []
n = len(content)
i = 0
while (i < n):
if "error" in content[i] or "warning" in content[i]:
abs_file_path, line_number, _, severity, message = content[i].split(
":", maxsplit=4)
relative_path = os.path.relpath(abs_file_path, root_path)

k = 1
body = ""
while i+k < n and not ("error" in content[i+k] or "warning" in content[i+k]):
body += "\n" + content[i + k].replace(abs_file_path, relative_path)
k += 1
i += k

message = message.strip().replace("'", "`")
body = body.strip()

comment_text = f"""{message}
```cpp
{body}
```
Reported as{severity} by clang-tidy.
"""
parsed_report.append((relative_path, line_number, comment_text))
return parsed_report


def file_filter_report(reports, diff):
"""
Filter the reports so that it only contains the reports for files in diff that have changed or been added in the PR
"""
changed_files = []
for file in diff:
changed_files.append(file.target_file[2:])

filtered_report = []
for report in reports:
rel_path, line_number, comment_text = report
if rel_path in changed_files:
filtered_report.append(report)

return filtered_report


def line_filter_report(reports, diff):
"""
Filter the reports so that it only contains the reports for lines in the diff that have been added.
"""
files_in_report = [i[0] for i in reports]
filtered_report = []

lookup = {}
for file in diff:
if file.target_file[2:] in files_in_report:
for hunk in file:
for line in hunk.target_lines():
if line.is_added:
if file.target_file[2:] not in lookup:
lookup[file.target_file[2:]] = list()
lookup[file.target_file[2:]].append(
int(line.target_line_no))

for report in reports:
fileName, number, _ = report
number = int(number)
if number in lookup[fileName]:
filtered_report.append(report)

return filtered_report


def line_to_position(reports, diff):
"""
The actual source file line number in report is different from what we need to send to github as review payload.
This function converts the clang-tidy generated error or warning line numbers to position in diff,
so that review can be made for position relevant to the PR.
"""
lookup = {}
for file in diff:
filename = file.target_file[2:]
lookup[filename] = {}
pos = 1
for hunk in file:
for line in hunk:
if not line.is_removed:
lookup[filename][line.target_line_no] = pos
pos += 1
pos += 1
new_reports = []
for report in reports:
x, y, z = report
new_reports.append((x, lookup[x][int(y)], z))

return new_reports


def comment_lgtm(pr_handle):
"""
Posts a LGTM (Looks good to me!) comment in the PR, if PR did not produced new clang-tidy warnings or errors.
"""
lgtm = 'This Pull request Passed all of clang-tidy tests. :+1:'
comments = pr_handle.get_issue_comments()

for comment in comments:
if comment.body == lgtm:
print("Already posted LGTM!!")
return

pr_handle.create_issue_comment(lgtm)


def post_review(reports, pr_handle):
"""
Posts the reports as review to the PR
"""
comments = pr_handle.get_review_comments()
for comment in comments:
target = (comment.path, comment.position, comment.body)
if target in reports:
reports.remove((comment.path, comment.position, comment.body))

if len(reports) == 0:
comment_lgtm(pr_handle)
else:
comments = []
for report in reports:
comments.append(
{"path": report[0], "position": report[1], "body": report[2]})

review = {
"body": "Reports by clang tidy",
"event": "COMMENT",
"comments": comments,
}

pr_handle.create_review(**review)
print("Review comments are on its way!")


def main(pathToClangReport, repository, pr, token):
"""
Psudo-Main function, that calls all above functions in order.
"""
f = open(pathToClangReport)
lines = f.read().splitlines()
f.close()

reports = parse_report_file(lines)
diff = fetch_diff(repository, pr, token)
# Filter the report, So that only changed files are commented
reports = file_filter_report(reports, diff)
# Fileter the reports, So that only changed lines are commented
reports = line_filter_report(reports, diff)

github = Github(token)
repo = github.get_repo(f"{repository}")
pr_handle = repo.get_pull(pr)

if len(reports) == 0:
comment_lgtm(pr_handle)
else:
post_review(line_to_position(reports, diff), pr_handle)


if __name__ == "__main__":
"""
Parses command line arguments for the script and calls main function with the script.
"""
parser = argparse.ArgumentParser(
description="Create review from clang tidy file")
parser.add_argument(
"--path", help="Path to clang-tidy report file. This file can be"
"generated by redirecting stdout of clang-tidy to a file while running the check", required=True)
parser.add_argument(
"--repository", help="Pass repositor on Github with owner/repo format", required=True)
parser.add_argument(
"--pr", help="The repository's PR number to perform review", type=int, required=True)
parser.add_argument(
"--token", help="Github authentication token", required=True)

args = parser.parse_args()

main(args.path, args.repository, args.pr, args.token)
10 changes: 10 additions & 0 deletions .ci/report_coverage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#! /bin/bash -e

sudo apt-get install lcov
lcov --directory $BOOST_ROOT --capture --output-file coverage.info

# Remove all unwanted coverages libs.
# Boost.uBLAS depends uses many internal boost libs, we don't want them to be in coverage.

lcov --extract coverage.info "*/boost/numeric/ublas/tensor/*" "*/libs/numeric/ublas/tensor/*" --output-file coverage.info
lcov --list coverage.info
Loading
Loading