@@ -373,6 +373,10 @@ int Recording::replay(const uint32_t *replay_inputs, uint32_t *replay_outputs) {
373
373
if (!replay_aggregate (op))
374
374
return false ;
375
375
break ;
376
+ case OpType::SymbolicWidth:
377
+ if (!replay_symbolic_width (op))
378
+ return false ;
379
+ break ;
376
380
case OpType::Free: {
377
381
ProfilerPhase profiler2 (pr_free);
378
382
@@ -471,6 +475,41 @@ void RecordThreadState::barrier() {
471
475
return m_internal->barrier ();
472
476
}
473
477
478
+ void RecordThreadState::notify_symbolic_width (uint32_t index,
479
+ uint32_t width_index) {
480
+ if (!paused ()) {
481
+ uint32_t start = m_recording.dependencies .size ();
482
+ Variable *v1 = jitc_var (index );
483
+ Variable *v2 = jitc_var (width_index);
484
+ add_in_param (v1->data , (VarType) v1->type );
485
+ add_out_param (v2->data , VarType::UInt32 );
486
+ uint32_t end = m_recording.dependencies .size ();
487
+
488
+ Operation op;
489
+ op.type = OpType::SymbolicWidth;
490
+ op.dependency_range = std::pair (start, end);
491
+ m_recording.operations .push_back (op);
492
+ }
493
+ }
494
+
495
+ int Recording::replay_symbolic_width (Operation &op){
496
+
497
+ uint32_t dependency_index = op.dependency_range .first ;
498
+ AccessInfo in_info = dependencies[dependency_index];
499
+ AccessInfo out_info = dependencies[dependency_index + 1 ];
500
+
501
+ ReplayVariable &in_var = replay_variables[in_info.slot ];
502
+ ReplayVariable &out_var = replay_variables[out_info.slot ];
503
+
504
+ out_var.alloc (backend, 1 , out_info.vtype );
505
+ uint32_t size = in_var.size (in_info.vtype );
506
+
507
+ if (!dry_run)
508
+ jitc_memcpy (backend, out_var.data , &size, sizeof (uint32_t ));
509
+
510
+ return true ;
511
+ }
512
+
474
513
/* *
475
514
* This function is called every time a pointer is freed using \ref
476
515
* jitc_free. It records the operation and removes the mapping from that
0 commit comments