|
PXL
|
Execution context for kernel launches on XCENA devices. More...
#include <launcher.hpp>
Public Member Functions | |
| Launcher () | |
| Constructs a Launcher with deferred device detection. More... | |
| Launcher (uint32_t deviceId) | |
| Constructs a Launcher for an explicit device ID. More... | |
| ~Launcher () | |
| Launcher (const Launcher &)=delete | |
| Launcher & | operator= (const Launcher &)=delete |
| Launcher (Launcher &&) noexcept | |
| Launcher & | operator= (Launcher &&) noexcept |
| template<auto Func, typename... Args, detail::EnableCompatibleKernelArguments< Func, Args... > = 0> | |
| LaunchBuilder | execute (uint32_t taskCount, Args &&... args) |
| Launches a kernel for deferred execution. More... | |
| template<auto Func, typename... Args, detail::EnableCompatibleKernelArguments< Func, Args... > = 0> | |
| detail::TaskCountRequired< LaunchBuilder > | execute (Args &&... args) |
| Launches a kernel with only the kernel's own arguments. More... | |
| template<auto Func, typename... Args, detail::EnableCompatibleKernelArguments< Func, Args... > = 0> | |
| StageBuilder | stage (uint32_t taskCount, Args &&... args) |
| Begins a stage chain with a sequential kernel stage. More... | |
| template<auto Func, typename... Args, detail::EnableCompatibleKernelArguments< Func, Args... > = 0> | |
| detail::TaskCountRequired< StageBuilder > | stage (Args &&... args) |
| Begins a stage chain with only the kernel's own arguments. More... | |
| StageGroupBuilder | stage () |
| Begins a parallel stage group. More... | |
| uint32_t | deviceId () const |
| Returns the device ID. More... | |
| bool | isValid () const |
| Returns whether the launcher was initialized successfully. More... | |
Execution context for kernel launches on XCENA devices.
Provides kernel launch capabilities. Device is either specified explicitly or auto-detected from the first pointer argument in execute()/pipeline().
Example usage:
Definition at line 266 of file launcher.hpp.
| pxl::Launcher::Launcher | ( | ) |
Constructs a Launcher with deferred device detection.
Device selection priority on the first execute()/stage() call:
pxl::kNoDeviceResolvedMessage.Once bound on the first call, the device is reused for every subsequent execute()/stage() on the same Launcher; cross-device pointer args are rejected at run()/runAsync() time.
|
explicit |
Constructs a Launcher for an explicit device ID.
Use this when all kernel arguments are scalars (no device pointers), or when you want to override the auto-detection logic. The explicit deviceId always wins — even if a pointer argument resolves to a different device, the kernel runs on deviceId (and the cross-device check in run() will surface the mismatch as a launch failure).
Side effect: a successful explicit construction updates the process-wide default device cache (see pxl::getDefaultDeviceId()). Subsequent auto-allocations (allocateMemory(N) without deviceId) and default-Launcher() calls will favor this device until the cache is cleared via pxl::clearDefaultDeviceId().
| deviceId | Target device identifier. |
| pxl::Launcher::~Launcher | ( | ) |
|
delete |
|
noexcept |
| uint32_t pxl::Launcher::deviceId | ( | ) | const |
Returns the device ID.
|
inline |
Launches a kernel with only the kernel's own arguments.
Set the task count on the returned builder with .tasks(taskCount). Kernel arity distinguishes this form from the positional compatibility form, including when the kernel's first argument is an integer. The pending return type exposes no run()/runAsync(), so attempting execution before .tasks(taskCount) is a C++ compile error. Discarding the pending request instead produces its [[nodiscard]] diagnostic and executes nothing.
Definition at line 384 of file launcher.hpp.
|
inline |
Launches a kernel for deferred execution.
| Func | Kernel function pointer (must have KernelTraits specialization from pxcc). |
| Args | Kernel argument types. |
| taskCount | Number of tasks to execute. |
| args | Kernel arguments (device memory pointers and scalars). |
Directional kernel parameters require the exact kernel argument count and a compatible typed pointer or typed NDArray. Raw void* allocations must be cast to the kernel element type (or allocated with allocateMemory<T>()) so element mismatches remain diagnosable.
Definition at line 336 of file launcher.hpp.
| bool pxl::Launcher::isValid | ( | ) | const |
Returns whether the launcher was initialized successfully.
|
inline |
Begins a parallel stage group.
Device is auto-detected from pointer arguments when run() is called.
Example:
Definition at line 459 of file launcher.hpp.
|
inline |
Begins a stage chain with only the kernel's own arguments.
Set the task count for the new stage with .tasks(taskCount). Kernel arity distinguishes this form from the positional compatibility form. The pending return type exposes no run()/runAsync() or next stage operation.
Definition at line 438 of file launcher.hpp.
|
inline |
Begins a stage chain with a sequential kernel stage.
| Func | Kernel function pointer. |
| taskCount | Number of tasks to execute. |
| args | Kernel arguments. |
Example:
Definition at line 408 of file launcher.hpp.