cpu,stdlib: Fix Access Trace for Accessing Indices in SpatterGen (#1258)

This change fixes the way indices are generated in a multi generator
setup.
It changes it from all cores generating the same trace of indices for
accessing the index array to each core generating an interleaved subset
of indices.
For an example look below for traces (indices to index array) in a 2
core setup.

Before:
core_0: 0, 1, 2, 3, 4, 5, 6, 7, ...
core_1: 0, 1, 2, 3, 4, 5, 6, 7, ...
After:
core_0: 0, 1, 2, 3, 8, 9, 10, 11, ...
core_1: 4, 5, 6, 7, 12, 13, 14, 15, ...

Additionally, this change fixes the SpatterKernel class in the standard
library to comply with the change in the SpatterGen source code.
This commit is contained in:
Mahyar Samani
2024-06-20 11:24:44 -07:00
committed by GitHub
parent ed860dfe54
commit 7ff1e381c9
4 changed files with 50 additions and 8 deletions

View File

@@ -150,22 +150,28 @@ class SpatterKernel:
kernel_delta: int,
kernel_count: int,
kernel_type: SpatterKernelType,
kernel_trace: List[int],
base_index: int,
indices_per_stride: int,
stride_size: int,
index_size: int,
base_index_addr: Addr,
value_size: int,
base_value_addr: Addr,
kernel_trace: List[int],
fix_empty_trace: bool = False,
):
self._id = kernel_id
self._delta = kernel_delta
self._count = kernel_count
self._trace = kernel_trace
self._type = kernel_type
self._base_index = base_index
self._indices_per_stride = indices_per_stride
self._stride_size = stride_size
self._index_size = index_size
self._base_index_addr = base_index_addr
self._value_size = value_size
self._base_value_addr = base_value_addr
self._trace = kernel_trace
if fix_empty_trace and len(kernel_trace) == 0:
inform(
@@ -185,6 +191,9 @@ class SpatterKernel:
self._delta,
self._count,
self._type.getValue(),
self._base_index,
self._indices_per_stride,
self._stride_size,
self._index_size,
self._base_index_addr,
self._value_size,