33#include " primitives/less_than.cuh"
44#include " primitives/shared_buffer.cuh"
55#include " primitives/trace_access.h"
6+ #include " system/records.cuh"
67#include < cassert>
78
89inline constexpr size_t PERSISTENT_CHUNK = 8 ;
910inline constexpr size_t BLOCKS_PER_CHUNK = 2 ;
1011inline constexpr size_t VOLATILE_CHUNK = 1 ;
1112
12- template <size_t CHUNK, size_t BLOCKS> struct BoundaryRecord {
13- uint32_t address_space;
14- uint32_t ptr;
15- uint32_t timestamps[BLOCKS];
16- uint32_t values[CHUNK];
17- };
18-
1913template <typename T> struct PersistentBoundaryCols {
2014 T expand_direction;
2115 T address_space;
@@ -43,7 +37,7 @@ __global__ void cukernel_persistent_boundary_tracegen(
4337 size_t height,
4438 size_t width,
4539 uint8_t const *const *initial_mem,
46- BoundaryRecord <PERSISTENT_CHUNK, BLOCKS_PER_CHUNK> *records,
40+ MemoryInventoryRecord <PERSISTENT_CHUNK, BLOCKS_PER_CHUNK> *records,
4741 size_t num_records,
4842 FpArray<16 > *poseidon2_buffer,
4943 uint32_t *poseidon2_buffer_idx,
@@ -54,7 +48,7 @@ __global__ void cukernel_persistent_boundary_tracegen(
5448 RowSlice row = RowSlice (trace + row_idx, height);
5549
5650 if (record_idx < num_records) {
57- BoundaryRecord <PERSISTENT_CHUNK, BLOCKS_PER_CHUNK> record = records[record_idx];
51+ MemoryInventoryRecord <PERSISTENT_CHUNK, BLOCKS_PER_CHUNK> record = records[record_idx];
5852 Poseidon2Buffer poseidon2 (poseidon2_buffer, poseidon2_buffer_idx, poseidon2_capacity);
5953 COL_WRITE_VALUE (row, PersistentBoundaryCols, address_space, record.address_space );
6054 COL_WRITE_VALUE (row, PersistentBoundaryCols, leaf_label, record.ptr / PERSISTENT_CHUNK);
@@ -114,7 +108,7 @@ __global__ void cukernel_volatile_boundary_tracegen(
114108 Fp *trace,
115109 size_t height,
116110 size_t width,
117- BoundaryRecord <VOLATILE_CHUNK, 1 > const *records,
111+ MemoryInventoryRecord <VOLATILE_CHUNK, 1 > const *records,
118112 size_t num_records,
119113 uint32_t *range_checker,
120114 size_t range_checker_num_bins,
@@ -131,7 +125,7 @@ __global__ void cukernel_volatile_boundary_tracegen(
131125 // For the sake of always filling `addr_lt_aux`
132126 row.fill_zero (0 , width);
133127 }
134- BoundaryRecord <VOLATILE_CHUNK, 1 > record = records[idx];
128+ MemoryInventoryRecord <VOLATILE_CHUNK, 1 > record = records[idx];
135129 rc.decompose (
136130 record.address_space ,
137131 as_max_bits,
@@ -150,7 +144,7 @@ __global__ void cukernel_volatile_boundary_tracegen(
150144 COL_WRITE_VALUE (row, VolatileBoundaryCols, is_valid, Fp::one ());
151145
152146 if (idx != num_records - 1 ) {
153- BoundaryRecord <VOLATILE_CHUNK, 1 > next_record = records[idx + 1 ];
147+ MemoryInventoryRecord <VOLATILE_CHUNK, 1 > next_record = records[idx + 1 ];
154148 uint32_t curr[ADDR_ELTS] = {record.address_space , record.ptr };
155149 uint32_t next[ADDR_ELTS] = {next_record.address_space , next_record.ptr };
156150 IsLessThanArray::generate_subrow (
@@ -198,8 +192,8 @@ extern "C" int _persistent_boundary_tracegen(
198192 size_t poseidon2_capacity
199193) {
200194 auto [grid, block] = kernel_launch_params (height);
201- BoundaryRecord <PERSISTENT_CHUNK, BLOCKS_PER_CHUNK> *d_records =
202- reinterpret_cast <BoundaryRecord <PERSISTENT_CHUNK, BLOCKS_PER_CHUNK> *>(d_raw_records);
195+ MemoryInventoryRecord <PERSISTENT_CHUNK, BLOCKS_PER_CHUNK> *d_records =
196+ reinterpret_cast <MemoryInventoryRecord <PERSISTENT_CHUNK, BLOCKS_PER_CHUNK> *>(d_raw_records);
203197 FpArray<16 > *d_poseidon2_buffer = reinterpret_cast <FpArray<16 > *>(d_poseidon2_raw_buffer);
204198 cukernel_persistent_boundary_tracegen<<<grid, block>>> (
205199 d_trace,
@@ -227,7 +221,8 @@ extern "C" int _volatile_boundary_tracegen(
227221 size_t ptr_max_bits
228222) {
229223 auto [grid, block] = kernel_launch_params (height, 512 );
230- auto d_records = reinterpret_cast <BoundaryRecord<VOLATILE_CHUNK, 1 > const *>(d_raw_records);
224+ auto d_records =
225+ reinterpret_cast <MemoryInventoryRecord<VOLATILE_CHUNK, 1 > const *>(d_raw_records);
231226 cukernel_volatile_boundary_tracegen<<<grid, block>>> (
232227 d_trace,
233228 height,
0 commit comments