Is this a duplicate?
Area
cuda.core
Is your feature request related to a problem? Please describe.
LaunchConfig does not expose CU_LAUNCH_ATTRIBUTE_SYNCHRONIZATION_POLICY, which overrides the CPU wait policy (SPIN / YIELD / BLOCKING_SYNC) for a launch.
Parent tracking: #496.
Describe the solution you'd like
Describe alternatives you've considered
- Use
cuda.bindings.driver (CUlaunchAttribute / CU_LAUNCH_ATTRIBUTE_SYNCHRONIZATION_POLICY) and cuLaunchKernelEx directly.
- Set the stream attribute via
cuStreamSetAttribute(..., CU_STREAM_ATTRIBUTE_SYNCHRONIZATION_POLICY, ...) instead of a per-launch attribute.
Downside of (1)/(2): leaves cuda.core users without a first-class LaunchConfig API; they must drop to low-level bindings and lose consistency with other LaunchConfig launch attributes (is_cooperative, programmatic_stream_serialization, etc.).
Additional context
Incremental LaunchConfig attribute coverage under #496 (same approach as #1334 for programmatic_stream_serialization).
Example (C API) — agent-generated; reviewed but not executed:
// Per-launch SPIN policy (lowest-latency host sync)
CUlaunchAttribute syncAttr = {
.id = CU_LAUNCH_ATTRIBUTE_SYNCHRONIZATION_POLICY,
.value = { .syncPolicy = CU_SYNC_POLICY_SPIN }
};
CUlaunchConfig config = {
.gridDimX = 128, .gridDimY = 1, .gridDimZ = 1,
.blockDimX = 256, .blockDimY = 1, .blockDimZ = 1,
.sharedMemBytes = 0,
.hStream = latencyCriticalStream,
.attrs = &syncAttr,
.numAttrs = 1
};
cuLaunchKernelEx(&config, kernel, NULL, NULL);
// Subsequent sync on this stream busy-waits on CPU
cuStreamSynchronize(latencyCriticalStream);
Is this a duplicate?
Area
cuda.core
Is your feature request related to a problem? Please describe.
LaunchConfigdoes not exposeCU_LAUNCH_ATTRIBUTE_SYNCHRONIZATION_POLICY, which overrides the CPU wait policy (SPIN / YIELD / BLOCKING_SYNC) for a launch.Parent tracking: #496.
Describe the solution you'd like
CU_LAUNCH_ATTRIBUTE_SYNCHRONIZATION_POLICYviaLaunchConfig.Describe alternatives you've considered
cuda.bindings.driver(CUlaunchAttribute/CU_LAUNCH_ATTRIBUTE_SYNCHRONIZATION_POLICY) andcuLaunchKernelExdirectly.cuStreamSetAttribute(..., CU_STREAM_ATTRIBUTE_SYNCHRONIZATION_POLICY, ...)instead of a per-launch attribute.Downside of (1)/(2): leaves
cuda.coreusers without a first-classLaunchConfigAPI; they must drop to low-level bindings and lose consistency with otherLaunchConfiglaunch attributes (is_cooperative,programmatic_stream_serialization, etc.).Additional context
Incremental
LaunchConfigattribute coverage under #496 (same approach as #1334 forprogrammatic_stream_serialization).Example (C API) — agent-generated; reviewed but not executed: