Image Utils#
-
namespace trt_edgellm
Argument bundles for the CuTe DSL FMHA launchers.
Each public run* entry point fills one of these once from its own arguments and members, and the launcher then spreads it across the generated descriptors. One struct per wrapper shape rather than a single superset: a superset would let a field that matters on one path (kvCacheCapacity on the dense path, tokensPerPage on the paged one) sit silently at zero on another.
These carry no generated types, so this header is safe to include from translation units that use the required FMHA-v2 runner, the optional CUTE_DSL_FMHA_BLACKWELL_ENABLED runner, or both. The descriptor-filling machinery itself lives in cuteDslTensorDescriptors.h, which stays free of any FMHA concept.
Helpers for populating the tensor descriptors emitted by the CuTe DSL C exporter.
Every AOT variant exports its own nominally distinct but layout-identical descriptor structs (
fmha_d64_Tensor_q_tensor_tvsfmha_d128_Tensor_q_tensor_t) plus acute_dsl_<variant>_wrapperentry point. There is no umbrella C type, so descriptor types are recovered here from the signature of the wrapper that consumes them: a call site names only the wrapper and the kernel module, and pairing a descriptor with the wrong variant is not expressible.The exporter (
cutlass/cute/export/c_header_generator.py) always names the membersdata,dynamic_shapesanddynamic_strides, but emits each array only when its dynamic mask is non-empty. A rank-1 descriptor therefore has nodynamic_stridesmember at all and needs makeCuSeqLenTensor() rather than the strided builders below.-
namespace rt
-
namespace imageUtils
Enums
-
class ImageData#
- #include <imageUtils.h>
Image data container (image or video frame stack)
Wraps a uint8 RGB tensor with the unified 4D layout
[frames, height, width, channels]. Still images haveframes == 1; videos carryisVideo == true(a single-frame video is still a video). Channels must be 3.Public Functions
-
ImageData(rt::Tensor &&data)#
Construct image data.
- Parameters:
data – Image tensor with shape [T, H, W, C]. Single-frame still images use T=1.
- Throws:
std::runtime_error – if tensor content not UINT8, tensor shape not 4D, or number of channels not 3
-
unsigned char *data() const noexcept#
Get raw image data pointer.
- Returns:
Pointer to image data
-
inline int64_t bytesPerFrame() const noexcept#
Bytes occupied by a single frame (height * width * channels), assuming UINT8 storage.
- Returns:
Byte count per frame.
-
ImageData resizedMeta(int64_t newHeight, int64_t newWidth) const#
Metadata-only copy at a new spatial size: keeps channels, frames and fps, replaces height/width, and carries no pixel buffer (the resized pixels live in the caller’s device tensor).
- Returns:
ImageData with the new dimensions and this object’s channels, frames and fps.
Public Members
-
int64_t width = {0}#
Image width.
-
int64_t height = {0}#
Image height.
-
int64_t channels = {0}#
Number of channels (e.g., 3 for RGB)
-
int64_t frames = {1}#
Number of frames (T); the modality is flagged by isVideo.
-
double fps = {1.0}#
Video sample fps for MRoPE timestamps; ignored unless isVideo.
-
bool doResize = {true}#
When false, the vision runner skips its internal resize.
-
bool isVideo = {false}#
Explicit modality: a single-frame video is still a video.
-
std::vector<double> timestamps#
Optional source timestamps (seconds); empty assumes uniform fps spacing.
-
ImageData(rt::Tensor &&data)#
-
class ImageData#
-
namespace imageUtils
-
namespace rt