Conversation
…t_kernel_language.jl
…S packages in nested function test
…ect stream variable naming
There was a problem hiding this comment.
Pull request overview
This PR adds a KernelAbstractions-based backend to ParallelStencil/ParallelKernel, enabling runtime switching of the execution target hardware (CPU/CUDA/ROCm/Metal/oneAPI) within a running session (e.g., REPL prototyping), plus associated documentation and test coverage.
Changes:
- Introduces runtime hardware selection APIs (
select_hardware/current_hardwareand@select_hardware/@current_hardware) and integrates them into kernel launching and allocation paths for KernelAbstractions. - Adds KernelAbstractions kernel wrapping/integration (
@ka,@ka_auto,@ka_kernel) and adjusts return/flow constraints for KA kernels. - Expands test suite and docs/README to cover KA backend behavior and runtime reselection workflow; adds oneAPI handle plumbing via an extension.
Reviewed changes
Copilot reviewed 57 out of 58 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
src/ParallelKernel/select_hardware.jl |
Implements runtime hardware selection/queries and KA handle translation entrypoints. |
src/ParallelKernel/parallel.jl |
Adds KA launch path (@ka, @ka_auto), KA kernel wrapping, and xPU handling alongside GPU paths. |
src/ParallelKernel/kernel_language.jl |
Adds KA implementations for thread/grid primitives and shared memory mapping. |
src/ParallelKernel/init_parallel_kernel.jl |
Adds KA as supported package, introduces per-module hardware metadata, and skips Data/TData generation for multi-arch backends. |
src/ParallelKernel/shared.jl |
Adds KA constants, hardware defaults, helper utilities, and KA-specific return/nested-return handling. |
src/ParallelKernel/KernelAbstractionsExt/* |
Adds KA allocator implementations and KA hardware-symbol→backend-handle mapping. |
src/ParallelKernel/*Ext/select_hardware.jl |
Adds CUDA/AMDGPU/Metal/oneAPI backend handle constructors for KA hardware symbols. |
src/select_hardware.jl / src/ParallelStencil.jl |
Exposes the runtime selection API in the ParallelStencil facade and exports it. |
src/memopt.jl / src/shared.jl |
Extends memopt integer-type selection to KA and adds memopt thread-limit constant. |
test/* / test/ParallelKernel/* |
Adds extensive coverage for runtime reselection, KA launches, allocators, and reset semantics. |
README.md |
Documents runtime hardware selection workflow and updates backend overview. |
Project.toml |
Adds KernelAbstractions + oneAPI as weak deps/extensions and updates compat/targets. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…s support in parallel.jl
…CTIONS in test_parallel.jl
Owner
Author
|
The AD error shown here has already been fixed the main branch. The error shown with overlap is because it is missing kernel abstraction support. So we will merge first and then add the kernel abstraction support to it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This will enable changing the target hardware for a module (which in an interactive session is the REPL module) during a running session: the main use case is prototyping in the REPL that requires switching hardware.
Furthermore, Intel GPUs are supported by KA and therefore now also by ParallelStencil - through KA.