Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
57,468 changes: 57,468 additions & 0 deletions .basedpyright/baseline.json

Large diffs are not rendered by default.

34 changes: 8 additions & 26 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ on:
schedule:
- cron: '17 3 * * 0'

concurrency:
group: ${{ github.head_ref || github.ref_name }}
cancel-in-progress: true

jobs:
ruff:
name: Ruff
Expand All @@ -30,30 +34,7 @@ jobs:
- uses: actions/checkout@v4
- uses: crate-ci/typos@master

pylint:
name: Pylint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: "Main Script"
run: |
CONDA_ENVIRONMENT=.test-conda-env-py3.yml
echo "- matplotlib" >> $CONDA_ENVIRONMENT
echo "- pyopengl" >> $CONDA_ENVIRONMENT
echo "- ipython" >> $CONDA_ENVIRONMENT

curl -L -O https://tiker.net/ci-support-v0
. ci-support-v0
build_py_project_in_conda_env

# Avoid linting local directory, where native module
# cannot be imported.
rm -Rf "$(get_proj_name)"

run_pylint "$(get_proj_name)" test/*.py

mypy:
name: Mypy
basedpyright:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -64,8 +45,8 @@ jobs:
export CL_USE_SHIPPED_EXT=on
build_py_project_in_conda_env

python -m pip install mypy importlib-resources
./run-mypy.sh
python -m pip install basedpyright pytest
basedpyright

pytest:
name: Pytest Linux POCL
Expand Down Expand Up @@ -172,6 +153,7 @@ jobs:
strategy:
matrix:
downstream_project: [loopy, boxtree, meshmode]
fail-fast: false
name: Tests for downstream project ${{ matrix.downstream_project }}
runs-on: ubuntu-latest
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
run: |
set -x
if [[ ${{ matrix.os }} == windows-* ]]; then
export CL_INC_DIR="D:/a/pyopencl/pyopencl/OpenCL-Headers/install/include"
export CL_INC_DIR="C:/a/pyopencl/pyopencl/OpenCL-Headers/install/include"
export CL_LIB_DIR="C:/Program Files/OpenCL-ICD-Loader/lib"
fi
python -m cibuildwheel --output-dir wheelhouse
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,5 @@ memray-*.html

.pylintrc.yml
.run-pylint.py

pyopencl/_cl_gen.pyi
32 changes: 0 additions & 32 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,38 +122,6 @@ Ruff:
except:
- tags

Pylint:
script: |
export EXTRA_INSTALL="numpy mako matplotlib PyOpenGl IPython"

curl -L -O https://tiker.net/ci-support-v0
. ci-support-v0

build_py_project_in_venv

# Avoid linting local directory, where native module
# cannot be imported.
rm -Rf "$(get_proj_name)"

run_pylint "$(get_proj_name)" test/*.py
tags:
- python3
except:
- tags

Mypy:
script: |
export EXTRA_INSTALL="numpy mako mypy importlib-resources"

curl -L -O https://tiker.net/ci-support-v0
. ci-support-v0
build_py_project_in_venv
python -m mypy --show-error-codes pyopencl test
tags:
- python3
except:
- tags

Documentation:
script: |
export EXTRA_INSTALL="numpy mako"
Expand Down
7 changes: 0 additions & 7 deletions .pylintrc-local.yml

This file was deleted.

8 changes: 4 additions & 4 deletions contrib/fortran-to-opencl/translate.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

import re
from sys import intern
from typing import ClassVar, Dict, List, Tuple
from typing import ClassVar
from warnings import warn

import numpy as np
Expand Down Expand Up @@ -134,7 +134,7 @@ def simplify_typed_literal(expr):
class FortranExpressionParser(ExpressionParserBase):
# FIXME double/single prec literals

lex_table: ClassVar[List[Tuple[str, str]]] = [
lex_table: ClassVar[list[tuple[str, str]]] = [
(_less_than, pytools.lex.RE(r"\.lt\.", re.I)),
(_greater_than, pytools.lex.RE(r"\.gt\.", re.I)),
(_less_equal, pytools.lex.RE(r"\.le\.", re.I)),
Expand Down Expand Up @@ -211,7 +211,7 @@ def parse_terminal(self, pstate):
return ExpressionParserBase.parse_terminal(
self, pstate)

COMP_MAP: ClassVar[Dict[str, str]] = {
COMP_MAP: ClassVar[dict[str, str]] = {
_less_than: "<",
_less_equal: "<=",
_greater_than: ">",
Expand Down Expand Up @@ -1079,7 +1079,7 @@ def map_Implicit(self, node):
def map_Equivalence(self, node):
raise NotImplementedError("equivalence")

TYPE_MAP: ClassVar[Dict[Tuple[str, str], np.generic]] = {
TYPE_MAP: ClassVar[dict[tuple[str, str], np.generic]] = {
("real", "4"): np.float32,
("real", "8"): np.float64,
("real", "16"): np.float128,
Expand Down
3 changes: 3 additions & 0 deletions doc/misc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,9 @@ while building. You can also specify the paths to the OpenCL headers and librari
# Option 2: specify the paths via arguments to pip install:
$ pip install -v . --config-settings='cmake.args=-DCL_INC_DIR=/path/to/OpenCL/include;-DCL_LIB_DIR=/path/to/OpenCL/lib'

When building from source, to enable GL interop, set the environment variable
``PYOPENCL_ENABLE_GL`` to ``ON``.

Tips
====

Expand Down
38 changes: 38 additions & 0 deletions doc/runtime.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,41 @@ Error Reporting

.. class:: RuntimeError

References
----------

.. class:: WaitList

A :class:`Sequence` of :class:`Event`\ s, or None.

.. class:: NDArray

See :data:`numpy.typing.NDArray`.

.. class:: DTypeLike

See :data:`numpy.typing.DTypeLike`.

.. class:: SVMInnerT

A type variable for the object wrapped by an :class:`SVM`.

.. class:: RetT

A generic type variable, used for a return type.

.. class:: P

A :class:`~typing.ParamSpec`.

.. currentmodule:: pyopencl.typing

.. class:: DTypeT

A type variable for a :class:`numpy.dtype`.

.. currentmodule:: pyopencl._cl

.. class:: svm_mem_flags

See :class:`pyopencl.svm_mem_flags`.
2 changes: 1 addition & 1 deletion doc/runtime_memory.rst
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ Operations on SVM
(See also :ref:`mem-transfer`.)

.. autofunction:: enqueue_svm_memfill
.. autofunction:: enqueue_svm_migratemem
.. autofunction:: enqueue_svm_migrate_mem

Image
-----
Expand Down
Loading
Loading