Skip to content

Add KernelPackage, source_roots and shared_memory_fits - #118

Merged
max-models merged 2 commits into
develfrom
kernel-package
Oct 27, 2026
Merged

max-models merged 2 commits into
develfrom
kernel-package

Conversation

@max-models

Copy link
Copy Markdown
Owner

The kernel build settings that picnic, simgeometry, beamtracer and mpifield each copied (kernels/_build.py, _metal.py, compile.py) move here.

  • xp.kernels.KernelPackage(name): the package's PyccelCache and the Kernel.from_folder options shared by its kernel folders (host_suffix="_pyccel", dispatch="arrays", block_size=256, n_threads_from="last_axis"), with from_folder(package, **overrides) and metal_kernel(...) (float32 MetalKernels with zeroed outputs).
  • xp.kernels.source_roots(*packages): source roots of installed packages, for include_dirs of a CUDA kernel that includes another package's header.
  • xp.cuda.shared_memory_fits(num_values, itemsize=8): whether a per-block buffer fits DEFAULT_SHARED_MEMORY_PER_BLOCK.

Tests in tests/unit/test_kernel_package.py, docs in kernels/dispatch.md. Unit suite: 758 passed.

The four packages switch over in their own kernel-package PRs, which need this on devel first.

@max-models
max-models merged commit 534a48c into devel Oct 27, 2026
21 of 22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant