Marionette: Data Structure Description and Management for Heterogeneous Computing
Nuno dos Santos Fernandes, Pedro Tomás, Nuno Roma, Frank Winklmeier, Patricia Conde-Muíño
TL;DR
Marionette addresses the challenge of porting large object-oriented C++ codebases to heterogeneous accelerators by decoupling data layout from the interface and enabling portable, efficient data-structure descriptions. The library provides compile-time generated layouts, multiple memory management strategies, and inter-device data transfers with minimal runtime overhead, preserving compatibility with existing code via extensible interfaces. It introduces two core abstractions, Object and Collection, plus a flexible property-and-layout description framework that supports per-item, array, and jagged-data properties, as well as advanced layouts and memory contexts. Case studies on GPU-based workflows show zero-cost abstractions relative to handwritten solutions and illustrate when GPU acceleration provides benefits given data-transfer costs. The work demonstrates practical portability and performance, with ongoing plans to broaden property types, layouts, and hardware platform support.
Abstract
Adapting large, object-oriented C++ codebases for hardware acceleration might be extremely challenging, particularly when targeting heterogeneous platforms such as GPUs. Marionette is a C++17 library designed to address this by enabling flexible, efficient, and portable data structure definitions. It decouples data layout from the description of the interface, supports multiple memory management strategies, and provides efficient data transfers and conversions across devices, all of this with minimal runtime overhead due to the compile-time nature of its abstractions. By allowing interfaces to be augmented with arbitrary functions, Marionette maintains compatibility with existing code and offers a streamlined interface that supports both straightforward and advanced use cases. This paper outlines its design, usage, and performance, including a CUDA-based case study demonstrating its efficiency and flexibility.
