Skip to main content

Module arg_serialize

Module arg_serialize 

Source
Expand description

Kernel argument serialization, Debug/Display formatting, and launch logging.

This module provides infrastructure for serializing kernel arguments into a human-readable format, logging kernel launches, and producing aggregate launch summaries. It is useful for debugging, profiling, and tracing GPU kernel invocations.

§Overview

  • ArgType — describes the data type of a serialized kernel argument.
  • SerializedArg — a single kernel argument with its type, name, and string representation of its value.
  • LaunchLog — a complete record of a single kernel launch including the kernel name, grid/block dimensions, shared memory, and arguments.
  • LaunchLogger — collects LaunchLog entries for analysis.
  • LaunchSummary — aggregate statistics (per-kernel launch counts, etc.).
  • SerializableKernelArgs — extends KernelArgs with the ability to serialize arguments into SerializedArg form.

§Example

use oxicuda_launch::arg_serialize::*;
use oxicuda_launch::{LaunchParams, Dim3};

let arg = SerializedArg::new(Some("n".to_string()), ArgType::U32, "1024".to_string(), 4);
assert_eq!(arg.name(), Some("n"));
assert_eq!(arg.value_repr(), "1024");

let params = LaunchParams::new(4u32, 256u32);
let formatted = format_launch_params(&params);
assert!(formatted.contains("grid"));

Structs§

KernelLaunchStats
Per-kernel aggregate statistics within a LaunchSummary.
LaunchLog
A complete record of a single kernel launch.
LaunchLogger
Collects LaunchLog entries for inspection and analysis.
LaunchSummary
Aggregate statistics over all recorded kernel launches.
SerializedArg
A serialized representation of a single kernel argument.

Enums§

ArgType
Describes the data type of a serialized kernel argument.

Traits§

SerializableKernelArgs
Extension trait for KernelArgs that can serialize arguments into SerializedArg form for logging and debugging.
SerializeArg
Helper trait to serialize a single value into a SerializedArg.

Functions§

format_args
Pretty-prints a slice of SerializedArg values.
format_launch_params
Pretty-prints a LaunchParams configuration.