pygpgpu 0.2.2__tar.gz → 0.2.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.
- pygpgpu-0.2.4/MANIFEST.in +11 -0
- pygpgpu-0.2.4/PKG-INFO +465 -0
- pygpgpu-0.2.4/README.md +399 -0
- pygpgpu-0.2.4/README.zh-CN.md +399 -0
- pygpgpu-0.2.4/pygpgpu/__init__.py +223 -0
- pygpgpu-0.2.4/pygpgpu/constants.py +107 -0
- pygpgpu-0.2.4/pygpgpu/cparser/__init__.py +9 -0
- pygpgpu-0.2.4/pygpgpu/cparser/cpreprocessor.py +174 -0
- pygpgpu-0.2.4/pygpgpu/cparser/includes.py +88 -0
- pygpgpu-0.2.4/pygpgpu/cparser/related_files.py +143 -0
- pygpgpu-0.2.4/pygpgpu/cparser/struct_layout.py +143 -0
- pygpgpu-0.2.4/pygpgpu/cparser/ts_parser/__init__.py +219 -0
- pygpgpu-0.2.4/pygpgpu/cparser/ts_parser/node_kinds.py +18 -0
- pygpgpu-0.2.4/pygpgpu/cparser/ts_parser/ts_analysis.py +168 -0
- pygpgpu-0.2.4/pygpgpu/cparser/ts_parser/ts_body.py +147 -0
- pygpgpu-0.2.4/pygpgpu/cparser/ts_parser/ts_declarations.py +250 -0
- pygpgpu-0.2.4/pygpgpu/cparser/ts_parser/ts_expressions.py +242 -0
- pygpgpu-0.2.4/pygpgpu/cuda/driver/cuda.py +248 -0
- pygpgpu-0.2.4/pygpgpu/cuda/driver/cuinfo.py +42 -0
- pygpgpu-0.2.4/pygpgpu/cuda/driver/cuinfo_errors.py +171 -0
- pygpgpu-0.2.4/pygpgpu/cuda/driver/cuinfo_sig_array.py +70 -0
- pygpgpu-0.2.4/pygpgpu/cuda/driver/cuinfo_sig_device.py +204 -0
- pygpgpu-0.2.4/pygpgpu/cuda/driver/cuinfo_sig_launch.py +140 -0
- pygpgpu-0.2.4/pygpgpu/cuda/driver/cuinfo_sig_module.py +155 -0
- pygpgpu-0.2.4/pygpgpu/cuda/driver/cuinfo_types.py +152 -0
- pygpgpu-0.2.4/pygpgpu/cuda/driver/cutypes/__init__.py +75 -0
- pygpgpu-0.2.4/pygpgpu/cuda/driver/cutypes/array.py +57 -0
- pygpgpu-0.2.4/pygpgpu/cuda/driver/cutypes/core.py +49 -0
- pygpgpu-0.2.4/pygpgpu/cuda/driver/cutypes/device.py +225 -0
- pygpgpu-0.2.4/pygpgpu/cuda/driver/cutypes/errors.py +103 -0
- pygpgpu-0.2.4/pygpgpu/cuda/driver/cutypes/memory.py +83 -0
- pygpgpu-0.2.4/pygpgpu/cuda/driver/cutypes/texture.py +113 -0
- pygpgpu-0.2.4/pygpgpu/cuda/driver/nvrtc.py +279 -0
- pygpgpu-0.2.4/pygpgpu/cuda/driver/vec_types/char3.py +13 -0
- pygpgpu-0.2.4/pygpgpu/cuda/driver/vec_types/double3.py +13 -0
- pygpgpu-0.2.4/pygpgpu/cuda/driver/vec_types/float3.py +13 -0
- pygpgpu-0.2.4/pygpgpu/cuda/driver/vec_types/int3.py +13 -0
- pygpgpu-0.2.4/pygpgpu/cuda/driver/vec_types/long2.py +12 -0
- pygpgpu-0.2.4/pygpgpu/cuda/driver/vec_types/long3.py +13 -0
- pygpgpu-0.2.4/pygpgpu/cuda/driver/vec_types/long4.py +14 -0
- pygpgpu-0.2.4/pygpgpu/cuda/driver/vec_types/short3.py +13 -0
- pygpgpu-0.2.4/pygpgpu/cuda/driver/vec_types/uchar3.py +13 -0
- pygpgpu-0.2.4/pygpgpu/cuda/driver/vec_types/uint3.py +13 -0
- pygpgpu-0.2.4/pygpgpu/cuda/driver/vec_types/ulong2.py +12 -0
- pygpgpu-0.2.4/pygpgpu/cuda/driver/vec_types/ulong3.py +13 -0
- pygpgpu-0.2.4/pygpgpu/cuda/driver/vec_types/ulong4.py +14 -0
- pygpgpu-0.2.4/pygpgpu/cuda/driver/vec_types/ushort3.py +13 -0
- pygpgpu-0.2.4/pygpgpu/cuda/libraries/__init__.py +117 -0
- pygpgpu-0.2.4/pygpgpu/cuda/libraries/_base.py +26 -0
- pygpgpu-0.2.4/pygpgpu/cuda/libraries/cublas.py +425 -0
- pygpgpu-0.2.4/pygpgpu/cuda/libraries/cublaslt.py +356 -0
- pygpgpu-0.2.4/pygpgpu/cuda/libraries/cudart.py +403 -0
- pygpgpu-0.2.4/pygpgpu/cuda/libraries/cufft.py +219 -0
- pygpgpu-0.2.4/pygpgpu/cuda/libraries/cusolver.py +373 -0
- pygpgpu-0.2.4/pygpgpu/cuda/libraries/cusparse.py +343 -0
- pygpgpu-0.2.4/pygpgpu/cuda/libraries/wrappers/__init__.py +76 -0
- pygpgpu-0.2.4/pygpgpu/cuda/libraries/wrappers/_wrappers_blas.py +279 -0
- pygpgpu-0.2.4/pygpgpu/cuda/libraries/wrappers/_wrappers_common.py +185 -0
- pygpgpu-0.2.4/pygpgpu/cuda/libraries/wrappers/_wrappers_fft.py +84 -0
- pygpgpu-0.2.4/pygpgpu/cuda/libraries/wrappers/_wrappers_lt.py +167 -0
- pygpgpu-0.2.4/pygpgpu/cuda/libraries/wrappers/_wrappers_sparse.py +136 -0
- pygpgpu-0.2.4/pygpgpu/cuda/oop/array.py +279 -0
- pygpgpu-0.2.4/pygpgpu/cuda/oop/buffer.py +85 -0
- pygpgpu-0.2.4/pygpgpu/cuda/oop/context/__init__.py +331 -0
- pygpgpu-0.2.4/pygpgpu/cuda/oop/context/context_image.py +197 -0
- pygpgpu-0.2.4/pygpgpu/cuda/oop/context/context_stream.py +194 -0
- pygpgpu-0.2.4/pygpgpu/cuda/oop/cuobject.py +182 -0
- pygpgpu-0.2.4/pygpgpu/cuda/oop/device.py +88 -0
- pygpgpu-0.2.4/pygpgpu/cuda/oop/devices.py +101 -0
- pygpgpu-0.2.4/pygpgpu/cuda/oop/event.py +54 -0
- pygpgpu-0.2.4/pygpgpu/cuda/oop/kernel/__init__.py +255 -0
- pygpgpu-0.2.4/pygpgpu/cuda/oop/kernel/_kernel_args.py +199 -0
- pygpgpu-0.2.4/pygpgpu/cuda/oop/kernel/_kernel_async.py +95 -0
- pygpgpu-0.2.4/pygpgpu/cuda/oop/kernel/_kernel_launch.py +273 -0
- pygpgpu-0.2.4/pygpgpu/cuda/oop/kernel/_kernel_pack.py +116 -0
- pygpgpu-0.2.4/pygpgpu/cuda/oop/kernel/_kernel_support.py +117 -0
- pygpgpu-0.2.4/pygpgpu/cuda/oop/mem_object.py +184 -0
- pygpgpu-0.2.4/pygpgpu/cuda/oop/nvrtc_program.py +265 -0
- pygpgpu-0.2.4/pygpgpu/cuda/oop/program.py +143 -0
- pygpgpu-0.2.4/pygpgpu/cuda/oop/program_info.py +226 -0
- pygpgpu-0.2.4/pygpgpu/cuda/oop/program_parser/__init__.py +499 -0
- pygpgpu-0.2.4/pygpgpu/cuda/oop/program_parser/struct_builder.py +266 -0
- pygpgpu-0.2.4/pygpgpu/cuda/oop/stream.py +134 -0
- pygpgpu-0.2.4/pygpgpu/cuda/oop/surface.py +70 -0
- pygpgpu-0.2.4/pygpgpu/cuda/oop/texture.py +111 -0
- pygpgpu-0.2.4/pygpgpu/hip/driver/hip.py +266 -0
- pygpgpu-0.2.4/pygpgpu/hip/driver/hipinfo.py +194 -0
- pygpgpu-0.2.4/pygpgpu/hip/libraries/__init__.py +154 -0
- pygpgpu-0.2.4/pygpgpu/hip/libraries/_enums.py +248 -0
- pygpgpu-0.2.4/pygpgpu/hip/libraries/_symbols.py +77 -0
- pygpgpu-0.2.4/pygpgpu/hip/libraries/hipblas.py +177 -0
- pygpgpu-0.2.4/pygpgpu/hip/libraries/hipfft.py +157 -0
- pygpgpu-0.2.4/pygpgpu/hip/libraries/hipsolver.py +215 -0
- pygpgpu-0.2.4/pygpgpu/hip/libraries/hipsparse.py +207 -0
- pygpgpu-0.2.4/pygpgpu/hip/libraries/wrappers/__init__.py +74 -0
- pygpgpu-0.2.4/pygpgpu/hip/libraries/wrappers/_wrappers_blas.py +254 -0
- pygpgpu-0.2.4/pygpgpu/hip/libraries/wrappers/_wrappers_common.py +148 -0
- pygpgpu-0.2.4/pygpgpu/hip/libraries/wrappers/_wrappers_fft.py +92 -0
- pygpgpu-0.2.4/pygpgpu/hip/libraries/wrappers/_wrappers_lt.py +119 -0
- pygpgpu-0.2.4/pygpgpu/hip/oop/buffer.py +85 -0
- pygpgpu-0.2.4/pygpgpu/hip/oop/context.py +212 -0
- pygpgpu-0.2.4/pygpgpu/hip/oop/devices.py +99 -0
- pygpgpu-0.2.4/pygpgpu/hip/oop/hip_compiler.py +255 -0
- pygpgpu-0.2.4/pygpgpu/hip/oop/hipobject.py +165 -0
- pygpgpu-0.2.4/pygpgpu/hip/oop/kernel/__init__.py +254 -0
- pygpgpu-0.2.4/pygpgpu/hip/oop/kernel/_kernel_args.py +147 -0
- pygpgpu-0.2.4/pygpgpu/hip/oop/kernel/_kernel_async.py +91 -0
- pygpgpu-0.2.4/pygpgpu/hip/oop/kernel/_kernel_launch.py +268 -0
- pygpgpu-0.2.4/pygpgpu/hip/oop/kernel/_kernel_pack.py +67 -0
- pygpgpu-0.2.4/pygpgpu/hip/oop/kernel/_kernel_support.py +103 -0
- pygpgpu-0.2.4/pygpgpu/hip/oop/mem_object.py +180 -0
- pygpgpu-0.2.4/pygpgpu/hip/oop/program.py +149 -0
- pygpgpu-0.2.4/pygpgpu/hip/oop/program_info.py +203 -0
- pygpgpu-0.2.4/pygpgpu/hip/oop/program_parser/__init__.py +465 -0
- pygpgpu-0.2.4/pygpgpu/hip/oop/program_parser/struct_builder.py +267 -0
- pygpgpu-0.2.4/pygpgpu/hip/oop/stream.py +131 -0
- pygpgpu-0.2.4/pygpgpu/image/__init__.py +444 -0
- pygpgpu-0.2.4/pygpgpu/image/enums.py +81 -0
- pygpgpu-0.2.4/pygpgpu/image/shape.py +64 -0
- pygpgpu-0.2.4/pygpgpu/kernel/__init__.py +20 -0
- pygpgpu-0.2.4/pygpgpu/kernel/builtin_registry.py +42 -0
- pygpgpu-0.2.4/pygpgpu/kernel/builtins/__init__.py +323 -0
- pygpgpu-0.2.4/pygpgpu/kernel/builtins/atomic.py +71 -0
- pygpgpu-0.2.4/pygpgpu/kernel/builtins/block_memory.py +167 -0
- pygpgpu-0.2.4/pygpgpu/kernel/builtins/group_memory.py +152 -0
- pygpgpu-0.2.4/pygpgpu/kernel/builtins/work_item.py +39 -0
- pygpgpu-0.2.4/pygpgpu/kernel/complex.py +380 -0
- pygpgpu-0.2.4/pygpgpu/kernel/decorator/__init__.py +378 -0
- pygpgpu-0.2.4/pygpgpu/kernel/decorator/_build_phase_args.py +122 -0
- pygpgpu-0.2.4/pygpgpu/kernel/decorator/_compile_kernels.py +361 -0
- pygpgpu-0.2.4/pygpgpu/kernel/decorator/_compile_translate.py +112 -0
- pygpgpu-0.2.4/pygpgpu/kernel/decorator/_compile_write.py +413 -0
- pygpgpu-0.2.4/pygpgpu/kernel/decorator/_phase1.py +330 -0
- pygpgpu-0.2.4/pygpgpu/kernel/decorator/_phase2.py +222 -0
- pygpgpu-0.2.4/pygpgpu/kernel/decorator/_phase3.py +368 -0
- pygpgpu-0.2.4/pygpgpu/kernel/decorator/_phase_async.py +158 -0
- pygpgpu-0.2.4/pygpgpu/kernel/decorator/_phase_readback.py +84 -0
- pygpgpu-0.2.4/pygpgpu/kernel/decorator/_typing.py +73 -0
- pygpgpu-0.2.4/pygpgpu/kernel/decorator/binding.py +217 -0
- pygpgpu-0.2.4/pygpgpu/kernel/decorator/call_proxies.py +219 -0
- pygpgpu-0.2.4/pygpgpu/kernel/decorator/compile_plan.py +21 -0
- pygpgpu-0.2.4/pygpgpu/kernel/decorator/cuda_link.py +168 -0
- pygpgpu-0.2.4/pygpgpu/kernel/decorator/devices.py +460 -0
- pygpgpu-0.2.4/pygpgpu/kernel/decorator/factory.py +119 -0
- pygpgpu-0.2.4/pygpgpu/kernel/decorator/frames.py +261 -0
- pygpgpu-0.2.4/pygpgpu/kernel/decorator/helper_closure.py +137 -0
- pygpgpu-0.2.4/pygpgpu/kernel/decorator/host_regions.py +423 -0
- pygpgpu-0.2.4/pygpgpu/kernel/decorator/images.py +61 -0
- pygpgpu-0.2.4/pygpgpu/kernel/decorator/launch_plan.py +31 -0
- pygpgpu-0.2.4/pygpgpu/kernel/decorator/pykernel_cache.py +162 -0
- pygpgpu-0.2.4/pygpgpu/kernel/decorator/pykernel_call.py +335 -0
- pygpgpu-0.2.4/pygpgpu/kernel/decorator/pykernel_compile.py +40 -0
- pygpgpu-0.2.4/pygpgpu/kernel/decorator/pykernel_identity.py +131 -0
- pygpgpu-0.2.4/pygpgpu/kernel/decorator/pykernel_invoke.py +39 -0
- pygpgpu-0.2.4/pygpgpu/kernel/decorator/pykernel_outer.py +164 -0
- pygpgpu-0.2.4/pygpgpu/kernel/decorator/pykernel_returns.py +322 -0
- pygpgpu-0.2.4/pygpgpu/kernel/decorator/shape_check.py +164 -0
- pygpgpu-0.2.4/pygpgpu/kernel/decorator/slots.py +121 -0
- pygpgpu-0.2.4/pygpgpu/kernel/decorator/type_map.py +61 -0
- pygpgpu-0.2.4/pygpgpu/kernel/device_builtins/__init__.py +58 -0
- pygpgpu-0.2.4/pygpgpu/kernel/device_builtins/atomics.py +217 -0
- pygpgpu-0.2.4/pygpgpu/kernel/device_builtins/floor.py +217 -0
- pygpgpu-0.2.4/pygpgpu/kernel/device_builtins/index.py +104 -0
- pygpgpu-0.2.4/pygpgpu/kernel/device_builtins/math_tables.py +246 -0
- pygpgpu-0.2.4/pygpgpu/kernel/device_builtins/vector_helpers.py +252 -0
- pygpgpu-0.2.4/pygpgpu/kernel/device_library.py +216 -0
- pygpgpu-0.2.4/pygpgpu/kernel/host_runtime.py +130 -0
- pygpgpu-0.2.4/pygpgpu/kernel/include/complex.h +74 -0
- pygpgpu-0.2.4/pygpgpu/kernel/include/complex_double.h +419 -0
- pygpgpu-0.2.4/pygpgpu/kernel/include/complex_float.h +467 -0
- pygpgpu-0.2.4/pygpgpu/kernel/include/complex_mixed.h +123 -0
- pygpgpu-0.2.4/pygpgpu/kernel/include/quat.h +283 -0
- pygpgpu-0.2.4/pygpgpu/kernel/metal_codegen.py +121 -0
- pygpgpu-0.2.4/pygpgpu/kernel/objects/__init__.py +107 -0
- pygpgpu-0.2.4/pygpgpu/kernel/objects/binding.py +184 -0
- pygpgpu-0.2.4/pygpgpu/kernel/objects/build.py +79 -0
- pygpgpu-0.2.4/pygpgpu/kernel/objects/construction.py +387 -0
- pygpgpu-0.2.4/pygpgpu/kernel/objects/convert.py +489 -0
- pygpgpu-0.2.4/pygpgpu/kernel/objects/kinds.py +485 -0
- pygpgpu-0.2.4/pygpgpu/kernel/objects/scan.py +393 -0
- pygpgpu-0.2.4/pygpgpu/kernel/objects/scan_paths.py +289 -0
- pygpgpu-0.2.4/pygpgpu/kernel/objects/state.py +76 -0
- pygpgpu-0.2.4/pygpgpu/kernel/python_backend/__init__.py +71 -0
- pygpgpu-0.2.4/pygpgpu/kernel/python_backend/analysis.py +129 -0
- pygpgpu-0.2.4/pygpgpu/kernel/python_backend/frame.py +157 -0
- pygpgpu-0.2.4/pygpgpu/kernel/python_backend/kernel.py +271 -0
- pygpgpu-0.2.4/pygpgpu/kernel/python_backend/magic.py +133 -0
- pygpgpu-0.2.4/pygpgpu/kernel/quaternion.py +231 -0
- pygpgpu-0.2.4/pygpgpu/kernel/sci_math/__init__.py +138 -0
- pygpgpu-0.2.4/pygpgpu/kernel/sci_math/bessel.py +99 -0
- pygpgpu-0.2.4/pygpgpu/kernel/sci_math/conversion.py +65 -0
- pygpgpu-0.2.4/pygpgpu/kernel/sci_math/distribution.py +99 -0
- pygpgpu-0.2.4/pygpgpu/kernel/sci_math/exact.py +75 -0
- pygpgpu-0.2.4/pygpgpu/kernel/sci_math/fast.py +71 -0
- pygpgpu-0.2.4/pygpgpu/kernel/sci_math/guards.py +25 -0
- pygpgpu-0.2.4/pygpgpu/kernel/sci_math/minmax.py +80 -0
- pygpgpu-0.2.4/pygpgpu/kernel/sci_math/native.py +85 -0
- pygpgpu-0.2.4/pygpgpu/kernel/sci_math/special.py +51 -0
- pygpgpu-0.2.4/pygpgpu/kernel/source_paths/__init__.py +113 -0
- pygpgpu-0.2.4/pygpgpu/kernel/source_paths/digest.py +230 -0
- pygpgpu-0.2.4/pygpgpu/kernel/source_paths/guards.py +158 -0
- pygpgpu-0.2.4/pygpgpu/kernel/source_paths/layout.py +219 -0
- pygpgpu-0.2.4/pygpgpu/kernel/source_paths/locks.py +176 -0
- pygpgpu-0.2.4/pygpgpu/kernel/source_paths/merge.py +369 -0
- pygpgpu-0.2.4/pygpgpu/kernel/source_paths/prototypes.py +214 -0
- pygpgpu-0.2.4/pygpgpu/kernel/source_paths/source_store.py +253 -0
- pygpgpu-0.2.4/pygpgpu/kernel/source_paths/writing.py +375 -0
- pygpgpu-0.2.4/pygpgpu/kernel/structs/__init__.py +78 -0
- pygpgpu-0.2.4/pygpgpu/kernel/structs/layout.py +481 -0
- pygpgpu-0.2.4/pygpgpu/kernel/structs/registry.py +275 -0
- pygpgpu-0.2.4/pygpgpu/kernel/structs/state.py +47 -0
- pygpgpu-0.2.4/pygpgpu/kernel/structs/unions.py +162 -0
- pygpgpu-0.2.4/pygpgpu/kernel/translator/__init__.py +308 -0
- pygpgpu-0.2.4/pygpgpu/kernel/translator/_exports.py +264 -0
- pygpgpu-0.2.4/pygpgpu/kernel/translator/assign.py +455 -0
- pygpgpu-0.2.4/pygpgpu/kernel/translator/attributes.py +290 -0
- pygpgpu-0.2.4/pygpgpu/kernel/translator/augassign.py +336 -0
- pygpgpu-0.2.4/pygpgpu/kernel/translator/builtin_emit.py +490 -0
- pygpgpu-0.2.4/pygpgpu/kernel/translator/builtin_python.py +453 -0
- pygpgpu-0.2.4/pygpgpu/kernel/translator/builtins.py +264 -0
- pygpgpu-0.2.4/pygpgpu/kernel/translator/calls.py +491 -0
- pygpgpu-0.2.4/pygpgpu/kernel/translator/complex_values.py +373 -0
- pygpgpu-0.2.4/pygpgpu/kernel/translator/device_call.py +455 -0
- pygpgpu-0.2.4/pygpgpu/kernel/translator/emit.py +332 -0
- pygpgpu-0.2.4/pygpgpu/kernel/translator/errors.py +107 -0
- pygpgpu-0.2.4/pygpgpu/kernel/translator/expressions.py +331 -0
- pygpgpu-0.2.4/pygpgpu/kernel/translator/host_regions.py +353 -0
- pygpgpu-0.2.4/pygpgpu/kernel/translator/images.py +227 -0
- pygpgpu-0.2.4/pygpgpu/kernel/translator/init.py +500 -0
- pygpgpu-0.2.4/pygpgpu/kernel/translator/magic_loop.py +359 -0
- pygpgpu-0.2.4/pygpgpu/kernel/translator/magic_methods.py +402 -0
- pygpgpu-0.2.4/pygpgpu/kernel/translator/naming.py +388 -0
- pygpgpu-0.2.4/pygpgpu/kernel/translator/native_recursion.py +220 -0
- pygpgpu-0.2.4/pygpgpu/kernel/translator/nd_index.py +475 -0
- pygpgpu-0.2.4/pygpgpu/kernel/translator/nested_launch.py +121 -0
- pygpgpu-0.2.4/pygpgpu/kernel/translator/notation.py +176 -0
- pygpgpu-0.2.4/pygpgpu/kernel/translator/numpy_emit.py +463 -0
- pygpgpu-0.2.4/pygpgpu/kernel/translator/operators.py +332 -0
- pygpgpu-0.2.4/pygpgpu/kernel/translator/outer_store.py +91 -0
- pygpgpu-0.2.4/pygpgpu/kernel/translator/outer_vars.py +218 -0
- pygpgpu-0.2.4/pygpgpu/kernel/translator/phases.py +432 -0
- pygpgpu-0.2.4/pygpgpu/kernel/translator/predicates.py +249 -0
- pygpgpu-0.2.4/pygpgpu/kernel/translator/print_emit.py +473 -0
- pygpgpu-0.2.4/pygpgpu/kernel/translator/print_fstring.py +154 -0
- pygpgpu-0.2.4/pygpgpu/kernel/translator/private_array.py +238 -0
- pygpgpu-0.2.4/pygpgpu/kernel/translator/quaternions.py +185 -0
- pygpgpu-0.2.4/pygpgpu/kernel/translator/raise_emit.py +232 -0
- pygpgpu-0.2.4/pygpgpu/kernel/translator/receivers.py +433 -0
- pygpgpu-0.2.4/pygpgpu/kernel/translator/render.py +359 -0
- pygpgpu-0.2.4/pygpgpu/kernel/translator/return_type_scan.py +442 -0
- pygpgpu-0.2.4/pygpgpu/kernel/translator/returns.py +440 -0
- pygpgpu-0.2.4/pygpgpu/kernel/translator/scalar_recursion.py +208 -0
- pygpgpu-0.2.4/pygpgpu/kernel/translator/shared_shapes.py +82 -0
- pygpgpu-0.2.4/pygpgpu/kernel/translator/site_scan.py +358 -0
- pygpgpu-0.2.4/pygpgpu/kernel/translator/source_text.py +217 -0
- pygpgpu-0.2.4/pygpgpu/kernel/translator/statements.py +364 -0
- pygpgpu-0.2.4/pygpgpu/kernel/translator/structures.py +283 -0
- pygpgpu-0.2.4/pygpgpu/kernel/translator/subscripts.py +380 -0
- pygpgpu-0.2.4/pygpgpu/kernel/translator/suspended_recursion.py +244 -0
- pygpgpu-0.2.4/pygpgpu/kernel/translator/tail_recursion.py +197 -0
- pygpgpu-0.2.4/pygpgpu/kernel/translator/targets.py +393 -0
- pygpgpu-0.2.4/pygpgpu/kernel/translator/tuples.py +219 -0
- pygpgpu-0.2.4/pygpgpu/kernel/translator/type_map.py +261 -0
- pygpgpu-0.2.4/pygpgpu/kernel/translator/vector_floor.py +120 -0
- pygpgpu-0.2.4/pygpgpu/kernel/translator/vector_ops.py +445 -0
- pygpgpu-0.2.4/pygpgpu/kernel/translator/vectors.py +96 -0
- pygpgpu-0.2.4/pygpgpu/kernel/translator/walk.py +445 -0
- pygpgpu-0.2.4/pygpgpu/kernel/translator/work_group.py +140 -0
- pygpgpu-0.2.4/pygpgpu/kernel_import/__init__.py +59 -0
- pygpgpu-0.2.4/pygpgpu/kernel_import/hook.py +61 -0
- pygpgpu-0.2.4/pygpgpu/kernel_import/source.py +178 -0
- pygpgpu-0.2.4/pygpgpu/kernel_import/tables.py +142 -0
- pygpgpu-0.2.4/pygpgpu/kernel_import/wrapper.py +362 -0
- pygpgpu-0.2.4/pygpgpu/kernel_import_stub.py +172 -0
- pygpgpu-0.2.4/pygpgpu/libraries/__init__.py +30 -0
- pygpgpu-0.2.4/pygpgpu/libraries/_base.py +380 -0
- pygpgpu-0.2.4/pygpgpu/metal/__init__.py +8 -0
- pygpgpu-0.2.4/pygpgpu/metal/driver/__init__.py +2 -0
- pygpgpu-0.2.4/pygpgpu/metal/driver/metal.py +193 -0
- pygpgpu-0.2.4/pygpgpu/metal/driver/objc.py +177 -0
- pygpgpu-0.2.4/pygpgpu/metal/oop/__init__.py +3 -0
- pygpgpu-0.2.4/pygpgpu/metal/oop/buffer.py +236 -0
- pygpgpu-0.2.4/pygpgpu/metal/oop/compile_options.py +210 -0
- pygpgpu-0.2.4/pygpgpu/metal/oop/context.py +117 -0
- pygpgpu-0.2.4/pygpgpu/metal/oop/device.py +17 -0
- pygpgpu-0.2.4/pygpgpu/metal/oop/devices.py +182 -0
- pygpgpu-0.2.4/pygpgpu/metal/oop/event.py +64 -0
- pygpgpu-0.2.4/pygpgpu/metal/oop/kernel/__init__.py +451 -0
- pygpgpu-0.2.4/pygpgpu/metal/oop/kernel/scalars.py +156 -0
- pygpgpu-0.2.4/pygpgpu/metal/oop/metalobject.py +71 -0
- pygpgpu-0.2.4/pygpgpu/metal/oop/program.py +167 -0
- pygpgpu-0.2.4/pygpgpu/metal/oop/program_info.py +228 -0
- pygpgpu-0.2.4/pygpgpu/metal/oop/program_parser/__init__.py +227 -0
- pygpgpu-0.2.4/pygpgpu/metal/oop/program_parser/analysis.py +280 -0
- pygpgpu-0.2.4/pygpgpu/metal/oop/program_parser/declarations.py +260 -0
- pygpgpu-0.2.4/pygpgpu/metal/oop/program_parser/node_kinds.py +71 -0
- pygpgpu-0.2.4/pygpgpu/metal/oop/program_parser/struct_builder.py +226 -0
- pygpgpu-0.2.4/pygpgpu/numpy/__init__.py +113 -0
- pygpgpu-0.2.4/pygpgpu/numpy/_backends/__init__.py +72 -0
- pygpgpu-0.2.4/pygpgpu/numpy/_backends/_backends_alloc.py +182 -0
- pygpgpu-0.2.4/pygpgpu/numpy/_backends/_backends_copy.py +162 -0
- pygpgpu-0.2.4/pygpgpu/numpy/_backends/_backends_pinning.py +196 -0
- pygpgpu-0.2.4/pygpgpu/numpy/_backends/_backends_zerocopy.py +48 -0
- pygpgpu-0.2.4/pygpgpu/numpy/_devices.py +199 -0
- pygpgpu-0.2.4/pygpgpu/numpy/_torch.py +197 -0
- pygpgpu-0.2.4/pygpgpu/numpy/array_creation.py +102 -0
- pygpgpu-0.2.4/pygpgpu/numpy/ndarray/__init__.py +294 -0
- pygpgpu-0.2.4/pygpgpu/numpy/ndarray/_host_state.py +200 -0
- pygpgpu-0.2.4/pygpgpu/numpy/ndarray/_launch_binding.py +200 -0
- pygpgpu-0.2.4/pygpgpu/numpy/ndarray/_numpy_api.py +230 -0
- pygpgpu-0.2.4/pygpgpu/numpy/ndarray/_transfer.py +252 -0
- pygpgpu-0.2.4/pygpgpu/numpy/ndarray/binding.py +163 -0
- pygpgpu-0.2.4/pygpgpu/numpy/ndarray/plain.py +54 -0
- pygpgpu-0.2.4/pygpgpu/numpy/transfer.py +140 -0
- pygpgpu-0.2.4/pygpgpu/opencl/driver/cl.py +252 -0
- pygpgpu-0.2.4/pygpgpu/opencl/driver/clinfo.py +76 -0
- pygpgpu-0.2.4/pygpgpu/opencl/driver/clinfo_query_types.py +342 -0
- pygpgpu-0.2.4/pygpgpu/opencl/driver/clinfo_sig_context.py +164 -0
- pygpgpu-0.2.4/pygpgpu/opencl/driver/clinfo_sig_device.py +161 -0
- pygpgpu-0.2.4/pygpgpu/opencl/driver/clinfo_sig_enqueue.py +226 -0
- pygpgpu-0.2.4/pygpgpu/opencl/driver/clinfo_sig_event.py +92 -0
- pygpgpu-0.2.4/pygpgpu/opencl/driver/clinfo_sig_memobj.py +186 -0
- pygpgpu-0.2.4/pygpgpu/opencl/driver/clinfo_sig_misc.py +109 -0
- pygpgpu-0.2.4/pygpgpu/opencl/driver/clinfo_sig_platform.py +67 -0
- pygpgpu-0.2.4/pygpgpu/opencl/driver/clinfo_sig_program.py +235 -0
- pygpgpu-0.2.4/pygpgpu/opencl/driver/clinfo_types.py +221 -0
- pygpgpu-0.2.4/pygpgpu/opencl/driver/cltypes/__init__.py +118 -0
- pygpgpu-0.2.4/pygpgpu/opencl/driver/cltypes/context.py +136 -0
- pygpgpu-0.2.4/pygpgpu/opencl/driver/cltypes/core.py +42 -0
- pygpgpu-0.2.4/pygpgpu/opencl/driver/cltypes/device.py +353 -0
- pygpgpu-0.2.4/pygpgpu/opencl/driver/cltypes/errors.py +111 -0
- pygpgpu-0.2.4/pygpgpu/opencl/driver/cltypes/image.py +86 -0
- pygpgpu-0.2.4/pygpgpu/opencl/driver/cltypes/memory.py +152 -0
- pygpgpu-0.2.4/pygpgpu/opencl/driver/cltypes/structures.py +117 -0
- pygpgpu-0.2.4/pygpgpu/opencl/driver/vec_types/__init__.py +80 -0
- pygpgpu-0.2.4/pygpgpu/opencl/driver/vec_types/char16.py +26 -0
- pygpgpu-0.2.4/pygpgpu/opencl/driver/vec_types/char16.pyi +193 -0
- pygpgpu-0.2.4/pygpgpu/opencl/driver/vec_types/char3.py +14 -0
- pygpgpu-0.2.4/pygpgpu/opencl/driver/vec_types/char8.py +18 -0
- pygpgpu-0.2.4/pygpgpu/opencl/driver/vec_types/char8.pyi +109 -0
- pygpgpu-0.2.4/pygpgpu/opencl/driver/vec_types/double16.py +26 -0
- pygpgpu-0.2.4/pygpgpu/opencl/driver/vec_types/double16.pyi +193 -0
- pygpgpu-0.2.4/pygpgpu/opencl/driver/vec_types/double3.py +14 -0
- pygpgpu-0.2.4/pygpgpu/opencl/driver/vec_types/double8.py +18 -0
- pygpgpu-0.2.4/pygpgpu/opencl/driver/vec_types/double8.pyi +109 -0
- pygpgpu-0.2.4/pygpgpu/opencl/driver/vec_types/float16.py +26 -0
- pygpgpu-0.2.4/pygpgpu/opencl/driver/vec_types/float16.pyi +193 -0
- pygpgpu-0.2.4/pygpgpu/opencl/driver/vec_types/float3.py +14 -0
- pygpgpu-0.2.4/pygpgpu/opencl/driver/vec_types/float8.py +18 -0
- pygpgpu-0.2.4/pygpgpu/opencl/driver/vec_types/float8.pyi +109 -0
- pygpgpu-0.2.4/pygpgpu/opencl/driver/vec_types/genVec16.py +16 -0
- pygpgpu-0.2.4/pygpgpu/opencl/driver/vec_types/genVec8.py +14 -0
- pygpgpu-0.2.4/pygpgpu/opencl/driver/vec_types/helper.py +68 -0
- pygpgpu-0.2.4/pygpgpu/opencl/driver/vec_types/int16.py +26 -0
- pygpgpu-0.2.4/pygpgpu/opencl/driver/vec_types/int16.pyi +193 -0
- pygpgpu-0.2.4/pygpgpu/opencl/driver/vec_types/int3.py +14 -0
- pygpgpu-0.2.4/pygpgpu/opencl/driver/vec_types/int8.py +18 -0
- pygpgpu-0.2.4/pygpgpu/opencl/driver/vec_types/int8.pyi +109 -0
- pygpgpu-0.2.4/pygpgpu/opencl/driver/vec_types/long16.py +26 -0
- pygpgpu-0.2.4/pygpgpu/opencl/driver/vec_types/long16.pyi +193 -0
- pygpgpu-0.2.4/pygpgpu/opencl/driver/vec_types/long2.py +12 -0
- pygpgpu-0.2.4/pygpgpu/opencl/driver/vec_types/long3.py +14 -0
- pygpgpu-0.2.4/pygpgpu/opencl/driver/vec_types/long4.py +14 -0
- pygpgpu-0.2.4/pygpgpu/opencl/driver/vec_types/long8.py +18 -0
- pygpgpu-0.2.4/pygpgpu/opencl/driver/vec_types/long8.pyi +109 -0
- pygpgpu-0.2.4/pygpgpu/opencl/driver/vec_types/short16.py +26 -0
- pygpgpu-0.2.4/pygpgpu/opencl/driver/vec_types/short16.pyi +193 -0
- pygpgpu-0.2.4/pygpgpu/opencl/driver/vec_types/short3.py +14 -0
- pygpgpu-0.2.4/pygpgpu/opencl/driver/vec_types/short8.py +18 -0
- pygpgpu-0.2.4/pygpgpu/opencl/driver/vec_types/short8.pyi +109 -0
- pygpgpu-0.2.4/pygpgpu/opencl/driver/vec_types/uchar16.py +26 -0
- pygpgpu-0.2.4/pygpgpu/opencl/driver/vec_types/uchar16.pyi +193 -0
- pygpgpu-0.2.4/pygpgpu/opencl/driver/vec_types/uchar3.py +14 -0
- pygpgpu-0.2.4/pygpgpu/opencl/driver/vec_types/uchar8.py +18 -0
- pygpgpu-0.2.4/pygpgpu/opencl/driver/vec_types/uchar8.pyi +109 -0
- pygpgpu-0.2.4/pygpgpu/opencl/driver/vec_types/uint16.py +26 -0
- pygpgpu-0.2.4/pygpgpu/opencl/driver/vec_types/uint16.pyi +193 -0
- pygpgpu-0.2.4/pygpgpu/opencl/driver/vec_types/uint3.py +14 -0
- pygpgpu-0.2.4/pygpgpu/opencl/driver/vec_types/uint8.py +18 -0
- pygpgpu-0.2.4/pygpgpu/opencl/driver/vec_types/uint8.pyi +109 -0
- pygpgpu-0.2.4/pygpgpu/opencl/driver/vec_types/ulong16.py +26 -0
- pygpgpu-0.2.4/pygpgpu/opencl/driver/vec_types/ulong16.pyi +193 -0
- pygpgpu-0.2.4/pygpgpu/opencl/driver/vec_types/ulong2.py +12 -0
- pygpgpu-0.2.4/pygpgpu/opencl/driver/vec_types/ulong3.py +14 -0
- pygpgpu-0.2.4/pygpgpu/opencl/driver/vec_types/ulong4.py +14 -0
- pygpgpu-0.2.4/pygpgpu/opencl/driver/vec_types/ulong8.py +18 -0
- pygpgpu-0.2.4/pygpgpu/opencl/driver/vec_types/ulong8.pyi +109 -0
- pygpgpu-0.2.4/pygpgpu/opencl/driver/vec_types/ushort16.py +26 -0
- pygpgpu-0.2.4/pygpgpu/opencl/driver/vec_types/ushort16.pyi +193 -0
- pygpgpu-0.2.4/pygpgpu/opencl/driver/vec_types/ushort3.py +14 -0
- pygpgpu-0.2.4/pygpgpu/opencl/driver/vec_types/ushort8.py +18 -0
- pygpgpu-0.2.4/pygpgpu/opencl/driver/vec_types/ushort8.pyi +109 -0
- pygpgpu-0.2.4/pygpgpu/opencl/oop/buffer.py +148 -0
- pygpgpu-0.2.4/pygpgpu/opencl/oop/clobject.py +182 -0
- pygpgpu-0.2.4/pygpgpu/opencl/oop/command_queue.py +85 -0
- pygpgpu-0.2.4/pygpgpu/opencl/oop/context.py +489 -0
- pygpgpu-0.2.4/pygpgpu/opencl/oop/device.py +63 -0
- pygpgpu-0.2.4/pygpgpu/opencl/oop/event.py +220 -0
- pygpgpu-0.2.4/pygpgpu/opencl/oop/kernel/__init__.py +306 -0
- pygpgpu-0.2.4/pygpgpu/opencl/oop/kernel/_kernel_args.py +233 -0
- pygpgpu-0.2.4/pygpgpu/opencl/oop/kernel/_kernel_async.py +64 -0
- pygpgpu-0.2.4/pygpgpu/opencl/oop/kernel/_kernel_launch.py +283 -0
- pygpgpu-0.2.4/pygpgpu/opencl/oop/kernel/_kernel_support.py +158 -0
- pygpgpu-0.2.4/pygpgpu/opencl/oop/mem_object.py +190 -0
- pygpgpu-0.2.4/pygpgpu/opencl/oop/platform.py +169 -0
- pygpgpu-0.2.4/pygpgpu/opencl/oop/platforms.py +101 -0
- pygpgpu-0.2.4/pygpgpu/opencl/oop/program.py +420 -0
- pygpgpu-0.2.4/pygpgpu/opencl/oop/program_info.py +229 -0
- pygpgpu-0.2.4/pygpgpu/opencl/oop/program_parser/__init__.py +500 -0
- pygpgpu-0.2.4/pygpgpu/opencl/oop/program_parser/struct_builder.py +249 -0
- pygpgpu-0.2.4/pygpgpu/opencl/oop/sampler.py +83 -0
- pygpgpu-0.2.4/pygpgpu/settings.py +251 -0
- pygpgpu-0.2.4/pygpgpu/utils/__init__.py +48 -0
- pygpgpu-0.2.4/pygpgpu/utils/files.py +191 -0
- pygpgpu-0.2.4/pygpgpu/utils/futures.py +67 -0
- pygpgpu-0.2.4/pygpgpu/utils/print_info.py +131 -0
- pygpgpu-0.2.4/pygpgpu/utils/work_size.py +306 -0
- pygpgpu-0.2.4/pygpgpu/vec_types/__init__.py +72 -0
- pygpgpu-0.2.4/pygpgpu/vec_types/char2.py +12 -0
- pygpgpu-0.2.4/pygpgpu/vec_types/char2.pyi +248 -0
- pygpgpu-0.2.4/pygpgpu/vec_types/char4.py +14 -0
- pygpgpu-0.2.4/pygpgpu/vec_types/char4.pyi +2858 -0
- pygpgpu-0.2.4/pygpgpu/vec_types/funcs.py +263 -0
- pygpgpu-0.2.4/pygpgpu/vec_types/helper.py +137 -0
- pygpgpu-0.2.4/pygpgpu/vec_types/layout/__init__.py +55 -0
- pygpgpu-0.2.4/pygpgpu/vec_types/layout/_layout_classes.py +33 -0
- pygpgpu-0.2.4/pygpgpu/vec_types/layout/_layout_geometry.py +184 -0
- pygpgpu-0.2.4/pygpgpu/vec_types/layout/_layout_pack.py +352 -0
- pygpgpu-0.2.4/pygpgpu/vec_types/short2.py +12 -0
- pygpgpu-0.2.4/pygpgpu/vec_types/short2.pyi +248 -0
- pygpgpu-0.2.4/pygpgpu/vec_types/short4.py +14 -0
- pygpgpu-0.2.4/pygpgpu/vec_types/short4.pyi +2858 -0
- pygpgpu-0.2.4/pygpgpu/vec_types/uchar2.py +12 -0
- pygpgpu-0.2.4/pygpgpu/vec_types/uchar2.pyi +248 -0
- pygpgpu-0.2.4/pygpgpu/vec_types/uchar4.py +14 -0
- pygpgpu-0.2.4/pygpgpu/vec_types/uchar4.pyi +2858 -0
- pygpgpu-0.2.4/pygpgpu/vec_types/ushort2.py +12 -0
- pygpgpu-0.2.4/pygpgpu/vec_types/ushort2.pyi +248 -0
- pygpgpu-0.2.4/pygpgpu/vec_types/ushort4.py +14 -0
- pygpgpu-0.2.4/pygpgpu/vec_types/ushort4.pyi +2858 -0
- pygpgpu-0.2.4/pygpgpu.egg-info/PKG-INFO +465 -0
- pygpgpu-0.2.4/pygpgpu.egg-info/SOURCES.txt +663 -0
- pygpgpu-0.2.4/pygpgpu.egg-info/requires.txt +15 -0
- pygpgpu-0.2.4/pyproject.toml +255 -0
- pygpgpu-0.2.4/tests/test_async_phases.py +51 -0
- pygpgpu-0.2.4/tests/test_async_tail_return.py +36 -0
- pygpgpu-0.2.4/tests/test_blackbox_divergences.py +167 -0
- pygpgpu-0.2.4/tests/test_blackbox_usage.py +136 -0
- pygpgpu-0.2.4/tests/test_blackbox_usage_round2.py +157 -0
- pygpgpu-0.2.4/tests/test_builtins.py +334 -0
- pygpgpu-0.2.4/tests/test_config.py +268 -0
- pygpgpu-0.2.4/tests/test_decorator_contract.py +127 -0
- pygpgpu-0.2.4/tests/test_driver_background_init.py +134 -0
- pygpgpu-0.2.4/tests/test_float_literals.py +106 -0
- pygpgpu-0.2.4/tests/test_genvec_arithmetic.py +266 -0
- pygpgpu-0.2.4/tests/test_genvec_layout_and_construction.py +177 -0
- pygpgpu-0.2.4/tests/test_genvec_numpy_view.py +88 -0
- pygpgpu-0.2.4/tests/test_genvec_swizzles.py +235 -0
- pygpgpu-0.2.4/tests/test_gnp_torch.py +117 -0
- pygpgpu-0.2.4/tests/test_gnp_transfers.py +380 -0
- pygpgpu-0.2.4/tests/test_gnp_view_offsets.py +124 -0
- pygpgpu-0.2.4/tests/test_handle_identity.py +122 -0
- pygpgpu-0.2.4/tests/test_kernel_argument_errors.py +320 -0
- pygpgpu-0.2.4/tests/test_kernel_array_views.py +480 -0
- pygpgpu-0.2.4/tests/test_kernel_atomic_augassign.py +245 -0
- pygpgpu-0.2.4/tests/test_kernel_block_memory.py +244 -0
- pygpgpu-0.2.4/tests/test_kernel_block_scoping.py +140 -0
- pygpgpu-0.2.4/tests/test_kernel_branch_declaration.py +97 -0
- pygpgpu-0.2.4/tests/test_kernel_cache_helpers.py +350 -0
- pygpgpu-0.2.4/tests/test_kernel_classmethod_kernels.py +449 -0
- pygpgpu-0.2.4/tests/test_kernel_concurrent_compile.py +171 -0
- pygpgpu-0.2.4/tests/test_kernel_copy_policy.py +110 -0
- pygpgpu-0.2.4/tests/test_kernel_ctypes_structures.py +336 -0
- pygpgpu-0.2.4/tests/test_kernel_default_device.py +328 -0
- pygpgpu-0.2.4/tests/test_kernel_floor_division.py +192 -0
- pygpgpu-0.2.4/tests/test_kernel_frozen_cache.py +281 -0
- pygpgpu-0.2.4/tests/test_kernel_generated_source_cache.py +469 -0
- pygpgpu-0.2.4/tests/test_kernel_geometric_device_calls.py +145 -0
- pygpgpu-0.2.4/tests/test_kernel_helper_tuples.py +232 -0
- pygpgpu-0.2.4/tests/test_kernel_host_regions.py +299 -0
- pygpgpu-0.2.4/tests/test_kernel_indirect_loop_bound.py +36 -0
- pygpgpu-0.2.4/tests/test_kernel_local_memory.py +324 -0
- pygpgpu-0.2.4/tests/test_kernel_loop_exits.py +234 -0
- pygpgpu-0.2.4/tests/test_kernel_member_width.py +273 -0
- pygpgpu-0.2.4/tests/test_kernel_narrow_arguments.py +83 -0
- pygpgpu-0.2.4/tests/test_kernel_ndindex_forms.py +187 -0
- pygpgpu-0.2.4/tests/test_kernel_nested_launch.py +340 -0
- pygpgpu-0.2.4/tests/test_kernel_nested_members.py +227 -0
- pygpgpu-0.2.4/tests/test_kernel_outer_constants.py +225 -0
- pygpgpu-0.2.4/tests/test_kernel_outer_scope.py +435 -0
- pygpgpu-0.2.4/tests/test_kernel_print_fstrings.py +177 -0
- pygpgpu-0.2.4/tests/test_kernel_prototype_block_scope.py +148 -0
- pygpgpu-0.2.4/tests/test_kernel_raise_assert.py +154 -0
- pygpgpu-0.2.4/tests/test_kernel_rank_mismatch.py +183 -0
- pygpgpu-0.2.4/tests/test_kernel_regressions.py +323 -0
- pygpgpu-0.2.4/tests/test_kernel_regressions_objects.py +284 -0
- pygpgpu-0.2.4/tests/test_kernel_regressions_types.py +260 -0
- pygpgpu-0.2.4/tests/test_kernel_reserved_names.py +261 -0
- pygpgpu-0.2.4/tests/test_kernel_return_positions.py +75 -0
- pygpgpu-0.2.4/tests/test_kernel_returns.py +446 -0
- pygpgpu-0.2.4/tests/test_kernel_sequence_arguments.py +242 -0
- pygpgpu-0.2.4/tests/test_kernel_serial_loop_above_dispatch.py +68 -0
- pygpgpu-0.2.4/tests/test_kernel_shared_device_helpers.py +180 -0
- pygpgpu-0.2.4/tests/test_kernel_shared_shape_parameter.py +115 -0
- pygpgpu-0.2.4/tests/test_kernel_silent_wrong_answer.py +151 -0
- pygpgpu-0.2.4/tests/test_kernel_struct_types.py +331 -0
- pygpgpu-0.2.4/tests/test_kernel_subclass_override.py +73 -0
- pygpgpu-0.2.4/tests/test_kernel_threads.py +132 -0
- pygpgpu-0.2.4/tests/test_kernel_type_map.py +369 -0
- pygpgpu-0.2.4/tests/test_kernel_typing.py +207 -0
- pygpgpu-0.2.4/tests/test_kernel_vector_floor_ops.py +363 -0
- pygpgpu-0.2.4/tests/test_kernel_vector_layout.py +310 -0
- pygpgpu-0.2.4/tests/test_kernel_vector_widening_construction.py +286 -0
- pygpgpu-0.2.4/tests/test_kernel_wide_vector_refusal.py +99 -0
- pygpgpu-0.2.4/tests/test_narrow_integer_stores.py +102 -0
- pygpgpu-0.2.4/tests/test_native_recursion.py +490 -0
- pygpgpu-0.2.4/tests/test_native_recursion_shapes.py +187 -0
- pygpgpu-0.2.4/tests/test_nested_argument_positions.py +89 -0
- pygpgpu-0.2.4/tests/test_opencl_binary_cache.py +74 -0
- pygpgpu-0.2.4/tests/test_phase_complex.py +30 -0
- pygpgpu-0.2.4/tests/test_phase_readback.py +228 -0
- pygpgpu-0.2.4/tests/test_pooled_buffer_claims.py +99 -0
- pygpgpu-0.2.4/tests/test_print_format_spec.py +172 -0
- pygpgpu-0.2.4/tests/test_print_info_setting.py +161 -0
- pygpgpu-0.2.4/tests/test_probe_order.py +71 -0
- pygpgpu-0.2.4/tests/test_sci_math_hip.py +212 -0
- pygpgpu-0.2.4/tests/test_suspended_recursion.py +139 -0
- pygpgpu-0.2.4/tests/test_tail_recursion.py +355 -0
- pygpgpu-0.2.4/tests/test_tree_extraction.py +154 -0
- pygpgpu-0.2.4/tests/test_vector_aliases.py +48 -0
- pygpgpu-0.2.2/MANIFEST.in +0 -14
- pygpgpu-0.2.2/PKG-INFO +0 -1000
- pygpgpu-0.2.2/README.md +0 -937
- pygpgpu-0.2.2/README.zh-CN.md +0 -891
- pygpgpu-0.2.2/examples/01_basic_kernel.py +0 -61
- pygpgpu-0.2.2/examples/02_backend_device_selection.py +0 -64
- pygpgpu-0.2.2/examples/03_nd_loop_and_class_method.py +0 -140
- pygpgpu-0.2.2/examples/04_vector_types.py +0 -67
- pygpgpu-0.2.2/examples/05_gnp_zero_copy_and_atomics.py +0 -116
- pygpgpu-0.2.2/examples/06_handwritten_kernels.py +0 -76
- pygpgpu-0.2.2/examples/07_low_level_oop.py +0 -67
- pygpgpu-0.2.2/examples/08_compare_backends.py +0 -78
- pygpgpu-0.2.2/examples/09_reduction.py +0 -159
- pygpgpu-0.2.2/examples/10_async_launch.py +0 -72
- pygpgpu-0.2.2/examples/11_python_backend.py +0 -83
- pygpgpu-0.2.2/examples/11_returns_and_scope.py +0 -109
- pygpgpu-0.2.2/examples/12_print_in_kernel.py +0 -71
- pygpgpu-0.2.2/examples/13_image.py +0 -187
- pygpgpu-0.2.2/examples/14_heterogeneous_data.py +0 -341
- pygpgpu-0.2.2/examples/15_kernel_import.py +0 -129
- pygpgpu-0.2.2/examples/16_scientific_math.py +0 -63
- pygpgpu-0.2.2/examples/GPU-Puzzles/Puzzle1_Map.py +0 -35
- pygpgpu-0.2.2/examples/GPU-Puzzles/Puzzle2_Zip.py +0 -37
- pygpgpu-0.2.2/examples/GPU-Puzzles/Puzzle3_Guards.py +0 -37
- pygpgpu-0.2.2/examples/GPU-Puzzles/Puzzle4_Map2D.py +0 -37
- pygpgpu-0.2.2/examples/GPU-Puzzles/Puzzle5_Broadcast.py +0 -40
- pygpgpu-0.2.2/examples/GPU-Puzzles/Puzzle6_Blocks.py +0 -37
- pygpgpu-0.2.2/examples/GPU-Puzzles/Puzzle7_Blocks2D.py +0 -38
- pygpgpu-0.2.2/examples/GPU-Puzzles/Puzzle8_Shared.py +0 -48
- pygpgpu-0.2.2/examples/GPU-Puzzles/Puzzle9_Pooling.py +0 -0
- pygpgpu-0.2.2/examples/GPU-Puzzles/__cucache__/pykernels/Puzzle1_Map.cu +0 -21
- pygpgpu-0.2.2/examples/GPU-Puzzles/__cucache__/pykernels/Puzzle2_Zip.cu +0 -22
- pygpgpu-0.2.2/examples/GPU-Puzzles/__cucache__/pykernels/Puzzle3_Guards.cu +0 -26
- pygpgpu-0.2.2/examples/GPU-Puzzles/__cucache__/pykernels/Puzzle4_Map2D.cu +0 -29
- pygpgpu-0.2.2/examples/GPU-Puzzles/__cucache__/pykernels/Puzzle5_Broadcast.cu +0 -29
- pygpgpu-0.2.2/examples/GPU-Puzzles/__cucache__/pykernels/Puzzle6_Blocks.cu +0 -26
- pygpgpu-0.2.2/examples/GPU-Puzzles/__cucache__/pykernels/Puzzle7_Blocks2D.cu +0 -29
- pygpgpu-0.2.2/examples/GPU-Puzzles/__cucache__/pykernels/Puzzle8_Shared.cu +0 -34
- pygpgpu-0.2.2/examples/README.md +0 -82
- pygpgpu-0.2.2/examples/README.zh-CN.md +0 -66
- pygpgpu-0.2.2/examples/digital_image_processing/01_image_sampling.py +0 -12
- pygpgpu-0.2.2/examples/digital_image_processing/02_image_quantify.py +0 -11
- pygpgpu-0.2.2/examples/digital_image_processing/03_image_brightness_adjustment.py +0 -11
- pygpgpu-0.2.2/examples/digital_image_processing/04_image_contrast_adjustment.py +0 -11
- pygpgpu-0.2.2/examples/digital_image_processing/05_swap_channels.py +0 -10
- pygpgpu-0.2.2/examples/digital_image_processing/06_merge_images.py +0 -12
- pygpgpu-0.2.2/examples/digital_image_processing/07_gamma.py +0 -10
- pygpgpu-0.2.2/examples/digital_image_processing/__clcache__/pykernels/image_processing.cl +0 -45
- pygpgpu-0.2.2/examples/digital_image_processing/__cucache__/pykernels/image_processing.cu +0 -46
- pygpgpu-0.2.2/examples/digital_image_processing/__hipcache__/pykernels/__hipcache__/AMD Radeon(TM) 610M gfx1036/image_processing.hip_5f2fc99ee13d66d4837d4cafdf514803_clean.hip +0 -44
- pygpgpu-0.2.2/examples/digital_image_processing/__hipcache__/pykernels/image_processing.hip +0 -43
- pygpgpu-0.2.2/examples/digital_image_processing/image_processing.py +0 -154
- pygpgpu-0.2.2/examples/kernel_import/README.md +0 -45
- pygpgpu-0.2.2/examples/kernel_import/__hipcache__/AMD Radeon(TM) 610M gfx1036/vecops.hip_2cec05837e5f9def95fd37d804cdd3eb_clean.hip +0 -51
- pygpgpu-0.2.2/examples/kernel_import/__init__.py +0 -17
- pygpgpu-0.2.2/examples/kernel_import/vecops.cl +0 -58
- pygpgpu-0.2.2/examples/kernel_import/vecops.cu +0 -45
- pygpgpu-0.2.2/examples/kernel_import/vecops.hip +0 -47
- pygpgpu-0.2.2/examples/ray_tarcing_in_one_weekend/01_first_image.py +0 -26
- pygpgpu-0.2.2/examples/ray_tarcing_in_one_weekend/camera.py +0 -89
- pygpgpu-0.2.2/examples/ray_tarcing_in_one_weekend/hittable.py +0 -27
- pygpgpu-0.2.2/examples/ray_tarcing_in_one_weekend/interval.py +0 -31
- pygpgpu-0.2.2/examples/ray_tarcing_in_one_weekend/main.py +0 -16
- pygpgpu-0.2.2/examples/ray_tarcing_in_one_weekend/ray.py +0 -11
- pygpgpu-0.2.2/examples/ray_tarcing_in_one_weekend/scene.py +0 -41
- pygpgpu-0.2.2/examples/ray_tarcing_in_one_weekend/sphere.py +0 -44
- pygpgpu-0.2.2/examples/ray_tarcing_in_one_weekend/utils.py +0 -20
- pygpgpu-0.2.2/examples/vecadd.cl +0 -37
- pygpgpu-0.2.2/pygpgpu/__init__.py +0 -190
- pygpgpu-0.2.2/pygpgpu/constants.py +0 -107
- pygpgpu-0.2.2/pygpgpu/cparser/ShaderBuiltins.py +0 -16874
- pygpgpu-0.2.2/pygpgpu/cparser/__init__.py +0 -4
- pygpgpu-0.2.2/pygpgpu/cparser/cparser.py +0 -1200
- pygpgpu-0.2.2/pygpgpu/cparser/cpreprocessor.py +0 -135
- pygpgpu-0.2.2/pygpgpu/cparser/csyntaxtree.py +0 -88
- pygpgpu-0.2.2/pygpgpu/cparser/ctokens.py +0 -319
- pygpgpu-0.2.2/pygpgpu/cparser/minifyc.py +0 -311
- pygpgpu-0.2.2/pygpgpu/cparser/ts_parser.py +0 -813
- pygpgpu-0.2.2/pygpgpu/cuda/driver/cuda.py +0 -246
- pygpgpu-0.2.2/pygpgpu/cuda/driver/cuinfo.py +0 -892
- pygpgpu-0.2.2/pygpgpu/cuda/driver/cutypes.py +0 -611
- pygpgpu-0.2.2/pygpgpu/cuda/driver/nvrtc.py +0 -277
- pygpgpu-0.2.2/pygpgpu/cuda/driver/vec_types/char3.py +0 -15
- pygpgpu-0.2.2/pygpgpu/cuda/driver/vec_types/double3.py +0 -15
- pygpgpu-0.2.2/pygpgpu/cuda/driver/vec_types/float3.py +0 -15
- pygpgpu-0.2.2/pygpgpu/cuda/driver/vec_types/int3.py +0 -15
- pygpgpu-0.2.2/pygpgpu/cuda/driver/vec_types/long2.py +0 -14
- pygpgpu-0.2.2/pygpgpu/cuda/driver/vec_types/long3.py +0 -15
- pygpgpu-0.2.2/pygpgpu/cuda/driver/vec_types/long4.py +0 -16
- pygpgpu-0.2.2/pygpgpu/cuda/driver/vec_types/short3.py +0 -15
- pygpgpu-0.2.2/pygpgpu/cuda/driver/vec_types/uchar3.py +0 -15
- pygpgpu-0.2.2/pygpgpu/cuda/driver/vec_types/uint3.py +0 -15
- pygpgpu-0.2.2/pygpgpu/cuda/driver/vec_types/ulong2.py +0 -14
- pygpgpu-0.2.2/pygpgpu/cuda/driver/vec_types/ulong3.py +0 -15
- pygpgpu-0.2.2/pygpgpu/cuda/driver/vec_types/ulong4.py +0 -16
- pygpgpu-0.2.2/pygpgpu/cuda/driver/vec_types/ushort3.py +0 -15
- pygpgpu-0.2.2/pygpgpu/cuda/libraries/__init__.py +0 -117
- pygpgpu-0.2.2/pygpgpu/cuda/libraries/_base.py +0 -375
- pygpgpu-0.2.2/pygpgpu/cuda/libraries/cublas.py +0 -425
- pygpgpu-0.2.2/pygpgpu/cuda/libraries/cublaslt.py +0 -356
- pygpgpu-0.2.2/pygpgpu/cuda/libraries/cudart.py +0 -403
- pygpgpu-0.2.2/pygpgpu/cuda/libraries/cufft.py +0 -219
- pygpgpu-0.2.2/pygpgpu/cuda/libraries/cusolver.py +0 -373
- pygpgpu-0.2.2/pygpgpu/cuda/libraries/cusparse.py +0 -343
- pygpgpu-0.2.2/pygpgpu/cuda/libraries/wrappers.py +0 -818
- pygpgpu-0.2.2/pygpgpu/cuda/oop/array.py +0 -279
- pygpgpu-0.2.2/pygpgpu/cuda/oop/buffer.py +0 -85
- pygpgpu-0.2.2/pygpgpu/cuda/oop/context.py +0 -559
- pygpgpu-0.2.2/pygpgpu/cuda/oop/cuobject.py +0 -176
- pygpgpu-0.2.2/pygpgpu/cuda/oop/device.py +0 -88
- pygpgpu-0.2.2/pygpgpu/cuda/oop/devices.py +0 -92
- pygpgpu-0.2.2/pygpgpu/cuda/oop/event.py +0 -55
- pygpgpu-0.2.2/pygpgpu/cuda/oop/kernel.py +0 -774
- pygpgpu-0.2.2/pygpgpu/cuda/oop/mem_object.py +0 -151
- pygpgpu-0.2.2/pygpgpu/cuda/oop/nvrtc_program.py +0 -231
- pygpgpu-0.2.2/pygpgpu/cuda/oop/program.py +0 -135
- pygpgpu-0.2.2/pygpgpu/cuda/oop/program_info.py +0 -223
- pygpgpu-0.2.2/pygpgpu/cuda/oop/program_parser.py +0 -567
- pygpgpu-0.2.2/pygpgpu/cuda/oop/stream.py +0 -134
- pygpgpu-0.2.2/pygpgpu/cuda/oop/surface.py +0 -70
- pygpgpu-0.2.2/pygpgpu/cuda/oop/texture.py +0 -111
- pygpgpu-0.2.2/pygpgpu/hip/driver/hip.py +0 -264
- pygpgpu-0.2.2/pygpgpu/hip/driver/hipinfo.py +0 -185
- pygpgpu-0.2.2/pygpgpu/hip/oop/buffer.py +0 -85
- pygpgpu-0.2.2/pygpgpu/hip/oop/context.py +0 -212
- pygpgpu-0.2.2/pygpgpu/hip/oop/devices.py +0 -93
- pygpgpu-0.2.2/pygpgpu/hip/oop/hip_compiler.py +0 -238
- pygpgpu-0.2.2/pygpgpu/hip/oop/hipobject.py +0 -161
- pygpgpu-0.2.2/pygpgpu/hip/oop/kernel.py +0 -650
- pygpgpu-0.2.2/pygpgpu/hip/oop/mem_object.py +0 -148
- pygpgpu-0.2.2/pygpgpu/hip/oop/program.py +0 -142
- pygpgpu-0.2.2/pygpgpu/hip/oop/program_info.py +0 -200
- pygpgpu-0.2.2/pygpgpu/hip/oop/program_parser.py +0 -570
- pygpgpu-0.2.2/pygpgpu/hip/oop/stream.py +0 -131
- pygpgpu-0.2.2/pygpgpu/image.py +0 -562
- pygpgpu-0.2.2/pygpgpu/kernel/__init__.py +0 -23
- pygpgpu-0.2.2/pygpgpu/kernel/builtin_registry.py +0 -42
- pygpgpu-0.2.2/pygpgpu/kernel/builtins.py +0 -580
- pygpgpu-0.2.2/pygpgpu/kernel/decorator.py +0 -3263
- pygpgpu-0.2.2/pygpgpu/kernel/device_builtins.py +0 -547
- pygpgpu-0.2.2/pygpgpu/kernel/device_library.py +0 -216
- pygpgpu-0.2.2/pygpgpu/kernel/host_runtime.py +0 -130
- pygpgpu-0.2.2/pygpgpu/kernel/include/quat.h +0 -276
- pygpgpu-0.2.2/pygpgpu/kernel/metal_codegen.py +0 -113
- pygpgpu-0.2.2/pygpgpu/kernel/objects.py +0 -1576
- pygpgpu-0.2.2/pygpgpu/kernel/python_backend.py +0 -638
- pygpgpu-0.2.2/pygpgpu/kernel/quaternion.py +0 -210
- pygpgpu-0.2.2/pygpgpu/kernel/sci_math.py +0 -608
- pygpgpu-0.2.2/pygpgpu/kernel/source_paths.py +0 -640
- pygpgpu-0.2.2/pygpgpu/kernel/structs.py +0 -644
- pygpgpu-0.2.2/pygpgpu/kernel/translator.py +0 -8494
- pygpgpu-0.2.2/pygpgpu/kernel_import.py +0 -642
- pygpgpu-0.2.2/pygpgpu/kernel_import_stub.py +0 -172
- pygpgpu-0.2.2/pygpgpu/metal/__init__.py +0 -8
- pygpgpu-0.2.2/pygpgpu/metal/driver/__init__.py +0 -2
- pygpgpu-0.2.2/pygpgpu/metal/driver/metal.py +0 -193
- pygpgpu-0.2.2/pygpgpu/metal/driver/objc.py +0 -148
- pygpgpu-0.2.2/pygpgpu/metal/oop/__init__.py +0 -3
- pygpgpu-0.2.2/pygpgpu/metal/oop/buffer.py +0 -196
- pygpgpu-0.2.2/pygpgpu/metal/oop/context.py +0 -99
- pygpgpu-0.2.2/pygpgpu/metal/oop/devices.py +0 -145
- pygpgpu-0.2.2/pygpgpu/metal/oop/event.py +0 -44
- pygpgpu-0.2.2/pygpgpu/metal/oop/kernel.py +0 -308
- pygpgpu-0.2.2/pygpgpu/metal/oop/metalobject.py +0 -69
- pygpgpu-0.2.2/pygpgpu/metal/oop/program.py +0 -123
- pygpgpu-0.2.2/pygpgpu/metal/oop/program_info.py +0 -163
- pygpgpu-0.2.2/pygpgpu/metal/oop/program_parser.py +0 -199
- pygpgpu-0.2.2/pygpgpu/numpy/__init__.py +0 -9
- pygpgpu-0.2.2/pygpgpu/numpy/array_creation.py +0 -83
- pygpgpu-0.2.2/pygpgpu/numpy/ndarray.py +0 -282
- pygpgpu-0.2.2/pygpgpu/opencl/driver/cl.py +0 -250
- pygpgpu-0.2.2/pygpgpu/opencl/driver/clinfo.py +0 -1913
- pygpgpu-0.2.2/pygpgpu/opencl/driver/cltypes.py +0 -964
- pygpgpu-0.2.2/pygpgpu/opencl/driver/vec_types/__init__.py +0 -29
- pygpgpu-0.2.2/pygpgpu/opencl/driver/vec_types/char3.py +0 -16
- pygpgpu-0.2.2/pygpgpu/opencl/driver/vec_types/double3.py +0 -16
- pygpgpu-0.2.2/pygpgpu/opencl/driver/vec_types/float3.py +0 -16
- pygpgpu-0.2.2/pygpgpu/opencl/driver/vec_types/int3.py +0 -16
- pygpgpu-0.2.2/pygpgpu/opencl/driver/vec_types/long16.py +0 -28
- pygpgpu-0.2.2/pygpgpu/opencl/driver/vec_types/long16.pyi +0 -192
- pygpgpu-0.2.2/pygpgpu/opencl/driver/vec_types/long2.py +0 -14
- pygpgpu-0.2.2/pygpgpu/opencl/driver/vec_types/long3.py +0 -16
- pygpgpu-0.2.2/pygpgpu/opencl/driver/vec_types/long4.py +0 -16
- pygpgpu-0.2.2/pygpgpu/opencl/driver/vec_types/long8.py +0 -20
- pygpgpu-0.2.2/pygpgpu/opencl/driver/vec_types/long8.pyi +0 -108
- pygpgpu-0.2.2/pygpgpu/opencl/driver/vec_types/short3.py +0 -16
- pygpgpu-0.2.2/pygpgpu/opencl/driver/vec_types/uchar3.py +0 -16
- pygpgpu-0.2.2/pygpgpu/opencl/driver/vec_types/uint3.py +0 -16
- pygpgpu-0.2.2/pygpgpu/opencl/driver/vec_types/ulong16.py +0 -28
- pygpgpu-0.2.2/pygpgpu/opencl/driver/vec_types/ulong16.pyi +0 -192
- pygpgpu-0.2.2/pygpgpu/opencl/driver/vec_types/ulong2.py +0 -14
- pygpgpu-0.2.2/pygpgpu/opencl/driver/vec_types/ulong3.py +0 -16
- pygpgpu-0.2.2/pygpgpu/opencl/driver/vec_types/ulong4.py +0 -16
- pygpgpu-0.2.2/pygpgpu/opencl/driver/vec_types/ulong8.py +0 -20
- pygpgpu-0.2.2/pygpgpu/opencl/driver/vec_types/ulong8.pyi +0 -108
- pygpgpu-0.2.2/pygpgpu/opencl/driver/vec_types/ushort3.py +0 -16
- pygpgpu-0.2.2/pygpgpu/opencl/oop/buffer.py +0 -143
- pygpgpu-0.2.2/pygpgpu/opencl/oop/clobject.py +0 -176
- pygpgpu-0.2.2/pygpgpu/opencl/oop/command_queue.py +0 -85
- pygpgpu-0.2.2/pygpgpu/opencl/oop/context.py +0 -463
- pygpgpu-0.2.2/pygpgpu/opencl/oop/device.py +0 -63
- pygpgpu-0.2.2/pygpgpu/opencl/oop/event.py +0 -215
- pygpgpu-0.2.2/pygpgpu/opencl/oop/kernel.py +0 -759
- pygpgpu-0.2.2/pygpgpu/opencl/oop/mem_object.py +0 -147
- pygpgpu-0.2.2/pygpgpu/opencl/oop/platform.py +0 -157
- pygpgpu-0.2.2/pygpgpu/opencl/oop/platforms.py +0 -92
- pygpgpu-0.2.2/pygpgpu/opencl/oop/program.py +0 -369
- pygpgpu-0.2.2/pygpgpu/opencl/oop/program_info.py +0 -222
- pygpgpu-0.2.2/pygpgpu/opencl/oop/program_parser.py +0 -592
- pygpgpu-0.2.2/pygpgpu/opencl/oop/sampler.py +0 -83
- pygpgpu-0.2.2/pygpgpu/opencl/oop/struct_layout.py +0 -122
- pygpgpu-0.2.2/pygpgpu/utils.py +0 -538
- pygpgpu-0.2.2/pygpgpu/vec_types/__init__.py +0 -66
- pygpgpu-0.2.2/pygpgpu/vec_types/char16.py +0 -28
- pygpgpu-0.2.2/pygpgpu/vec_types/char16.pyi +0 -192
- pygpgpu-0.2.2/pygpgpu/vec_types/char2.py +0 -14
- pygpgpu-0.2.2/pygpgpu/vec_types/char2.pyi +0 -320
- pygpgpu-0.2.2/pygpgpu/vec_types/char4.py +0 -16
- pygpgpu-0.2.2/pygpgpu/vec_types/char4.pyi +0 -3652
- pygpgpu-0.2.2/pygpgpu/vec_types/char8.py +0 -20
- pygpgpu-0.2.2/pygpgpu/vec_types/char8.pyi +0 -108
- pygpgpu-0.2.2/pygpgpu/vec_types/double16.py +0 -28
- pygpgpu-0.2.2/pygpgpu/vec_types/double16.pyi +0 -192
- pygpgpu-0.2.2/pygpgpu/vec_types/double8.py +0 -20
- pygpgpu-0.2.2/pygpgpu/vec_types/double8.pyi +0 -108
- pygpgpu-0.2.2/pygpgpu/vec_types/float16.py +0 -28
- pygpgpu-0.2.2/pygpgpu/vec_types/float16.pyi +0 -192
- pygpgpu-0.2.2/pygpgpu/vec_types/float8.py +0 -20
- pygpgpu-0.2.2/pygpgpu/vec_types/float8.pyi +0 -108
- pygpgpu-0.2.2/pygpgpu/vec_types/funcs.py +0 -229
- pygpgpu-0.2.2/pygpgpu/vec_types/genVec.py +0 -387
- pygpgpu-0.2.2/pygpgpu/vec_types/genVec16.py +0 -18
- pygpgpu-0.2.2/pygpgpu/vec_types/genVec16.pyi.in +0 -13
- pygpgpu-0.2.2/pygpgpu/vec_types/genVec2.py +0 -13
- pygpgpu-0.2.2/pygpgpu/vec_types/genVec2.pyi.in +0 -15
- pygpgpu-0.2.2/pygpgpu/vec_types/genVec3.py +0 -13
- pygpgpu-0.2.2/pygpgpu/vec_types/genVec3.pyi.in +0 -16
- pygpgpu-0.2.2/pygpgpu/vec_types/genVec4.py +0 -13
- pygpgpu-0.2.2/pygpgpu/vec_types/genVec4.pyi.in +0 -17
- pygpgpu-0.2.2/pygpgpu/vec_types/genVec8.py +0 -14
- pygpgpu-0.2.2/pygpgpu/vec_types/genVec8.pyi.in +0 -13
- pygpgpu-0.2.2/pygpgpu/vec_types/helper.py +0 -167
- pygpgpu-0.2.2/pygpgpu/vec_types/int16.py +0 -28
- pygpgpu-0.2.2/pygpgpu/vec_types/int16.pyi +0 -192
- pygpgpu-0.2.2/pygpgpu/vec_types/int8.py +0 -20
- pygpgpu-0.2.2/pygpgpu/vec_types/int8.pyi +0 -108
- pygpgpu-0.2.2/pygpgpu/vec_types/layout.py +0 -481
- pygpgpu-0.2.2/pygpgpu/vec_types/short16.py +0 -28
- pygpgpu-0.2.2/pygpgpu/vec_types/short16.pyi +0 -192
- pygpgpu-0.2.2/pygpgpu/vec_types/short2.py +0 -14
- pygpgpu-0.2.2/pygpgpu/vec_types/short2.pyi +0 -320
- pygpgpu-0.2.2/pygpgpu/vec_types/short4.py +0 -16
- pygpgpu-0.2.2/pygpgpu/vec_types/short4.pyi +0 -3652
- pygpgpu-0.2.2/pygpgpu/vec_types/short8.py +0 -20
- pygpgpu-0.2.2/pygpgpu/vec_types/short8.pyi +0 -108
- pygpgpu-0.2.2/pygpgpu/vec_types/uchar16.py +0 -28
- pygpgpu-0.2.2/pygpgpu/vec_types/uchar16.pyi +0 -192
- pygpgpu-0.2.2/pygpgpu/vec_types/uchar2.py +0 -14
- pygpgpu-0.2.2/pygpgpu/vec_types/uchar2.pyi +0 -320
- pygpgpu-0.2.2/pygpgpu/vec_types/uchar4.py +0 -16
- pygpgpu-0.2.2/pygpgpu/vec_types/uchar4.pyi +0 -3652
- pygpgpu-0.2.2/pygpgpu/vec_types/uchar8.py +0 -20
- pygpgpu-0.2.2/pygpgpu/vec_types/uchar8.pyi +0 -108
- pygpgpu-0.2.2/pygpgpu/vec_types/uint16.py +0 -28
- pygpgpu-0.2.2/pygpgpu/vec_types/uint16.pyi +0 -192
- pygpgpu-0.2.2/pygpgpu/vec_types/uint8.py +0 -20
- pygpgpu-0.2.2/pygpgpu/vec_types/uint8.pyi +0 -108
- pygpgpu-0.2.2/pygpgpu/vec_types/ushort16.py +0 -28
- pygpgpu-0.2.2/pygpgpu/vec_types/ushort16.pyi +0 -192
- pygpgpu-0.2.2/pygpgpu/vec_types/ushort2.py +0 -14
- pygpgpu-0.2.2/pygpgpu/vec_types/ushort2.pyi +0 -320
- pygpgpu-0.2.2/pygpgpu/vec_types/ushort4.py +0 -16
- pygpgpu-0.2.2/pygpgpu/vec_types/ushort4.pyi +0 -3652
- pygpgpu-0.2.2/pygpgpu/vec_types/ushort8.py +0 -20
- pygpgpu-0.2.2/pygpgpu/vec_types/ushort8.pyi +0 -108
- pygpgpu-0.2.2/pygpgpu.egg-info/PKG-INFO +0 -1000
- pygpgpu-0.2.2/pygpgpu.egg-info/SOURCES.txt +0 -436
- pygpgpu-0.2.2/pygpgpu.egg-info/requires.txt +0 -12
- pygpgpu-0.2.2/pyproject.toml +0 -214
- pygpgpu-0.2.2/tests/test_builtins.py +0 -282
- pygpgpu-0.2.2/tests/test_cuda_libraries.py +0 -672
- pygpgpu-0.2.2/tests/test_driver_background_init.py +0 -127
- pygpgpu-0.2.2/tests/test_kernel_argument_errors.py +0 -338
- pygpgpu-0.2.2/tests/test_kernel_atomic_augassign.py +0 -242
- pygpgpu-0.2.2/tests/test_kernel_copy_policy.py +0 -81
- pygpgpu-0.2.2/tests/test_kernel_ctypes_structures.py +0 -332
- pygpgpu-0.2.2/tests/test_kernel_generated_source_cache.py +0 -165
- pygpgpu-0.2.2/tests/test_kernel_host_regions.py +0 -110
- pygpgpu-0.2.2/tests/test_kernel_local_memory.py +0 -306
- pygpgpu-0.2.2/tests/test_kernel_narrow_arguments.py +0 -78
- pygpgpu-0.2.2/tests/test_kernel_ndindex_forms.py +0 -141
- pygpgpu-0.2.2/tests/test_kernel_nested_launch.py +0 -275
- pygpgpu-0.2.2/tests/test_kernel_object_arguments.py +0 -529
- pygpgpu-0.2.2/tests/test_kernel_outer_scope.py +0 -366
- pygpgpu-0.2.2/tests/test_kernel_rank_mismatch.py +0 -125
- pygpgpu-0.2.2/tests/test_kernel_returns.py +0 -389
- pygpgpu-0.2.2/tests/test_kernel_serial_loop_above_dispatch.py +0 -68
- pygpgpu-0.2.2/tests/test_kernel_struct_types.py +0 -276
- pygpgpu-0.2.2/tests/test_kernel_typing.py +0 -204
- pygpgpu-0.2.2/tests/test_kernel_vector_layout.py +0 -307
- pygpgpu-0.2.2/tests/test_metal_codegen.py +0 -427
- pygpgpu-0.2.2/tests/test_metal_launch_path.py +0 -302
- pygpgpu-0.2.2/tests/test_sci_math_hip.py +0 -205
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/LICENSE +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/cparser/generate_code.py +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/cparser/pcpp/__init__.py +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/cparser/pcpp/evaluator.py +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/cparser/pcpp/lextab.py +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/cparser/pcpp/parser.py +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/cparser/pcpp/parsetab.py +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/cparser/pcpp/pcmd.py +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/cparser/pcpp/ply/__init__.py +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/cparser/pcpp/ply/cpp.py +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/cparser/pcpp/ply/ctokens.py +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/cparser/pcpp/ply/lex.py +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/cparser/pcpp/ply/yacc.py +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/cparser/pcpp/ply/ygen.py +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/cparser/pcpp/preprocessor.py +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/cuda/__init__.py +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/cuda/driver/__init__.py +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/cuda/driver/cuda.pyi +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/cuda/driver/cudaSurfaceObject_t.py +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/cuda/driver/cudaTextureObject_t.py +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/cuda/driver/image_shape.py +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/cuda/driver/nvrtc.pyi +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/cuda/driver/nvrtcinfo.py +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/cuda/driver/nvrtctypes.py +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/cuda/driver/vec_types/__init__.py +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/cuda/driver/vec_types/char3.pyi +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/cuda/driver/vec_types/double3.pyi +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/cuda/driver/vec_types/float3.pyi +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/cuda/driver/vec_types/int3.pyi +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/cuda/driver/vec_types/long2.pyi +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/cuda/driver/vec_types/long3.pyi +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/cuda/driver/vec_types/long4.pyi +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/cuda/driver/vec_types/short3.pyi +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/cuda/driver/vec_types/uchar3.pyi +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/cuda/driver/vec_types/uint3.pyi +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/cuda/driver/vec_types/ulong2.pyi +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/cuda/driver/vec_types/ulong3.pyi +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/cuda/driver/vec_types/ulong4.pyi +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/cuda/driver/vec_types/ushort3.pyi +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/cuda/oop/__init__.py +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/cuda/oop/build_options.py +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/cuda/oop/device.pyi +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/exceptions.py +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/hip/__init__.py +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/hip/driver/__init__.py +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/hip/driver/hiptypes.py +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/hip/oop/__init__.py +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/hip/oop/build_options.py +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/hip/oop/device.py +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/hip/oop/event.py +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/opencl/__init__.py +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/opencl/driver/__init__.py +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/opencl/driver/cl.pyi +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/opencl/driver/image_types/__init__.py +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/opencl/driver/image_types/image1d_array_t.py +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/opencl/driver/image_types/image1d_t.py +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/opencl/driver/image_types/image2d_array_t.py +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/opencl/driver/image_types/image2d_t.py +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/opencl/driver/image_types/image3d_t.py +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/opencl/driver/image_types/imagend_t.py +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/opencl/driver/image_types/sampler_t.py +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/opencl/driver/vec_types/char3.pyi +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/opencl/driver/vec_types/double3.pyi +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/opencl/driver/vec_types/float3.pyi +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/opencl/driver/vec_types/int3.pyi +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/opencl/driver/vec_types/long2.pyi +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/opencl/driver/vec_types/long3.pyi +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/opencl/driver/vec_types/long4.pyi +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/opencl/driver/vec_types/short3.pyi +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/opencl/driver/vec_types/uchar3.pyi +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/opencl/driver/vec_types/uint3.pyi +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/opencl/driver/vec_types/ulong2.pyi +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/opencl/driver/vec_types/ulong3.pyi +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/opencl/driver/vec_types/ulong4.pyi +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/opencl/driver/vec_types/ushort3.pyi +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/opencl/oop/__init__.py +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/opencl/oop/build_options.py +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/opencl/oop/command_queue.pyi +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/opencl/oop/context.pyi +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/opencl/oop/device.pyi +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/opencl/oop/event.pyi +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/opencl/oop/image1d.py +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/opencl/oop/image1d_array.py +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/opencl/oop/image2d.py +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/opencl/oop/image2d_array.py +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/opencl/oop/image3d.py +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/opencl/oop/imagend.py +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/opencl/oop/kernel.pyi +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/opencl/oop/mem_object.pyi +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/opencl/oop/pipe.py +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/opencl/oop/platform.pyi +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/opencl/oop/program.pyi +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/opencl/oop/sampler.pyi +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/opencl/oop/svm_buffer.py +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu/py.typed +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu.egg-info/dependency_links.txt +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/pygpgpu.egg-info/top_level.txt +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/setup.cfg +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/tests/test_device_library.py +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/tests/test_kernel_aliases_and_ranks.py +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/tests/test_kernel_atomics.py +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/tests/test_kernel_body_arrays.py +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/tests/test_kernel_boolean_ops.py +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/tests/test_kernel_carried_scalar.py +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/tests/test_kernel_clip_where.py +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/tests/test_kernel_comparison_builtins.py +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/tests/test_kernel_creation.py +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/tests/test_kernel_creation_functions.py +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/tests/test_kernel_ctypes_unions_and_enums.py +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/tests/test_kernel_declared_domain.py +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/tests/test_kernel_generated_layout.py +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/tests/test_kernel_generated_spacing.py +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/tests/test_kernel_global_array.py +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/tests/test_kernel_histogram.py +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/tests/test_kernel_host_region_names.py +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/tests/test_kernel_host_write_roundtrip.py +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/tests/test_kernel_import.py +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/tests/test_kernel_inplace_and_containment.py +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/tests/test_kernel_magic_methods.py +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/tests/test_kernel_math_builtins.py +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/tests/test_kernel_method_calls.py +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/tests/test_kernel_narrow_types.py +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/tests/test_kernel_partial_write.py +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/tests/test_kernel_quaternion.py +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/tests/test_kernel_scalar_calls.py +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/tests/test_kernel_shared_scalar.py +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/tests/test_kernel_struct_name_hints.py +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/tests/test_kernel_structure_construction.py +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/tests/test_kernel_tail_region.py +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/tests/test_kernel_translation_switch.py +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/tests/test_kernel_vector3.py +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/tests/test_kernel_vector_arguments.py +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/tests/test_sci_math.py +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/tests/test_vector_array_construction.py +0 -0
- {pygpgpu-0.2.2 → pygpgpu-0.2.4}/tests/test_work_size_bracket.py +0 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Source distribution contents beyond the package itself.
|
|
2
|
+
#
|
|
3
|
+
# examples/ is deliberately NOT included: the sdist ships the installable package
|
|
4
|
+
# only (the wheel installs just the pygpgpu package either way). The numbered
|
|
5
|
+
# scripts remain the project's end-to-end smoke tests and stay in the repository.
|
|
6
|
+
include README.md
|
|
7
|
+
include README.zh-CN.md
|
|
8
|
+
include LICENSE
|
|
9
|
+
|
|
10
|
+
# doc/ is deliberately not included: it holds vendor reference PDFs for the CUDA
|
|
11
|
+
# driver API and NVRTC guides, not project documentation.
|
pygpgpu-0.2.4/PKG-INFO
ADDED
|
@@ -0,0 +1,465 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: pygpgpu
|
|
3
|
+
Version: 0.2.4
|
|
4
|
+
Summary: Run Python functions as GPU kernels with the @kernel decorator (OpenCL / CUDA / HIP / Metal)
|
|
5
|
+
Author-email: "王炳辉 (Bing-Hui WANG)" <binghui.wang@foxmail.com>
|
|
6
|
+
License: MIT License
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2026 王炳辉 (Bing-Hui WANG)
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
+
in the Software without restriction, including without limitation the rights
|
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
+
furnished to do so, subject to the following conditions:
|
|
16
|
+
|
|
17
|
+
The above copyright notice and this permission notice shall be included in all
|
|
18
|
+
copies or substantial portions of the Software.
|
|
19
|
+
|
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
26
|
+
SOFTWARE.
|
|
27
|
+
|
|
28
|
+
Project-URL: Homepage, https://github.com/Time-Coder/PyGPGPU
|
|
29
|
+
Keywords: gpu,opencl,cuda,hip,rocm,metal,kernel,jit
|
|
30
|
+
Classifier: Development Status :: 3 - Alpha
|
|
31
|
+
Classifier: Intended Audience :: Developers
|
|
32
|
+
Classifier: Intended Audience :: Science/Research
|
|
33
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
34
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
35
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
36
|
+
Classifier: Programming Language :: Python :: 3
|
|
37
|
+
Classifier: Programming Language :: Python :: 3.7
|
|
38
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
39
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
40
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
41
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
42
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
43
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
44
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
45
|
+
Classifier: Topic :: Scientific/Engineering
|
|
46
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
47
|
+
Classifier: Typing :: Typed
|
|
48
|
+
Requires-Python: >=3.7
|
|
49
|
+
Description-Content-Type: text/markdown
|
|
50
|
+
License-File: LICENSE
|
|
51
|
+
Requires-Dist: numpy>=1.21
|
|
52
|
+
Requires-Dist: imageio>=2.30
|
|
53
|
+
Requires-Dist: tree-sitter>=0.20.0
|
|
54
|
+
Requires-Dist: tree-sitter-opencl>=0.0.4
|
|
55
|
+
Requires-Dist: tree-sitter-cuda37>=0.21.4
|
|
56
|
+
Requires-Dist: tree-sitter-metal>=0.1.1
|
|
57
|
+
Requires-Dist: pygf>=0.6.0
|
|
58
|
+
Requires-Dist: typing_extensions>=4.4.0
|
|
59
|
+
Provides-Extra: dev
|
|
60
|
+
Requires-Dist: pytest>=8; extra == "dev"
|
|
61
|
+
Requires-Dist: ruff>=0.9; extra == "dev"
|
|
62
|
+
Requires-Dist: ty>=0.0.60; extra == "dev"
|
|
63
|
+
Requires-Dist: PySide6; extra == "dev"
|
|
64
|
+
Requires-Dist: scikit-image; extra == "dev"
|
|
65
|
+
Dynamic: license-file
|
|
66
|
+
|
|
67
|
+
<div align="center">
|
|
68
|
+
|
|
69
|
+
<img src="https://raw.githubusercontent.com/Time-Coder/PyGPGPU/main/docs/logo/pygpgpu_256.png" alt="PyGPGPU logo" width="200"/>
|
|
70
|
+
|
|
71
|
+
# PyGPGPU
|
|
72
|
+
|
|
73
|
+
**English** | [Chinese](README.zh-CN.md)
|
|
74
|
+
|
|
75
|
+
</div>
|
|
76
|
+
|
|
77
|
+
Decorate a Python function with `@kernel` and it runs on the GPU — one codebase, four backends (**OpenCL / CUDA / HIP / Metal**), plus a serial interpreter backend for the CPU.
|
|
78
|
+
|
|
79
|
+
```python
|
|
80
|
+
import numpy as np
|
|
81
|
+
from pygpgpu import kernel
|
|
82
|
+
|
|
83
|
+
@kernel
|
|
84
|
+
def saxpy(x: np.ndarray, y: np.ndarray, alpha: float) -> np.ndarray:
|
|
85
|
+
out = np.zeros_like(x)
|
|
86
|
+
for i in range(out.shape[0]):
|
|
87
|
+
out[i] = x[i] * alpha + y[i]
|
|
88
|
+
|
|
89
|
+
return out
|
|
90
|
+
|
|
91
|
+
x = np.arange(1_000_000, dtype=np.float32)
|
|
92
|
+
|
|
93
|
+
out = saxpy(x, x, 2.0) # no backend given: probe in DEFAULT_BACKEND_ORDER (Metal first on macOS)
|
|
94
|
+
out = saxpy["cuda:0"](x, x, 2.0) # the bracket switches backend per call
|
|
95
|
+
out = saxpy["hip:0"](x, x, 2.0) # backend:device
|
|
96
|
+
out = saxpy["opencl:0"](x, x, 2.0)
|
|
97
|
+
out = saxpy["python"](x, x, 2.0) # the same function, serially in the interpreter
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
No GPU code to write, no memory copies to manage, no work sizes to compute — call it like an ordinary function and the top-level `for` loop is parallelized on the GPU. The first call translates, compiles and caches; every later call is free.
|
|
101
|
+
|
|
102
|
+
A whole Mandelbrot renderer in plain Python ([examples/fractal/Mandelbrot.py](examples/fractal/Mandelbrot.py)): the helpers are ordinary functions, the palette returns a `float3` vector, `@kernel(float=np.float64)` runs it in double precision, and the image is the return value:
|
|
103
|
+
|
|
104
|
+

|
|
105
|
+
|
|
106
|
+
```python
|
|
107
|
+
import numpy as np
|
|
108
|
+
from numpy.typing import NDArray
|
|
109
|
+
from pygpgpu import kernel, float3
|
|
110
|
+
import imageio.v3 as iio
|
|
111
|
+
import math
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
def escape_steps(c: complex, max_iter: int) -> int:
|
|
115
|
+
zn = 0j
|
|
116
|
+
abs_zn = abs(zn)
|
|
117
|
+
n: int = 0
|
|
118
|
+
while abs_zn <= 2 and n < max_iter:
|
|
119
|
+
zn = zn**2 + c
|
|
120
|
+
abs_zn = abs(zn)
|
|
121
|
+
n += 1
|
|
122
|
+
|
|
123
|
+
return n
|
|
124
|
+
|
|
125
|
+
def palette(x: float)->float3:
|
|
126
|
+
return float3(
|
|
127
|
+
math.exp( - 60 * abs(x-3/4)**3.2 ),
|
|
128
|
+
math.exp( - 60 * abs(x-2/4)**3.2 ),
|
|
129
|
+
math.exp( - 60 * abs(x-1/4)**3.2 )
|
|
130
|
+
)
|
|
131
|
+
|
|
132
|
+
image_width, image_height = 600, 400
|
|
133
|
+
default_pixels_per_value = 150
|
|
134
|
+
max_iter = 890
|
|
135
|
+
|
|
136
|
+
@kernel(float=np.float64)
|
|
137
|
+
def draw_MandelbrotSet(view_center: complex, scale: float) -> NDArray[np.uint8]:
|
|
138
|
+
image = np.zeros((image_height, image_width, 3), dtype=np.uint8)
|
|
139
|
+
value_per_pixel = 1 / (scale * default_pixels_per_value)
|
|
140
|
+
left_top_complex = complex(
|
|
141
|
+
view_center.real - 0.5*value_per_pixel*image.shape[1],
|
|
142
|
+
view_center.imag + 0.5*value_per_pixel*image.shape[0]
|
|
143
|
+
)
|
|
144
|
+
for i, j in np.ndindex(image.shape[0], image.shape[1]):
|
|
145
|
+
c = complex(
|
|
146
|
+
left_top_complex.real + j*value_per_pixel,
|
|
147
|
+
left_top_complex.imag - i*value_per_pixel
|
|
148
|
+
)
|
|
149
|
+
steps = escape_steps(c, max_iter)
|
|
150
|
+
color = palette(steps/max_iter)
|
|
151
|
+
image[i, j, 0] = 255 * color.r
|
|
152
|
+
image[i, j, 1] = 255 * color.g
|
|
153
|
+
image[i, j, 2] = 255 * color.b
|
|
154
|
+
|
|
155
|
+
return image
|
|
156
|
+
|
|
157
|
+
image = draw_MandelbrotSet(-0.74364 + 0.13183j, 8000)
|
|
158
|
+
iio.imwrite("Mandelbrot.jpg", image)
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
Already have handwritten kernels? PyGPGPU can also `import` `.cl`/`.cu`/`.hip`/`.metal` files like Python modules, then call the kernels inside them like ordinary Python functions.
|
|
162
|
+
|
|
163
|
+
## Installation
|
|
164
|
+
|
|
165
|
+
```bash
|
|
166
|
+
pip install pygpgpu
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
Python >= 3.7. Bring your own GPU runtime — any one of them is enough:
|
|
170
|
+
|
|
171
|
+
| Backend | What you need | Notes |
|
|
172
|
+
|---|---|---|
|
|
173
|
+
| OpenCL | GPU driver (usually already installed) | Nothing extra; works across NVIDIA/AMD/Intel |
|
|
174
|
+
| CUDA | NVIDIA driver (includes NVRTC) | The CUDA Toolkit is not required |
|
|
175
|
+
| HIP | AMD HIP SDK | Compiles through the SDK's clang; point `PYGPGPU_HIP_INCLUDES` at extra include dirs if needed |
|
|
176
|
+
| Metal | macOS on a real Apple GPU | Compiles through the framework's own runtime; a Mac VM has no Metal device |
|
|
177
|
+
| Python | nothing | Selected explicitly with `k["python"]`, never probed |
|
|
178
|
+
|
|
179
|
+
Without an explicit backend, `@kernel` probes **cuda -> hip -> metal -> opencl** and takes the first that enumerates a device — except on **macOS**, where **metal** leads (`metal -> cuda -> hip -> opencl`): Apple machines ship no CUDA or HIP runtime, and macOS's OpenCL is deprecated, so the native backend is what a Mac should find first.
|
|
180
|
+
|
|
181
|
+
Each backend reads its sources with a tree-sitter grammar, installed automatically as a dependency: `tree-sitter-opencl`, `tree-sitter-cuda37`, and [tree-sitter-metal](https://github.com/Time-Coder/tree-sitter-metal) (our own distribution — no MSL grammar was published on PyPI). All of them are built against the tree-sitter ABI that CPython 3.7 can load, so one install works from 3.7 through the current release.
|
|
182
|
+
|
|
183
|
+
## Basic usage
|
|
184
|
+
|
|
185
|
+
**One decorator for every kind of function.** `@kernel` decorates plain functions, instance methods and static methods; `self.xxx` attributes the body reads become kernel arguments automatically:
|
|
186
|
+
|
|
187
|
+
```python
|
|
188
|
+
class Layer:
|
|
189
|
+
def __init__(self, weights, bias):
|
|
190
|
+
self.weights = weights # arrays and scalars both work
|
|
191
|
+
self.bias = bias
|
|
192
|
+
|
|
193
|
+
@kernel
|
|
194
|
+
def apply(self, x: np.ndarray) -> np.ndarray:
|
|
195
|
+
out = np.zeros_like(x) # built on the host, above the loop
|
|
196
|
+
for i in range(out.shape[0]): # the loop bound IS the work size
|
|
197
|
+
out[i] = x[i] * self.weights[i] + self.bias
|
|
198
|
+
return out
|
|
199
|
+
|
|
200
|
+
@staticmethod
|
|
201
|
+
@kernel
|
|
202
|
+
def double(x: np.ndarray) -> np.ndarray:
|
|
203
|
+
out = np.zeros_like(x)
|
|
204
|
+
for i in range(out.shape[0]):
|
|
205
|
+
out[i] = x[i] * 2.0
|
|
206
|
+
return out
|
|
207
|
+
|
|
208
|
+
@classmethod
|
|
209
|
+
@kernel
|
|
210
|
+
def scaled(cls, x: np.ndarray) -> np.ndarray:
|
|
211
|
+
out = np.zeros_like(x)
|
|
212
|
+
for i in range(out.shape[0]): # a cls member can be the loop extent
|
|
213
|
+
out[i] = x[i] * cls.factor
|
|
214
|
+
return out
|
|
215
|
+
|
|
216
|
+
x = np.ones(4, dtype=np.float32)
|
|
217
|
+
layer = Layer(np.arange(4, dtype=np.float32), 0.5)
|
|
218
|
+
|
|
219
|
+
layer.apply(x) # -> array([0.5, 1.5, 2.5, 3.5])
|
|
220
|
+
layer.apply["cuda"](x) # brackets work on methods too
|
|
221
|
+
Layer.double(x) # -> array([2., 2., 2., 2.])
|
|
222
|
+
Layer.factor = 3.0
|
|
223
|
+
Layer.scaled(x) # cls IS the receiver: class members are the arguments
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
Type annotations are optional (they serve editors and type checkers, not translation): the device types come from the actual arguments at call time, and the kernel is specialized per type signature.
|
|
227
|
+
|
|
228
|
+
**A classmethod kernel takes the class as the receiver.** `@kernel` decorates `@classmethod` too, in either order — `cls` is the receiver, so `cls.<attr>` reads (scalars, arrays, even a loop extent) and `cls.<helper>(...)` device calls work exactly as `self.<attr>` does on an instance method. Both `@kernel @classmethod` and `@classmethod @kernel` bind the same way: the call is `Layer.scaled(x)`, `cls.version = 9` rebinds the class attribute and reaches the caller after the launch (an alias holding the class sees it), and `submit()`/`async_call()` settle it the same way.
|
|
229
|
+
|
|
230
|
+
**Output arrays are return values.** A kernel creates its result with numpy and `return`s it — the shape and dtype come from numpy itself, and the caller receives an ordinary ndarray; there is no `out` parameter to pre-allocate. An object created above the magic loop is built once on the host and shared by every work item; one created inside the loop is device-private per work item. Either can be returned, every `return` statement may have its own shape, and the first work item to return wins.
|
|
231
|
+
|
|
232
|
+
**Kernel parameters accept plain Python objects.** An object's members become kernel arguments — scalars, arrays, even nested objects (each level is read at call time):
|
|
233
|
+
|
|
234
|
+
```python
|
|
235
|
+
class Params:
|
|
236
|
+
def __init__(self, a, b):
|
|
237
|
+
self.a = a
|
|
238
|
+
self.b = b
|
|
239
|
+
|
|
240
|
+
@kernel
|
|
241
|
+
def scale(p, x: np.ndarray) -> np.ndarray:
|
|
242
|
+
out = np.zeros_like(x)
|
|
243
|
+
for i in range(out.shape[0]):
|
|
244
|
+
out[i] = x[i] * p.a + p.b
|
|
245
|
+
return out
|
|
246
|
+
|
|
247
|
+
scale(Params(2.0, 10.0), x) # -> x * 2.0 + 10.0
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
**Kernels can call methods and helpers.** A helper is plain Python — no decorator, no annotations: it is translated into a device function and specialized at the call site, recursively for helpers that call helpers. Besides a module-level function called by its bare name, a kernel can call another method of its own class (`self.other_method`), a static method of any class, a method of an object passed as an argument, and a function reached through a module:
|
|
251
|
+
|
|
252
|
+
```python
|
|
253
|
+
def clamp01(v): # module-level helper
|
|
254
|
+
return min(max(v, 0.0), 1.0)
|
|
255
|
+
|
|
256
|
+
class Scene:
|
|
257
|
+
def hit(self, v): # a method of an argument object
|
|
258
|
+
return v * v
|
|
259
|
+
|
|
260
|
+
@kernel
|
|
261
|
+
def shade(x: np.ndarray, scene: Scene) -> np.ndarray:
|
|
262
|
+
out = np.zeros_like(x)
|
|
263
|
+
for i in range(out.shape[0]):
|
|
264
|
+
out[i] = clamp01(scene.hit(x[i]))
|
|
265
|
+
return out
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
**A kernel needs an iteration domain** for the work size to be derived from. Either use a magic loop (`for i in range(x.shape[0])`, whose bound is the domain; `np.ndindex`/`np.ndenumerate` for 2-D/3-D) or, when dispatching on `get_global_id`, name the array: `@kernel(domain="x")`. Without either the call raises instead of guessing.
|
|
269
|
+
|
|
270
|
+
**One bracket syntax** names the backend, the device and the work size — the same on every backend, in any order:
|
|
271
|
+
|
|
272
|
+
```python
|
|
273
|
+
k(args) # fully automatic
|
|
274
|
+
k["cuda"](args) # backend (opencl/cuda/hip/metal/python; aliases ocl/cu/rocm/amd/mtl/py)
|
|
275
|
+
k["opencl:gfx1036"](args) # backend:device
|
|
276
|
+
k[(4, 256)](args) # work size: (blocks per grid, threads per block)
|
|
277
|
+
k["cuda"][(4, 256)](args) # combined; None means automatic
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
The work size is CUDA's `(blocks_per_grid, threads_per_block)` everywhere — OpenCL and Metal included. A block count never has to divide anything: the total is blocks * threads by construction.
|
|
281
|
+
|
|
282
|
+
**Every backend in one process.** Each backend/device pair is specialized and cached separately, so alternating between them is an extra dictionary lookup, not a recompile — one process can mix vendors, and `k["python"]` is always available as the interpreter fallback.
|
|
283
|
+
|
|
284
|
+
**Process-wide settings** live on one object, `pygpgpu.config` — there is no `set_...()` to look up:
|
|
285
|
+
|
|
286
|
+
```python
|
|
287
|
+
import pygpgpu
|
|
288
|
+
|
|
289
|
+
pygpgpu.config.print_info = False # progress logging
|
|
290
|
+
pygpgpu.config.type_map = {float: np.float64} # the width a python float travels as
|
|
291
|
+
pygpgpu.config.default_device = ["cuda:0", "hip:0"] # what a plain k(...) tries, in order
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
Every commonly used name is importable from the top level — `kernel`, `funcs`, vector types (`float4`, ...), device builtins (`get_global_id`, `atomic_add`, `barrier`, ...), `list_devices`/`get_device`, `config`, `kernel_import` — so an editor completes `pygpgpu.` and finds them.
|
|
295
|
+
|
|
296
|
+
## Importing handwritten kernels
|
|
297
|
+
|
|
298
|
+
`kernel_import` is the import hook that turns existing kernel files into Python modules: kernels and struct types become module attributes, and a `.pyi` stub is generated beside the source so IDE completion works. Write `vecadd.cl`:
|
|
299
|
+
|
|
300
|
+
```c
|
|
301
|
+
__kernel void vecadd(__global const float* a, __global const float* b,
|
|
302
|
+
__global float* out, const int n)
|
|
303
|
+
{
|
|
304
|
+
int i = get_global_id(0);
|
|
305
|
+
if (i >= n) return; // the launch size may be rounded up, so clamp
|
|
306
|
+
out[i] = a[i] + b[i];
|
|
307
|
+
}
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
```python
|
|
311
|
+
from pygpgpu import kernel_import
|
|
312
|
+
|
|
313
|
+
kernel_import.install()
|
|
314
|
+
import vecadd # one .cl file = one module
|
|
315
|
+
|
|
316
|
+
out = np.empty_like(a)
|
|
317
|
+
vecadd.vecadd(a, a, out, np.int32(len(a))) # work size inferred
|
|
318
|
+
vecadd.vecadd["opencl"][(3907, 256)](a, a, out, np.int32(len(a))) # backend + work size
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
A struct `typedef` in the source becomes a ctypes type (a `Pt` above would pass by value, or as an array of structures). Same-named `.cl`/`.cu`/`.hip` files in one package merge into a single module: the same parameter list is one kernel with one implementation per backend (the bracket picks it), different parameter lists become overloads chosen by the argument types, and a bracket naming a backend without an implementation raises `KeyError` at the bracket. ([06](examples/06_handwritten_kernels.py) imports one file; [15](examples/15_kernel_import.py) merges three.)
|
|
322
|
+
|
|
323
|
+
## Features
|
|
324
|
+
|
|
325
|
+
- **One decorator for every function** — plain functions, instance methods, static methods and classmethods all take `@kernel`; the `self.xxx`/`cls.xxx` attributes the body reads become kernel arguments automatically, with the class as the receiver for a classmethod. ([01](examples/01_basic_kernel.py), [03](examples/03_nd_loop_and_class_method.py))
|
|
326
|
+
- **Return values** — the result array is created in the body with numpy and `return`ed; the caller receives an ordinary ndarray. Scalars, vectors, structures and arrays all return, every `return` may have its own shape, and the first work item to return wins. ([11_returns_and_scope.py](examples/11_returns_and_scope.py))
|
|
327
|
+
- **Python objects as arguments** — pass a plain object and its members (scalars, arrays, nested objects) become kernel arguments, read at call time. ([14](examples/14_heterogeneous_data.py))
|
|
328
|
+
- **Python objects inside the kernel** — read nested members and call methods of an argument object (`scene.hit(x)`); together with `self.method(...)`, static methods of any class and module-level functions, the call spellings are exactly ordinary Python's. ([03](examples/03_nd_loop_and_class_method.py), [14](examples/14_heterogeneous_data.py))
|
|
329
|
+
- **Objects created inside the kernel** — `np.zeros`/`np.zeros_like` written above the magic loop are built once on the host and shared by every work item; written below the loop they are device-private per work item. Both can be `return`ed. ([14](examples/14_heterogeneous_data.py))
|
|
330
|
+
- **Helpers** — a helper called from a kernel needs no decorator and no annotations; it is specialized at the call site, recursively for helpers that call helpers. ([03](examples/03_nd_loop_and_class_method.py))
|
|
331
|
+
- **Recursive device functions** — a helper or method that calls itself is compiled into a loop automatically, on every backend: the tail call, a result the caller consumes (`r = f(...)` with statements after it, or `return g(f(...))` with the recursive call at any argument position), and structure arguments the walk replaces per level (the bounce ray of a ray tracer). A shape the loop cannot order — a wrapper reading a value that differs per level, or two self-calls in one expression — is refused with its reason; CUDA and HIP answer those shapes through native recursion. ([ray tracing](examples/ray_tarcing_in_one_weekend/render.py))
|
|
332
|
+
- **Outer-scope variables** — variables the body reads from outside become kernel parameters, so a changed value is visible on the next call; a scalar declared `nonlocal`/`global` is written back to its scope after the call. ([11_returns_and_scope.py](examples/11_returns_and_scope.py))
|
|
333
|
+
- **Non-blocking launches** — `submit()` (a `concurrent.futures.Future`) and `await k.async_call(...)` (an `asyncio.Future`) on the same decorated function; the brackets apply here too. ([10](examples/10_async_launch.py))
|
|
334
|
+
|
|
335
|
+
## How it compares
|
|
336
|
+
|
|
337
|
+
The same computation in this library and three other GPU-from-Python projects ([Taichi](https://www.taichi-lang.org/), [Numba](https://numba.pydata.org/), [NVIDIA Warp](https://github.com/NVIDIA/warp)). The API gap is widest around the ways you write things: helpers stay ordinary Python, arguments can be plain Python objects, instance/static methods decorate directly, and output arrays are return values.
|
|
338
|
+
|
|
339
|
+
**PyGPGPU** — arrays in, an array returned; no launch geometry, no buffer management, and helpers need no decorator at all:
|
|
340
|
+
|
|
341
|
+
```python
|
|
342
|
+
from pygpgpu import kernel
|
|
343
|
+
|
|
344
|
+
def clamp01(v): # plain Python: no decorator, no annotations
|
|
345
|
+
return min(max(v, 0.0), 1.0)
|
|
346
|
+
|
|
347
|
+
def weight(v): # helpers may call other helpers
|
|
348
|
+
return clamp01(v * v) * 0.5 + 0.25
|
|
349
|
+
|
|
350
|
+
@kernel
|
|
351
|
+
def apply_all(x: np.ndarray) -> np.ndarray:
|
|
352
|
+
out = np.zeros_like(x) # output arrays are return values
|
|
353
|
+
for i in range(out.shape[0]): # loop bound = work size
|
|
354
|
+
out[i] = weight(x[i])
|
|
355
|
+
return out
|
|
356
|
+
|
|
357
|
+
out = apply_all(x) # numpy arrays as-is
|
|
358
|
+
out = apply_all["hip"](x) # the same function, another backend
|
|
359
|
+
```
|
|
360
|
+
|
|
361
|
+
**Taichi** — declare fields first, then copy data in and out by hand; a helper needs `@ti.func` and every argument must be annotated:
|
|
362
|
+
|
|
363
|
+
```python
|
|
364
|
+
import taichi as ti
|
|
365
|
+
ti.init(arch=ti.gpu)
|
|
366
|
+
|
|
367
|
+
x = ti.field(ti.f32, n)
|
|
368
|
+
y = ti.field(ti.f32, n)
|
|
369
|
+
out = ti.field(ti.f32, n)
|
|
370
|
+
x.from_numpy(nx)
|
|
371
|
+
y.from_numpy(ny)
|
|
372
|
+
|
|
373
|
+
@ti.func # helpers need their own decorator
|
|
374
|
+
def weight(v: ti.f32) -> ti.f32:
|
|
375
|
+
return ti.max(0.0, ti.min(1.0, v * v)) * 0.5 + 0.25
|
|
376
|
+
|
|
377
|
+
@ti.kernel
|
|
378
|
+
def saxpy(a: ti.f32):
|
|
379
|
+
for i in range(n):
|
|
380
|
+
out[i] = x[i] * a + y[i] + weight(x[i])
|
|
381
|
+
|
|
382
|
+
saxpy(2.0)
|
|
383
|
+
res = out.to_numpy()
|
|
384
|
+
```
|
|
385
|
+
|
|
386
|
+
**Numba** — compute blocks/threads yourself, guard inside, manage device memory; callable helpers are compiled separately with `@cuda.jit(device=True)`:
|
|
387
|
+
|
|
388
|
+
```python
|
|
389
|
+
from numba import cuda
|
|
390
|
+
|
|
391
|
+
@cuda.jit(device=True) # helpers need device=True
|
|
392
|
+
def weight(v):
|
|
393
|
+
return min(1.0, max(0.0, v * v)) * 0.5 + 0.25
|
|
394
|
+
|
|
395
|
+
@cuda.jit
|
|
396
|
+
def saxpy(x, y, out, a):
|
|
397
|
+
i = cuda.grid(1)
|
|
398
|
+
if i < out.size: # bounds guard is your job
|
|
399
|
+
out[i] = x[i] * a + y[i] + weight(x[i])
|
|
400
|
+
|
|
401
|
+
d_x = cuda.to_device(nx)
|
|
402
|
+
d_y = cuda.to_device(ny)
|
|
403
|
+
d_out = cuda.device_array_like(nx)
|
|
404
|
+
threads = 256
|
|
405
|
+
saxpy[(n + threads - 1) // threads, threads](d_x, d_y, d_out, 2.0)
|
|
406
|
+
res = d_out.copy_to_host()
|
|
407
|
+
```
|
|
408
|
+
|
|
409
|
+
**Warp** — typed array parameters, the launch size is passed explicitly, and helpers need `@wp.func`:
|
|
410
|
+
|
|
411
|
+
```python
|
|
412
|
+
import warp as wp
|
|
413
|
+
wp.init()
|
|
414
|
+
|
|
415
|
+
@wp.func # helpers need their own decorator
|
|
416
|
+
def weight(v: float) -> float:
|
|
417
|
+
return wp.min(1.0, wp.max(0.0, v * v)) * 0.5 + 0.25
|
|
418
|
+
|
|
419
|
+
@wp.kernel
|
|
420
|
+
def saxpy(x: wp.array(dtype=float), y: wp.array(dtype=float),
|
|
421
|
+
out: wp.array(dtype=float), a: float):
|
|
422
|
+
i = wp.tid()
|
|
423
|
+
out[i] = x[i] * a + y[i] + weight(x[i])
|
|
424
|
+
|
|
425
|
+
wp.launch(saxpy, dim=n, inputs=[x, y, out, 2.0])
|
|
426
|
+
```
|
|
427
|
+
|
|
428
|
+
| | PyGPGPU | Taichi | Numba | Warp |
|
|
429
|
+
|---|---|---|---|---|
|
|
430
|
+
| Input data | numpy arrays directly | wrap in `ti.field`, explicit copies | `cuda.to_device` + `copy_to_host` | wrap in `wp.array` |
|
|
431
|
+
| Result | **the kernel returns an ndarray** | `out.to_numpy()` by hand | `copy_to_host()` by hand | written into a `wp.array` you manage |
|
|
432
|
+
| Helper functions | **plain Python — no decorator, annotations optional** | `@ti.func` + annotated args | `@cuda.jit(device=True)` | `@wp.func` + annotated args |
|
|
433
|
+
| Python objects as arguments | **yes — members become kernel arguments** | no (arrays must be wrapped in `ti.field`) | no (scalars and device arrays only) | no (needs `wp.array`) |
|
|
434
|
+
| Accessing Python objects in a kernel | **yes — read nested members, call their methods** | no | no | no |
|
|
435
|
+
| Instance methods | **yes — `self.xxx` becomes arguments automatically** | instance methods in a `@ti.data_oriented` class | no | no |
|
|
436
|
+
| Static methods | **yes** | no (only those instance methods) | no | no |
|
|
437
|
+
| Backends in one process | **all, mixed freely via brackets** | one, fixed by `ti.init` | CUDA only | CUDA only |
|
|
438
|
+
| Backends | OpenCL, CUDA, HIP, Metal | CPU, CUDA, Vulkan, ... | CPU, CUDA | CPU, CUDA |
|
|
439
|
+
| Copy optimization | **uploads/read-backs skipped per argument** | no | no | no |
|
|
440
|
+
|
|
441
|
+
Where the others are ahead, worth knowing before you pick: automatic differentiation (Taichi, Warp), sparse data structures (Taichi), and throughput-oriented CPU execution — the `python` backend here is serial and meant for testing. This table was written from each project's documentation; their APIs move fast, so confirm against current docs before relying on a cell.
|
|
442
|
+
|
|
443
|
+
## More documentation
|
|
444
|
+
|
|
445
|
+
The numbered scripts in [examples/](examples/) are standalone end-to-end tours; [examples/README.md](examples/README.md) lists them all with each one's dependencies:
|
|
446
|
+
|
|
447
|
+
| Topic | Examples |
|
|
448
|
+
|---|---|
|
|
449
|
+
| `@kernel` basics, brackets, device selection | [01](examples/01_basic_kernel.py), [02](examples/02_backend_device_selection.py) |
|
|
450
|
+
| 2-D/3-D magic loops, class methods, helpers by name | [03](examples/03_nd_loop_and_class_method.py) |
|
|
451
|
+
| Every kind of kernel value: arguments, built objects, returns | [14](examples/14_heterogeneous_data.py) |
|
|
452
|
+
| Vector types and the dual-sided `funcs` | [04](examples/04_vector_types.py) |
|
|
453
|
+
| Device-resident `gnp` arrays, zero copy, atomics | [05](examples/05_gnp_zero_copy_and_atomics.py), [19](examples/19_device_resident_arrays.py) |
|
|
454
|
+
| Handwritten kernels: one file; a multi-backend module | [06](examples/06_handwritten_kernels.py), [15](examples/15_kernel_import.py) |
|
|
455
|
+
| Low-level OOP API | [07](examples/07_low_level_oop.py) |
|
|
456
|
+
| Comparing backends on one machine | [08](examples/08_compare_backends.py) |
|
|
457
|
+
| Atomics and shared-memory reduction | [09](examples/09_reduction.py) |
|
|
458
|
+
| Async launches; the pure-Python backend; returns and scope | [10](examples/10_async_launch.py), [11](examples/11_python_backend.py), [11_returns_and_scope.py](examples/11_returns_and_scope.py) |
|
|
459
|
+
| `print()` in a kernel; images | [12](examples/12_print_in_kernel.py), [13](examples/13_image.py) |
|
|
460
|
+
| Scientific math and `device_function` | [16](examples/16_scientific_math.py) |
|
|
461
|
+
| The Metal backend | [17](examples/17_metal_backend.py), [18](examples/18_metal_device_check.py) |
|
|
462
|
+
|
|
463
|
+
## License
|
|
464
|
+
|
|
465
|
+
MIT
|