xobjects 0.7.1__tar.gz → 0.7.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {xobjects-0.7.1/xobjects.egg-info → xobjects-0.7.2}/PKG-INFO +2 -1
- {xobjects-0.7.1 → xobjects-0.7.2}/pyproject.toml +1 -0
- {xobjects-0.7.1 → xobjects-0.7.2}/setup.py +1 -1
- {xobjects-0.7.1 → xobjects-0.7.2}/tests/test_kernel.py +10 -1
- xobjects-0.7.2/xobjects/_version.py +1 -0
- {xobjects-0.7.1 → xobjects-0.7.2}/xobjects/context_cpu.py +2 -0
- {xobjects-0.7.1 → xobjects-0.7.2/xobjects.egg-info}/PKG-INFO +2 -1
- {xobjects-0.7.1 → xobjects-0.7.2}/xobjects.egg-info/requires.txt +1 -0
- xobjects-0.7.1/xobjects/_version.py +0 -1
- {xobjects-0.7.1 → xobjects-0.7.2}/Architecture.md +0 -0
- {xobjects-0.7.1 → xobjects-0.7.2}/LICENSE +0 -0
- {xobjects-0.7.1 → xobjects-0.7.2}/MANIFEST.in +0 -0
- {xobjects-0.7.1 → xobjects-0.7.2}/README.md +0 -0
- {xobjects-0.7.1 → xobjects-0.7.2}/setup.cfg +0 -0
- {xobjects-0.7.1 → xobjects-0.7.2}/tests/test_align.py +0 -0
- {xobjects-0.7.1 → xobjects-0.7.2}/tests/test_array.py +0 -0
- {xobjects-0.7.1 → xobjects-0.7.2}/tests/test_buffer.py +0 -0
- {xobjects-0.7.1 → xobjects-0.7.2}/tests/test_capi.py +0 -0
- {xobjects-0.7.1 → xobjects-0.7.2}/tests/test_chunk.py +0 -0
- {xobjects-0.7.1 → xobjects-0.7.2}/tests/test_common.py +0 -0
- {xobjects-0.7.1 → xobjects-0.7.2}/tests/test_context_opencl.py +0 -0
- {xobjects-0.7.1 → xobjects-0.7.2}/tests/test_general.py +0 -0
- {xobjects-0.7.1 → xobjects-0.7.2}/tests/test_hybrid_class.py +0 -0
- {xobjects-0.7.1 → xobjects-0.7.2}/tests/test_linked_array.py +0 -0
- {xobjects-0.7.1 → xobjects-0.7.2}/tests/test_nplike_arrays.py +0 -0
- {xobjects-0.7.1 → xobjects-0.7.2}/tests/test_raw_union.py +0 -0
- {xobjects-0.7.1 → xobjects-0.7.2}/tests/test_ref.py +0 -0
- {xobjects-0.7.1 → xobjects-0.7.2}/tests/test_scalars.py +0 -0
- {xobjects-0.7.1 → xobjects-0.7.2}/tests/test_shared_memory.py +0 -0
- {xobjects-0.7.1 → xobjects-0.7.2}/tests/test_strides.py +0 -0
- {xobjects-0.7.1 → xobjects-0.7.2}/tests/test_string.py +0 -0
- {xobjects-0.7.1 → xobjects-0.7.2}/tests/test_struct.py +0 -0
- {xobjects-0.7.1 → xobjects-0.7.2}/tests/test_to_dict.py +0 -0
- {xobjects-0.7.1 → xobjects-0.7.2}/tests/test_typeutils.py +0 -0
- {xobjects-0.7.1 → xobjects-0.7.2}/tests/test_unionref.py +0 -0
- {xobjects-0.7.1 → xobjects-0.7.2}/xobjects/__init__.py +0 -0
- {xobjects-0.7.1 → xobjects-0.7.2}/xobjects/_patch_pyopencl_array.py +0 -0
- {xobjects-0.7.1 → xobjects-0.7.2}/xobjects/array.py +0 -0
- {xobjects-0.7.1 → xobjects-0.7.2}/xobjects/capi.py +0 -0
- {xobjects-0.7.1 → xobjects-0.7.2}/xobjects/context.py +0 -0
- {xobjects-0.7.1 → xobjects-0.7.2}/xobjects/context_cupy.py +0 -0
- {xobjects-0.7.1 → xobjects-0.7.2}/xobjects/context_pyopencl.py +0 -0
- {xobjects-0.7.1 → xobjects-0.7.2}/xobjects/general.py +0 -0
- {xobjects-0.7.1 → xobjects-0.7.2}/xobjects/headers/atomicadd.h +0 -0
- {xobjects-0.7.1 → xobjects-0.7.2}/xobjects/headers/common.h +0 -0
- {xobjects-0.7.1 → xobjects-0.7.2}/xobjects/hybrid_class.py +0 -0
- {xobjects-0.7.1 → xobjects-0.7.2}/xobjects/linkedarray.py +0 -0
- {xobjects-0.7.1 → xobjects-0.7.2}/xobjects/raw_union.py +0 -0
- {xobjects-0.7.1 → xobjects-0.7.2}/xobjects/ref.py +0 -0
- {xobjects-0.7.1 → xobjects-0.7.2}/xobjects/scalar.py +0 -0
- {xobjects-0.7.1 → xobjects-0.7.2}/xobjects/settings.py +0 -0
- {xobjects-0.7.1 → xobjects-0.7.2}/xobjects/specialize_source.py +0 -0
- {xobjects-0.7.1 → xobjects-0.7.2}/xobjects/string.py +0 -0
- {xobjects-0.7.1 → xobjects-0.7.2}/xobjects/struct.py +0 -0
- {xobjects-0.7.1 → xobjects-0.7.2}/xobjects/test_helpers.py +0 -0
- {xobjects-0.7.1 → xobjects-0.7.2}/xobjects/typeutils.py +0 -0
- {xobjects-0.7.1 → xobjects-0.7.2}/xobjects/union.py +0 -0
- {xobjects-0.7.1 → xobjects-0.7.2}/xobjects.egg-info/SOURCES.txt +0 -0
- {xobjects-0.7.1 → xobjects-0.7.2}/xobjects.egg-info/dependency_links.txt +0 -0
- {xobjects-0.7.1 → xobjects-0.7.2}/xobjects.egg-info/entry_points.txt +0 -0
- {xobjects-0.7.1 → xobjects-0.7.2}/xobjects.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: xobjects
|
|
3
|
-
Version: 0.7.
|
|
3
|
+
Version: 0.7.2
|
|
4
4
|
Summary: In-memory serialization and code generator for CPU and GPU
|
|
5
5
|
Home-page: https://xsuite.readthedocs.io/
|
|
6
6
|
Download-URL: https://pypi.python.org/pypi/xobjects
|
|
@@ -17,6 +17,7 @@ Description-Content-Type: text/markdown
|
|
|
17
17
|
License-File: LICENSE
|
|
18
18
|
Requires-Dist: numpy
|
|
19
19
|
Requires-Dist: cffi
|
|
20
|
+
Requires-Dist: setuptools
|
|
20
21
|
Requires-Dist: scipy
|
|
21
22
|
Provides-Extra: tests
|
|
22
23
|
Requires-Dist: pytest; extra == "tests"
|
|
@@ -23,7 +23,7 @@ setup(
|
|
|
23
23
|
url="https://xsuite.readthedocs.io/",
|
|
24
24
|
python_requires=">=3.7",
|
|
25
25
|
setup_requires=[],
|
|
26
|
-
install_requires=["numpy", "cffi", "scipy"],
|
|
26
|
+
install_requires=["numpy", "cffi", "setuptools", "scipy"],
|
|
27
27
|
packages=["xobjects"],
|
|
28
28
|
license="Apache 2.0",
|
|
29
29
|
download_url="https://pypi.python.org/pypi/xobjects",
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
# ########################################### #
|
|
5
5
|
|
|
6
6
|
import cffi
|
|
7
|
+
import pickle
|
|
7
8
|
import pytest
|
|
8
9
|
import sysconfig
|
|
9
10
|
from pathlib import Path
|
|
@@ -14,7 +15,8 @@ import xobjects as xo
|
|
|
14
15
|
from xobjects.test_helpers import for_all_test_contexts, requires_context
|
|
15
16
|
|
|
16
17
|
|
|
17
|
-
|
|
18
|
+
@pytest.mark.parametrize('pickle_context', [False, True])
|
|
19
|
+
def test_kernel_cpu(pickle_context):
|
|
18
20
|
ctx = xo.ContextCpu()
|
|
19
21
|
src_code = r"""
|
|
20
22
|
double my_mul(const int n, const double* x1,
|
|
@@ -45,6 +47,13 @@ double my_mul(const int n, const double* x1,
|
|
|
45
47
|
|
|
46
48
|
assert y == 285.0
|
|
47
49
|
|
|
50
|
+
if pickle_context:
|
|
51
|
+
restored = pickle.loads(pickle.dumps(ctx))
|
|
52
|
+
assert not restored.kernels
|
|
53
|
+
assert ctx.kernels.my_mul(n=len(a1), x1=a1, x2=a2) == 285.0
|
|
54
|
+
restored.add_kernels(sources=[src_code], kernels=kernel_descriptions)
|
|
55
|
+
assert restored.kernels.my_mul(n=len(a1), x1=a1, x2=a2) == 285.0
|
|
56
|
+
|
|
48
57
|
|
|
49
58
|
@for_all_test_contexts
|
|
50
59
|
def test_kernel_pointer_none_maps_to_null(test_context):
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.7.2"
|
|
@@ -96,6 +96,7 @@ def kernel_compilation_help_message():
|
|
|
96
96
|
|
|
97
97
|
from .context import (
|
|
98
98
|
Kernel,
|
|
99
|
+
KernelDict,
|
|
99
100
|
ModuleNotAvailable,
|
|
100
101
|
SourceType,
|
|
101
102
|
XBuffer,
|
|
@@ -821,6 +822,7 @@ class ContextCpu(XContext):
|
|
|
821
822
|
|
|
822
823
|
def __setstate__(self, state):
|
|
823
824
|
self.__dict__.update(state)
|
|
825
|
+
self._kernels = KernelDict(self._kernels)
|
|
824
826
|
self._buffers = weakref.WeakSet()
|
|
825
827
|
|
|
826
828
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: xobjects
|
|
3
|
-
Version: 0.7.
|
|
3
|
+
Version: 0.7.2
|
|
4
4
|
Summary: In-memory serialization and code generator for CPU and GPU
|
|
5
5
|
Home-page: https://xsuite.readthedocs.io/
|
|
6
6
|
Download-URL: https://pypi.python.org/pypi/xobjects
|
|
@@ -17,6 +17,7 @@ Description-Content-Type: text/markdown
|
|
|
17
17
|
License-File: LICENSE
|
|
18
18
|
Requires-Dist: numpy
|
|
19
19
|
Requires-Dist: cffi
|
|
20
|
+
Requires-Dist: setuptools
|
|
20
21
|
Requires-Dist: scipy
|
|
21
22
|
Provides-Extra: tests
|
|
22
23
|
Requires-Dist: pytest; extra == "tests"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.7.1"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|