Expand description
Vulkan kernel bindings for fuel_dispatch (ROADMAP row 137, step 6.1).
These lived inside fuel-dispatch behind feature = "vulkan"; they now sit above it, the way the
vendor CPU backends (fuel-aocl-cpu-backend, fuel-mkl-cpu-backend) already do: they use the public
kernel-table API of fuel-dispatch and hand it a registrar. fuel-dispatch no longer registers
Vulkan kernels itself, so something has to call install_global before the process-wide binding
table is read for a plan. fuel-tensor does it (its cpu_accel::ensure_installed, which runs right
before the bridge takes its snapshot, see the hazard below). A caller that builds its own
KernelBindingTable calls register_vulkan_kernels on it instead.
§The snapshot hazard
Readers of the global table take a snapshot (fuel_dispatch::dispatch::global_bindings). An
extension (extend_global_bindings) publishes a new table for LATER readers; a snapshot already
taken keeps the old one. So a Vulkan kernel registered after a snapshot is invisible to whoever holds
that snapshot, with no error. The rule: install before the first snapshot that a Vulkan-capable
realize will use. fuel-tensor/tests/vulkan_install_before_snapshot.rs fails if that order breaks.
§Layout
vulkan_dispatch: the Vulkan kernel wrappers andregister_vulkan_kernels(moved unchanged fromfuel-dispatch/src/vulkan_dispatch.rs; the module keeps its name so the paths inside it and inlinkdid not change).link: the FKC link registry that binds contract entry points to those wrappers.
Re-exports§
pub use link::VULKAN_CAST_ENTRY_POINTS;pub use link::VULKAN_ELEMENTWISE_ENTRY_POINTS;pub use link::VulkanLinkRegistry;pub use vulkan_dispatch::register_vulkan_kernels;
Modules§
- link
- The built-in Vulkan backend’s FKC
link_registry(kernel-seam-interop §3.5, §4.3; FKC §12.6). The GPU analogue offuel_dispatch::fkc::CpuLinkRegistry: maps each Vulkan kernel contract’sentry_pointsymbol to the production dispatch wrapper — the real, non-stub resolution the importer uses so an imported contract binds the actual kernel (no raw pointers in the serialized contract, FKC P9). - vulkan_
dispatch - Dispatch wrappers + registration for Vulkan-backed kernels.
Sibling to
baracuda_dispatch(CUDA) and the CPU dispatch indispatch.rs. Each kernel registers as an alternative at the(op_kind, dtypes, BackendId::Vulkan)decision point in the sharedKernelBindingTable.
Functions§
- install_
global - Add the Vulkan kernels to the process-wide binding table, once per process, together with the
derived
BackendCapabilitiesfor the Vulkan backend (the stepfuel-dispatchused to run for every compiled-in GPU backend right after registering them). Safe to call from any number of threads and any number of times: later calls return immediately. See the crate docs for when it must run.