Skip to content

Commit

Permalink
Move all components left to new memory model
Browse files Browse the repository at this point in the history
This commit contains a bunch of similar changes in different files,
required to move to new memory.
  • Loading branch information
aleasims committed Mar 27, 2024
1 parent 7e9764f commit 31d8ecd
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
5 changes: 3 additions & 2 deletions include/nil/blueprint/extract_constructor_parameters.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,10 @@ namespace nil {
ptr_type input_ptr = static_cast<ptr_type>(
typename BlueprintFieldType::integral_type(detail::var_value<BlueprintFieldType, var>(variables[input_value], assignment, internal_storage, gen_mode.has_assignments()).data));
if (gen_mode.has_assignments()) {
size_type elem_size = (BlueprintFieldType::number_bits + 7) / 8;
for (std::size_t i = 0; i < input_length; i++) {
ASSERT(memory[input_ptr].size == (BlueprintFieldType::number_bits + 7) / 8);
const auto v = memory.load(input_ptr++);
const auto v = memory.load(input_ptr, elem_size);
input_ptr += elem_size;
const auto value = detail::var_value<BlueprintFieldType, var>(v, assignment, internal_storage, true);
res.push_back(detail::put_internal_value<typename BlueprintFieldType::value_type, BlueprintFieldType, var>(value, internal_storage));
}
Expand Down
5 changes: 3 additions & 2 deletions include/nil/blueprint/integers/bit_de_composition.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,10 @@ namespace nil {
ptr_type result_ptr = static_cast<ptr_type>(
typename BlueprintFieldType::integral_type(detail::var_value<BlueprintFieldType, var>
(variables[result_value], assignment, internal_storage, true).data));
size_type elem_size = (BlueprintFieldType::number_bits + 7) / 8;
for (var v : result) {
ASSERT(memory[result_ptr].size == (BlueprintFieldType::number_bits + 7) / 8);
memory.store(result_ptr++, v);
memory.store(result_ptr, (BlueprintFieldType::number_bits + 7) / 8, v);
result_ptr += elem_size;
}
}
}
Expand Down
5 changes: 3 additions & 2 deletions include/nil/blueprint/recursive_prover/fri_array_swap.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,9 @@ namespace nil {
detail::var_value<BlueprintFieldType, var>
(frame.scalars[result_value], assignment, internal_storage, true).data));
for (std::size_t i = 0; i < array_size; i++) {
ASSERT(memory[result_ptr].size == (BlueprintFieldType::number_bits + 7) / 8);
memory.store(result_ptr++, res[i]);
size_type elem_size = (BlueprintFieldType::number_bits + 7) / 8;
memory.store(result_ptr, elem_size, res[i]);
result_ptr += elem_size;
}
}
}
Expand Down
5 changes: 3 additions & 2 deletions include/nil/blueprint/recursive_prover/fri_cosets.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,9 @@ namespace nil {
(variables[result_value], assignment, internal_storage, true).data));
for (std::size_t i = 0; i < result.size(); i++) {
for (std::size_t j = 0; j < 3; j++) {
ASSERT(memory[result_ptr].size == (BlueprintFieldType::number_bits + 7) / 8);
memory.store(result_ptr++, result[i][j]);
size_type elem_size = (BlueprintFieldType::number_bits + 7) / 8;
memory.store(result_ptr, elem_size, result[i][j]);
result_ptr += elem_size;
}
}
}
Expand Down

0 comments on commit 31d8ecd

Please sign in to comment.