Repository navigation
chore(examples): port nine legacy cuda_launch\! examples to #[cuda_module] - #170
Merged
Merged
Conversation
…dule] Move the kernels of hashmap, hashmap_v2, hashmap_v3, f16_stress, fmaxmin_smoke, fp_special_literal_smoke, device_global, index2d_const, and math_atan into #[cuda_module] modules and replace every cuda_launch! invocation with the generated typed launch methods (kernels::from_module(...) followed by module.<kernel>(stream, cfg, args...)). Kernels, checks, and printed success markers are unchanged; only the launch plumbing differs. The hashmap_v2/v3 host drivers now take &kernels::LoadedModule instead of &Arc<CudaModule>, and both bench bins are ported alongside their default bins. host_closure is intentionally left as is: it already drives the typed path, and its remaining cuda_launch!/cuda_launch_async! calls are a deliberate four-way launch-path parity matrix.
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.
What
Nine examples move from the legacy untyped
cuda_launch\!macro to the typed#[cuda_module]path:hashmap,hashmap_v2,hashmap_v3(both bins each),f16_stress,fmaxmin_smoke,fp_special_literal_smoke,device_global,index2d_const,math_atan.Kernel bodies, host checks, and printed success markers are byte-identical; only the launch plumbing changes. The tenth candidate,
host_closure, turned out to already use the typed path as its primary mechanism.No typed-path gaps surfaced: every parameter shape in these examples (read-only slices,
DisjointSlicewith and withoutIndex2D, scalars, raw pointers on an unsafe kernel, f16 buffers) marshals identically.This narrows the remaining
cuda_launch\!surface to: the two deliberate low-level API regression examples (manual_launch_generic,manual_launch_libdevice), the fuzzer harness,host_closure's secondary variant, andcoop_groups_demo's non-cooperative calls — the prelude to demoting the macro to an explicitlyunsafeniche API for runtime-loaded kernels.Evidence