@@ -9,6 +9,7 @@ use openvm_cuda_backend::{
99 base:: DeviceMatrix , chip:: get_empty_air_proving_ctx, prover_backend:: GpuBackend , types:: F ,
1010} ;
1111use openvm_cuda_common:: copy:: MemCopyH2D ;
12+ use openvm_cuda_common:: d_buffer:: DeviceBuffer ;
1213use openvm_stark_backend:: { prover:: types:: AirProvingContext , Chip } ;
1314
1415use crate :: {
@@ -27,6 +28,44 @@ pub struct Rv32BaseAluChipGpu {
2728}
2829
2930impl Chip < DenseRecordArena , GpuBackend > for Rv32BaseAluChipGpu {
31+ fn generate_proving_ctx_new ( & self , arena : DenseRecordArena , d_trace : & DeviceBuffer < F > , d_subs : & DeviceBuffer < u32 > , calls_per_apc_row : u32 ) {
32+ const RECORD_SIZE : usize = size_of :: < (
33+ Rv32BaseAluAdapterRecord ,
34+ BaseAluCoreRecord < RV32_REGISTER_NUM_LIMBS > ,
35+ ) > ( ) ;
36+ let records = arena. allocated ( ) ;
37+ if records. is_empty ( ) {
38+ return ;
39+ // return get_empty_air_proving_ctx::<GpuBackend>();
40+ }
41+ debug_assert_eq ! ( records. len( ) % RECORD_SIZE , 0 ) ;
42+
43+ let trace_width = BaseAluCoreCols :: < F , RV32_REGISTER_NUM_LIMBS , RV32_CELL_BITS > :: width ( )
44+ + Rv32BaseAluAdapterCols :: < F > :: width ( ) ;
45+ let trace_height = next_power_of_two_or_zero ( records. len ( ) / RECORD_SIZE ) ;
46+
47+ let d_records = records. to_device ( ) . unwrap ( ) ;
48+
49+ unsafe {
50+ tracegen (
51+ d_trace, // replaced with apc trace
52+ trace_height,
53+ & d_records,
54+ & self . range_checker . count ,
55+ self . range_checker . count . len ( ) ,
56+ & self . bitwise_lookup . count ,
57+ RV32_CELL_BITS ,
58+ self . timestamp_max_bits as u32 ,
59+ // d_apc_trace.buffer(),
60+ d_subs, // same length as dummy width
61+ calls_per_apc_row,
62+ )
63+ . unwrap ( ) ;
64+ }
65+
66+ // AirProvingContext::simple_no_pis(d_trace)
67+ }
68+
3069 fn generate_proving_ctx ( & self , arena : DenseRecordArena ) -> AirProvingContext < GpuBackend > {
3170 const RECORD_SIZE : usize = size_of :: < (
3271 Rv32BaseAluAdapterRecord ,
0 commit comments