Skip to content

Commit 6e482f9

Browse files
committed
Merge branch 'master' into merge_to_gold
2 parents e9eed4d + f2a4abc commit 6e482f9

File tree

253 files changed

+24439
-19052
lines changed

Some content is hidden

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

253 files changed

+24439
-19052
lines changed

.clang-format

Lines changed: 17 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,42 @@
11
BasedOnStyle: LLVM
2-
IndentWidth: 4
3-
UseTab: Never
4-
Language: Cpp
5-
Standard: Cpp11
62

73
AccessModifierOffset: -4
84

9-
AlignConsecutiveDeclarations: false
10-
AlignConsecutiveAssignments: false
115
AlignConsecutiveMacros: true
12-
AlignTrailingComments: true
6+
AlignConsecutiveBitFields: true
137
AlignEscapedNewlines: Right
148

15-
AllowShortBlocksOnASingleLine: false
16-
AllowShortCaseLabelsOnASingleLine: false
17-
AllowShortFunctionsOnASingleLine: false
18-
AllowShortIfStatementsOnASingleLine: false
19-
AllowShortLoopsOnASingleLine: false
9+
AllowAllParametersOfDeclarationOnNextLine: false
10+
AllowShortBlocksOnASingleLine: Empty
2011

21-
AlwaysBreakBeforeMultilineStrings: true
22-
AlwaysBreakTemplateDeclarations: true
12+
AlwaysBreakTemplateDeclarations: Yes
2313

24-
BinPackArguments: false
2514
BinPackParameters: false
2615

27-
BreakBeforeBraces: Allman
28-
BreakConstructorInitializersBeforeComma: true
29-
3016
BraceWrapping:
17+
AfterCaseLabel: true
3118
AfterClass: true
32-
AfterControlStatement: true
19+
AfterControlStatement: MultiLine
3320
AfterEnum: true
3421
AfterFunction: true
3522
AfterNamespace: true
36-
AfterObjCDeclaration: true
23+
AfterObjCDeclaration: false
3724
AfterStruct: true
3825
AfterUnion: true
39-
BeforeCatch: true
26+
AfterExternBlock: true
27+
BeforeCatch: false
4028
BeforeElse: true
29+
BeforeLambdaBody: false
30+
BeforeWhile: false
4131
IndentBraces: false
32+
SplitEmptyFunction: true
33+
SplitEmptyRecord: true
34+
SplitEmptyNamespace: true
4235
BreakBeforeBraces: Custom
4336

44-
ColumnLimit: 120
45-
CommentPragmas: '.*'
37+
ColumnLimit: 80
4638

47-
IndentCaseLabels: false
39+
IndentWidth: 4
4840
IndentWrappedFunctionNames: true
4941

50-
KeepEmptyLinesAtTheStartOfBlocks: false
51-
NamespaceIndentation: All
52-
53-
PointerAlignment: Left
54-
SpaceAfterCStyleCast: false
55-
SpaceBeforeAssignmentOperators: true
56-
SpaceBeforeParens: ControlStatements
57-
SpaceInEmptyParentheses: false
58-
SpacesInAngles: false
59-
SpacesInCStyleCastParentheses: false
60-
SpacesInParentheses: false
61-
SpacesInSquareBrackets: false
62-
63-
SortIncludes: false
64-
ReflowComments: true
65-
66-
IncludeCategories:
67-
- Regex: '^".*'
68-
Priority: 3
69-
- Regex: '^<.*'
70-
Priority: 2
71-
SortIncludes: true
42+
Standard: c++17

.flake8

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
[flake8]
2+
extend-ignore =
3+
# whitespace before ':' (currently conflicts with black formatting):
4+
E203,
5+
# line too long (in docstrings):
6+
E501,
7+
# ‘from module import *’ used; unable to detect undefined names:
8+
F403,
9+
# name may be undefined, or defined from star imports: module:
10+
F405,
11+
# doc line too long (105 > 80 characters):
12+
W505,
13+
# missing docstring in public module:
14+
D100,
15+
# missing docstring in public class:
16+
D101,
17+
# missing docstring in public method:
18+
D102,
19+
# missing docstring in public function:
20+
D103,
21+
# missing docstring in public package:
22+
D104,
23+
# missing docstring in magic method:
24+
D105,
25+
# missing docstring in __init__:
26+
D107,
27+
# no blank lines allowed after function docstring:
28+
D202,
29+
# first line should end with a period:
30+
D400,
31+
# first line should be in imperative mood:
32+
D401,
33+
# first line should not be the function's "signature":
34+
D402,
35+
# section has no content:
36+
D414
37+
38+
per-file-ignores =
39+
__init__.py: E402, F401
40+
dpnp/dpnp_algo/__init__.py: F401
41+
dpnp/dpnp_algo/__init__.py: F401
42+
dpnp/fft/__init__.py: F401
43+
dpnp/linalg/__init__.py: F401
44+
dpnp/random/__init__.py: F401
45+
dpnp/dpnp_iface.py: D205
46+
47+
filename = *.py, *.pyx, *.pxi, *.pxd
48+
max_line_length = 80
49+
max-doc-length = 80
50+
show-source = True
51+
52+
exclude =
53+
.git,
54+
benchmarks/*.py,
55+
build,
56+
dpnp/to_numba/*.py,
57+
conda.recipe,
58+
tests/*.py,
59+
tests_external/*.py,
60+
version.py,
61+
62+
# Print detailed statistic if any issue detected
63+
count = True
64+
statistics = True

.git-blame-ignore-revs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# $ git config blame.ignoreRevsFile .git-blame-ignore-revs
2+
3+
# Add pre-commit hooks
4+
b0cd5f85c9b0c2705359fee3a3f4f3feda53bfa0
5+
6+
# Add black to pre-commit config
7+
88981b5ae1c99f9b64758db44dfb39f2c20b10db
8+
9+
# Add clang-format to pre-commit config
10+
ae755b57a9aeeb09435594aa7f6a04bf4cdc55fa
11+
12+
# Add isort to pre-commit config
13+
3f202cf778cc47698310f2d040e5f83bdf2a90da
14+
15+
# Add flake8 to pre-commit config
16+
c106d91b866f4acd30226b68519b12a73a881490
17+
18+
# Add pygrep-hooks to pre-commit config
19+
e62718415aa3660da5f607e352c991a063a54219

.github/workflows/build-sphinx.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ jobs:
2525
with:
2626
access_token: ${{ github.token }}
2727

28+
- name: Free Disk Space (Ubuntu)
29+
uses: jlumbroso/free-disk-space@main
30+
2831
- name: Install Intel repository
2932
run: |
3033
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB

.github/workflows/pre-commit.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,15 @@ jobs:
99
pre-commit:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/[email protected]
13-
- uses: actions/[email protected]
14-
with:
15-
python-version: '3.10'
16-
- uses: pre-commit/[email protected]
12+
- name: Set up clang-format
13+
run: |
14+
sudo apt-get install -y clang-format-12
15+
sudo unlink /usr/bin/clang-format
16+
sudo ln -s /usr/bin/clang-format-12 /usr/bin/clang-format
17+
clang-format --version
18+
19+
- uses: actions/[email protected]
20+
- uses: actions/[email protected]
21+
with:
22+
python-version: '3.10'
23+
- uses: pre-commit/[email protected]

.pre-commit-config.yaml

Lines changed: 65 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,72 @@
22
# See https://pre-commit.com/hooks.html for more hooks
33
repos:
44
- repo: https://github.com/PyCQA/bandit
5-
rev: '1.7.0'
5+
rev: '1.7.5'
66
hooks:
77
- id: bandit
88
pass_filenames: false
99
args: ["-r", "dpnp", "-lll"]
10+
- repo: https://github.com/pre-commit/pre-commit-hooks
11+
rev: v4.4.0
12+
hooks:
13+
- id: check-ast
14+
- id: check-builtin-literals
15+
- id: check-case-conflict
16+
- id: check-executables-have-shebangs
17+
- id: check-merge-conflict
18+
- id: check-shebang-scripts-are-executable
19+
- id: check-toml
20+
- id: debug-statements
21+
- id: destroyed-symlinks
22+
- id: end-of-file-fixer
23+
- id: fix-byte-order-marker
24+
- id: mixed-line-ending
25+
- id: trailing-whitespace
26+
- repo: https://github.com/pre-commit/pygrep-hooks
27+
rev: v1.10.0
28+
hooks:
29+
- id: python-check-blanket-noqa
30+
- id: python-check-blanket-type-ignore
31+
- id: python-check-mock-methods
32+
- id: python-no-eval
33+
exclude: |
34+
(?x)^(
35+
tests/test_arraycreation.py|
36+
tests/test_sycl_queue.py|
37+
tests/test_usm_type.py
38+
)$
39+
- id: python-no-log-warn
40+
- id: python-use-type-annotations
41+
- id: rst-backticks
42+
- id: rst-directive-colons
43+
- id: rst-inline-touching-normal
44+
- id: text-unicode-replacement-char
45+
- repo: https://github.com/psf/black
46+
rev: 23.3.0
47+
hooks:
48+
- id: black
49+
args: ["--check", "--diff", "--color"]
50+
- repo: https://github.com/pycqa/isort
51+
rev: 5.12.0
52+
hooks:
53+
- id: isort
54+
name: isort (python)
55+
- id: isort
56+
name: isort (cython)
57+
types: [cython]
58+
- id: isort
59+
name: isort (pyi)
60+
types: [pyi]
61+
- repo: https://github.com/pycqa/flake8
62+
rev: 6.0.0
63+
hooks:
64+
- id: flake8
65+
args: ["--config=.flake8"]
66+
additional_dependencies:
67+
- flake8-docstrings==1.7.0
68+
- flake8-bugbear==23.6.5
69+
- repo: https://github.com/pocc/pre-commit-hooks
70+
rev: v1.3.5
71+
hooks:
72+
- id: clang-format
73+
args: ["-i"]

LICENSE.txt

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1-
Copyright (c) 2016-2020, Intel Corporation
1+
Copyright (c) 2016-2023, Intel Corporation
22
All rights reserved.
33

4-
Redistribution and use in source and binary forms, with or without
4+
Redistribution and use in source and binary forms, with or without
55
modification, are permitted provided that the following conditions are met:
6-
- Redistributions of source code must retain the above copyright notice,
6+
- Redistributions of source code must retain the above copyright notice,
77
this list of conditions and the following disclaimer.
8-
- Redistributions in binary form must reproduce the above copyright notice,
9-
this list of conditions and the following disclaimer in the documentation
8+
- Redistributions in binary form must reproduce the above copyright notice,
9+
this list of conditions and the following disclaimer in the documentation
1010
and/or other materials provided with the distribution.
1111

1212
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
1313
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1414
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
15-
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
16-
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
17-
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
18-
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
15+
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
16+
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
17+
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
18+
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
1919
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
20-
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
21-
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
20+
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
21+
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
2222
THE POSSIBILITY OF SUCH DAMAGE.

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
2+
[![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336)](https://pycqa.github.io/isort/)
13
[![Pre-commit](https://github.com/IntelPython/dpnp/actions/workflows/pre-commit.yml/badge.svg?branch=master&event=push)](https://github.com/IntelPython/dpnp/actions/workflows/pre-commit.yml)
24
[![Conda package](https://github.com/IntelPython/dpnp/actions/workflows/conda-package.yml/badge.svg?branch=master&event=push)](https://github.com/IntelPython/dpnp/actions/workflows/conda-package.yml)
35
[![Coverage Status](https://coveralls.io/repos/github/IntelPython/dpnp/badge.svg?branch=master)](https://coveralls.io/github/IntelPython/dpnp?branch=master)

benchmarks/benchmarks/bench_elementwise.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import numpy
2+
23
import dpnp
4+
35
from .common import Benchmark
46

57

@@ -8,12 +10,13 @@
810
# but looks like first execution has additional overheads
911
# (need to be investigated)
1012
class Elementwise(Benchmark):
11-
executors = {'dpnp': dpnp, 'numpy': numpy}
12-
params = [['dpnp', 'numpy'],
13-
[2**16, 2**20, 2**24],
14-
['float64', 'float32', 'int64', 'int32']
15-
]
16-
param_names = ['executor', 'size', 'dtype']
13+
executors = {"dpnp": dpnp, "numpy": numpy}
14+
params = [
15+
["dpnp", "numpy"],
16+
[2**16, 2**20, 2**24],
17+
["float64", "float32", "int64", "int32"],
18+
]
19+
param_names = ["executor", "size", "dtype"]
1720

1821
def setup(self, executor, size, dtype):
1922
self.np = self.executors[executor]

0 commit comments

Comments
 (0)