xobjects 0.6.3__tar.gz → 0.6.4__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.6.3/xobjects.egg-info → xobjects-0.6.4}/PKG-INFO +1 -1
- {xobjects-0.6.3 → xobjects-0.6.4}/tests/test_kernel.py +2 -0
- xobjects-0.6.4/xobjects/_version.py +1 -0
- {xobjects-0.6.3 → xobjects-0.6.4}/xobjects/context_cpu.py +17 -10
- {xobjects-0.6.3 → xobjects-0.6.4}/xobjects/struct.py +1 -1
- {xobjects-0.6.3 → xobjects-0.6.4/xobjects.egg-info}/PKG-INFO +1 -1
- xobjects-0.6.3/xobjects/_version.py +0 -1
- {xobjects-0.6.3 → xobjects-0.6.4}/Architecture.md +0 -0
- {xobjects-0.6.3 → xobjects-0.6.4}/LICENSE +0 -0
- {xobjects-0.6.3 → xobjects-0.6.4}/MANIFEST.in +0 -0
- {xobjects-0.6.3 → xobjects-0.6.4}/README.md +0 -0
- {xobjects-0.6.3 → xobjects-0.6.4}/pyproject.toml +0 -0
- {xobjects-0.6.3 → xobjects-0.6.4}/setup.cfg +0 -0
- {xobjects-0.6.3 → xobjects-0.6.4}/setup.py +0 -0
- {xobjects-0.6.3 → xobjects-0.6.4}/tests/test_align.py +0 -0
- {xobjects-0.6.3 → xobjects-0.6.4}/tests/test_array.py +0 -0
- {xobjects-0.6.3 → xobjects-0.6.4}/tests/test_buffer.py +0 -0
- {xobjects-0.6.3 → xobjects-0.6.4}/tests/test_capi.py +0 -0
- {xobjects-0.6.3 → xobjects-0.6.4}/tests/test_chunk.py +0 -0
- {xobjects-0.6.3 → xobjects-0.6.4}/tests/test_common.py +0 -0
- {xobjects-0.6.3 → xobjects-0.6.4}/tests/test_context_opencl.py +0 -0
- {xobjects-0.6.3 → xobjects-0.6.4}/tests/test_hybrid_class.py +0 -0
- {xobjects-0.6.3 → xobjects-0.6.4}/tests/test_linked_array.py +0 -0
- {xobjects-0.6.3 → xobjects-0.6.4}/tests/test_nplike_arrays.py +0 -0
- {xobjects-0.6.3 → xobjects-0.6.4}/tests/test_ref.py +0 -0
- {xobjects-0.6.3 → xobjects-0.6.4}/tests/test_scalars.py +0 -0
- {xobjects-0.6.3 → xobjects-0.6.4}/tests/test_shared_memory.py +0 -0
- {xobjects-0.6.3 → xobjects-0.6.4}/tests/test_strides.py +0 -0
- {xobjects-0.6.3 → xobjects-0.6.4}/tests/test_string.py +0 -0
- {xobjects-0.6.3 → xobjects-0.6.4}/tests/test_struct.py +0 -0
- {xobjects-0.6.3 → xobjects-0.6.4}/tests/test_to_dict.py +0 -0
- {xobjects-0.6.3 → xobjects-0.6.4}/tests/test_typeutils.py +0 -0
- {xobjects-0.6.3 → xobjects-0.6.4}/tests/test_unionref.py +0 -0
- {xobjects-0.6.3 → xobjects-0.6.4}/xobjects/__init__.py +0 -0
- {xobjects-0.6.3 → xobjects-0.6.4}/xobjects/_patch_pyopencl_array.py +0 -0
- {xobjects-0.6.3 → xobjects-0.6.4}/xobjects/array.py +0 -0
- {xobjects-0.6.3 → xobjects-0.6.4}/xobjects/capi.py +0 -0
- {xobjects-0.6.3 → xobjects-0.6.4}/xobjects/context.py +0 -0
- {xobjects-0.6.3 → xobjects-0.6.4}/xobjects/context_cupy.py +0 -0
- {xobjects-0.6.3 → xobjects-0.6.4}/xobjects/context_pyopencl.py +0 -0
- {xobjects-0.6.3 → xobjects-0.6.4}/xobjects/general.py +0 -0
- {xobjects-0.6.3 → xobjects-0.6.4}/xobjects/headers/atomicadd.h +0 -0
- {xobjects-0.6.3 → xobjects-0.6.4}/xobjects/headers/common.h +0 -0
- {xobjects-0.6.3 → xobjects-0.6.4}/xobjects/hybrid_class.py +0 -0
- {xobjects-0.6.3 → xobjects-0.6.4}/xobjects/linkedarray.py +0 -0
- {xobjects-0.6.3 → xobjects-0.6.4}/xobjects/ref.py +0 -0
- {xobjects-0.6.3 → xobjects-0.6.4}/xobjects/scalar.py +0 -0
- {xobjects-0.6.3 → xobjects-0.6.4}/xobjects/specialize_source.py +0 -0
- {xobjects-0.6.3 → xobjects-0.6.4}/xobjects/string.py +0 -0
- {xobjects-0.6.3 → xobjects-0.6.4}/xobjects/test_helpers.py +0 -0
- {xobjects-0.6.3 → xobjects-0.6.4}/xobjects/typeutils.py +0 -0
- {xobjects-0.6.3 → xobjects-0.6.4}/xobjects/union.py +0 -0
- {xobjects-0.6.3 → xobjects-0.6.4}/xobjects.egg-info/SOURCES.txt +0 -0
- {xobjects-0.6.3 → xobjects-0.6.4}/xobjects.egg-info/dependency_links.txt +0 -0
- {xobjects-0.6.3 → xobjects-0.6.4}/xobjects.egg-info/entry_points.txt +0 -0
- {xobjects-0.6.3 → xobjects-0.6.4}/xobjects.egg-info/requires.txt +0 -0
- {xobjects-0.6.3 → xobjects-0.6.4}/xobjects.egg-info/top_level.txt +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.6.4"
|
|
@@ -150,8 +150,7 @@ class ContextCpu(XContext):
|
|
|
150
150
|
"""
|
|
151
151
|
super().__init__()
|
|
152
152
|
self.omp_num_threads = omp_num_threads
|
|
153
|
-
|
|
154
|
-
self.allow_prebuilt_kernels = True
|
|
153
|
+
self.allow_prebuilt_kernels = True
|
|
155
154
|
|
|
156
155
|
def __str__(self):
|
|
157
156
|
if not self.openmp_enabled:
|
|
@@ -415,8 +414,18 @@ class ContextCpu(XContext):
|
|
|
415
414
|
log.debug(f"cffi def {pyname} {signature}")
|
|
416
415
|
|
|
417
416
|
if self.openmp_enabled:
|
|
418
|
-
|
|
419
|
-
ffi_interface.cdef("
|
|
417
|
+
# The wrapper is needed to ensure that the omp functions are linked
|
|
418
|
+
ffi_interface.cdef("void xo_omp_set_num_threads(int);")
|
|
419
|
+
ffi_interface.cdef("int xo_omp_get_max_threads();")
|
|
420
|
+
specialized_source += """
|
|
421
|
+
void xo_omp_set_num_threads(int num_threads) {
|
|
422
|
+
omp_set_num_threads(num_threads);
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
int xo_omp_get_max_threads(void) {
|
|
426
|
+
return omp_get_max_threads();
|
|
427
|
+
}
|
|
428
|
+
"""
|
|
420
429
|
|
|
421
430
|
# Compile
|
|
422
431
|
xtr_compile_args = ["-std=c99", "-DXO_CONTEXT_CPU"]
|
|
@@ -528,8 +537,8 @@ class ContextCpu(XContext):
|
|
|
528
537
|
spec.loader.exec_module(module)
|
|
529
538
|
|
|
530
539
|
if self.openmp_enabled:
|
|
531
|
-
self.omp_set_num_threads = module.lib.
|
|
532
|
-
self.omp_get_max_threads = module.lib.
|
|
540
|
+
self.omp_set_num_threads = module.lib.xo_omp_set_num_threads
|
|
541
|
+
self.omp_get_max_threads = module.lib.xo_omp_get_max_threads
|
|
533
542
|
|
|
534
543
|
return module
|
|
535
544
|
|
|
@@ -768,10 +777,8 @@ class BufferNumpy(XBuffer):
|
|
|
768
777
|
value = nplike_to_numpy(value)
|
|
769
778
|
if dest_dtype != value.dtype:
|
|
770
779
|
value = value.astype(dtype=dest_dtype) # make a copy
|
|
771
|
-
src = value.view("int8")
|
|
772
|
-
self.buffer[offset : offset + src.nbytes] =
|
|
773
|
-
"int8"
|
|
774
|
-
)
|
|
780
|
+
src = value.flatten().view("int8")
|
|
781
|
+
self.buffer[offset : offset + src.nbytes] = src
|
|
775
782
|
|
|
776
783
|
def to_bytearray(self, offset, nbytes):
|
|
777
784
|
"""copy in byte array: used in update_from_xbuffer"""
|
|
@@ -518,7 +518,6 @@ class Struct(metaclass=MetaStruct):
|
|
|
518
518
|
extra_classes=(),
|
|
519
519
|
extra_compile_args=(),
|
|
520
520
|
):
|
|
521
|
-
|
|
522
521
|
if context.allow_prebuilt_kernels:
|
|
523
522
|
_print_state = Print.suppress
|
|
524
523
|
Print.suppress = True
|
|
@@ -532,6 +531,7 @@ class Struct(metaclass=MetaStruct):
|
|
|
532
531
|
config={},
|
|
533
532
|
tracker_element_classes=[],
|
|
534
533
|
classes=list(extra_classes) + [cls],
|
|
534
|
+
context=context,
|
|
535
535
|
)
|
|
536
536
|
except ImportError:
|
|
537
537
|
kernel_info = None
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.6.3"
|
|
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
|