Cache-Aware Self-Referential Structure Peeling

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing self-referential structure peeling strategies are context-sensitive, inefficient in memory usage, and prone to memory fragmentation and page faults, especially when dealing with multiple instances of arrays of structures (AOS) of the same data type with complex interconnectivity.

Innovation Solution

The method involves converting the data layout of an array of structures (AOS) to an array of structures of arrays (AOSOA) with uniform memory blocks, where each field type has its own memory block, and using modular pointer arithmetic to maintain data locality and reduce cache misses.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Adaptability or versatility

If existing self-referential structure peeling strategies are used to convert AOS to SOA, then cache performance may be improved, but they are limited to single instance AOS and not applicable to multiple instances with complex interconnectivity

Engineering Contradiction:
Improveapplicability to multiple AOS instancesVSAvoidcontext sensitivity requirements
Core Design Contradiction:
Adaptability or versatilityVSDevice complexity

Solution Approach 1:

The patent creates a universal structure peeling approach that handles multiple AOS instances of the same data type through a common SOA representation. The memory pool management system provides a generic solution that works across different AOS instances without requiring instance-specific context-sensitive logic, thereby improving adaptability while reducing complexity.

Inventive Principle:
Principle #6Universality (Multi-functionality)

Solution Approach 2:

The patent segments the multiple AOS instances into a unified SOA structure where fields are separated into contiguous memory pools. This segmentation allows each field type across all AOS instances to be organized independently in dedicated memory regions, enabling the system to handle complex interconnectivity among multiple instances through a standardized segmented layout.

Inventive Principle:
Principle #1Segmentation

2Stability of the object's composition

If memory pool management routines reserve huge memory for all AOSs of a specific data type to ensure contiguity, then all SOA of a certain data type can be placed contiguously in memory, but this leads to inefficient memory use and fragmentation

Engineering Contradiction:
Improvecontiguity of SOA in memoryVSAvoidmemory efficiency
Core Design Contradiction:
Stability of the object's compositionVSLoss of substance

Solution Approach 1:

The patent implements dynamic memory pool management where memory is allocated to AOS instances as needed rather than reserving huge contiguous blocks in advance. The memory pool grows and shrinks dynamically based on the actual number and size of AOS instances, maintaining contiguity of SOA fields while avoiding wasted memory space and fragmentation associated with static large reservations.

Inventive Principle:
Principle #15Dynamics

Solution Approach 2:

The patent changes the memory allocation parameters from fixed large blocks to flexible smaller allocations that adapt to the actual data requirements. By adjusting the memory pool size and allocation strategy based on runtime conditions, the system achieves contiguity without the memory inefficiency of over-allocation.

Inventive Principle:
Principle #35Parameter changes

3Loss of substance

If memory is allocated to a required size initially and then resized when required, then memory can be efficiently used, but this involves a large number of unnecessary memory move operations and degrades runtime performance

Engineering Contradiction:
Improvememory efficiencyVSAvoidruntime performance
Core Design Contradiction:
Loss of substanceVSProductivity

Solution Approach 1:

The patent performs preliminary structure peeling and SOA conversion at compile time or during initialization, organizing fields into contiguous memory pools before runtime operations begin. This preliminary action eliminates the need for frequent memory reallocation and data movement during runtime, thereby maintaining both memory efficiency and high runtime performance.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent establishes continuous contiguity of SOA fields in memory through the memory pool management system, eliminating the need for repeated memory move operations. Once data is allocated and organized in the memory pool, it remains contiguous throughout the application's execution, ensuring continuous efficient access without performance degradation from reallocation.

Inventive Principle:
Principle #20Continuity of useful action

4Adaptability or versatility

If associated field values are placed at a large distance from each other in existing self-referential structure peeling strategies, then data layout flexibility is achieved, but this causes unnecessary page faults and degrades runtime performance

Engineering Contradiction:
Improvedata layout flexibilityVSAvoidruntime performance
Core Design Contradiction:
Adaptability or versatilityVSProductivity

Solution Approach 1:

The patent applies local quality by placing associated field values in close proximity to each other within the same or adjacent memory pools. Each field type is organized in dedicated contiguous regions, ensuring that frequently accessed related fields are located locally in memory. This local organization maintains data layout flexibility while minimizing page faults and improving runtime performance through better cache utilization.

Inventive Principle:
Principle #3Local quality

Data Source

PatentUS10275230B2Cache aware self-referential structure peeling
Publication Date: 2019.04.30 ADVANCED MICRO DEVICES INC
  • US10275230B2 patent drawing
  • US10275230B2 patent drawing
  • US10275230B2 patent drawing

AI summary

Methods of compiling source code are provided. A method includes identifying a first array of structures (AOS), having a plurality of array elements, each array element being a structure with a plurality of fields, and performing structure peeling on the first AOS to convert a data layout of the first AOS to an array of structure of arrays (AOSOA) including a plurality of memory blocks of uniform block size. At least one of the plurality of memory blocks is allocated for each field of the plurality of fields. The method further includes allocating a number of complete memory blocks to accommodate all of the plurality of array elements of the AOS.