@@ -318,17 +318,17 @@ void TraceWriter::serialize_reg_info(nlohmann::json& j, const reg_info_t* reg, c
318318 for (int reg_idx = 0 ; reg_idx < reg->num_regs ; reg_idx++) {
319319 json::array_t thread_vals;
320320 for (int thread = 0 ; thread < 32 ; thread++) {
321- thread_vals.push_back (reg->reg_vals [thread][reg_idx]);
321+ thread_vals.emplace_back (reg->reg_vals [thread][reg_idx]);
322322 }
323- regs_array.push_back (thread_vals);
323+ regs_array.emplace_back (thread_vals);
324324 }
325325 j[" regs" ] = regs_array;
326326
327327 // Add register indices from CPU-side static mapping
328328 if (indices && !indices->reg_indices .empty ()) {
329329 json::array_t regs_indices_array;
330330 for (auto idx : indices->reg_indices ) {
331- regs_indices_array.push_back (idx);
331+ regs_indices_array.emplace_back (idx);
332332 }
333333 j[" regs_indices" ] = regs_indices_array;
334334 }
@@ -337,15 +337,15 @@ void TraceWriter::serialize_reg_info(nlohmann::json& j, const reg_info_t* reg, c
337337 if (reg->num_uregs > 0 ) {
338338 json::array_t uregs_array;
339339 for (int i = 0 ; i < reg->num_uregs ; i++) {
340- uregs_array.push_back (reg->ureg_vals [i]);
340+ uregs_array.emplace_back (reg->ureg_vals [i]);
341341 }
342342 j[" uregs" ] = uregs_array;
343343
344344 // Add unified register indices from CPU-side static mapping
345345 if (indices && !indices->ureg_indices .empty ()) {
346346 json::array_t uregs_indices_array;
347347 for (auto idx : indices->ureg_indices ) {
348- uregs_indices_array.push_back (idx);
348+ uregs_indices_array.emplace_back (idx);
349349 }
350350 j[" uregs_indices" ] = uregs_indices_array;
351351 }
@@ -401,9 +401,9 @@ void TraceWriter::serialize_mem_value_access(nlohmann::json& j, const mem_value_
401401 for (int lane = 0 ; lane < 32 ; lane++) {
402402 json::array_t lane_vals;
403403 for (int r = 0 ; r < regs_needed; r++) {
404- lane_vals.push_back (mem->values [lane][r]);
404+ lane_vals.emplace_back (mem->values [lane][r]);
405405 }
406- values_array.push_back (lane_vals);
406+ values_array.emplace_back (lane_vals);
407407 }
408408 j[" values" ] = values_array;
409409}
@@ -427,7 +427,7 @@ void TraceWriter::serialize_tma_access(nlohmann::json& j, const tma_access_t* tm
427427 for (int i = 0 ; i < 16 ; i++) {
428428 std::stringstream ss;
429429 ss << " 0x" << std::hex << std::setfill (' 0' ) << std::setw (16 ) << tma->desc_raw [i];
430- desc_raw_array.push_back (ss.str ());
430+ desc_raw_array.emplace_back (ss.str ());
431431 }
432432 j[" desc_raw" ] = desc_raw_array;
433433}
0 commit comments