forked from visoftsolutions/noir_rs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: remove 'extern template's, expand macros (AztecProtocol#3953)
- "extern template" was [cargo-culted](https://en.wikipedia.org/wiki/Cargo_cult_programming). Deleting it all changes no semantics at all. The feature seems at a surface level to be used like other uses of C++ 'extern' that indicate to look in a different compilation unit, such as is used by global variables in a different translation unit. But, C++ actually already looks in different translation units by default for all the symbols we applied it to. The only use of extern template is actually if the source is provided in a header, the exact opposite of how it was used in the codebase. - Simplifies usage of instantiation macros that were not doing much
- Loading branch information
Showing
112 changed files
with
231 additions
and
578 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
barretenberg/cpp/src/barretenberg/flavor/generated/AvmMini_flavor.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
barretenberg/cpp/src/barretenberg/flavor/generated/Toy_flavor.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
barretenberg/cpp/src/barretenberg/flavor/relation_definitions.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#pragma once | ||
|
||
#include "barretenberg/relations/relation_types.hpp" | ||
|
||
// Utilities for explicit instantiation of relation and permutation classes. | ||
|
||
#define ExtendedEdge(Flavor) Flavor::ExtendedEdges | ||
#define EvaluationEdge(Flavor) Flavor::AllValues | ||
#define EntityEdge(Flavor) Flavor::AllEntities<Flavor::FF> | ||
|
||
#define ACCUMULATE(...) _ACCUMULATE(__VA_ARGS__) | ||
#define _ACCUMULATE(RelationImpl, Flavor, AccumulatorType, EdgeType) \ | ||
template void \ | ||
RelationImpl<Flavor::FF>::accumulate<proof_system::Relation<RelationImpl<Flavor::FF>>::AccumulatorType, \ | ||
EdgeType(Flavor)>( \ | ||
proof_system::Relation<RelationImpl<Flavor::FF>>::AccumulatorType&, \ | ||
EdgeType(Flavor) const&, \ | ||
RelationParameters<Flavor::FF> const&, \ | ||
Flavor::FF const&); | ||
|
||
#define PERMUTATION_METHOD(...) _PERMUTATION_METHOD(__VA_ARGS__) | ||
#define _PERMUTATION_METHOD(MethodName, RelationImpl, Flavor, AccumulatorType, EdgeType) \ | ||
template typename proof_system::Relation<RelationImpl<Flavor::FF>>::AccumulatorType \ | ||
RelationImpl<Flavor::FF>::MethodName<proof_system::Relation<RelationImpl<Flavor::FF>>::AccumulatorType, \ | ||
EdgeType(Flavor)>(EdgeType(Flavor) const&, \ | ||
RelationParameters<Flavor::FF> const&); | ||
|
||
#define SUMCHECK_RELATION_CLASS(...) _SUMCHECK_RELATION_CLASS(__VA_ARGS__) | ||
#define DEFINE_SUMCHECK_RELATION_CLASS(RelationImpl, Flavor) \ | ||
ACCUMULATE(RelationImpl, Flavor, SumcheckTupleOfUnivariatesOverSubrelations, ExtendedEdge) \ | ||
ACCUMULATE(RelationImpl, Flavor, SumcheckArrayOfValuesOverSubrelations, EvaluationEdge) \ | ||
ACCUMULATE(RelationImpl, Flavor, SumcheckArrayOfValuesOverSubrelations, EntityEdge) | ||
|
||
#define SUMCHECK_PERMUTATION_CLASS(...) _SUMCHECK_PERMUTATION_CLASS(__VA_ARGS__) | ||
#define DEFINE_SUMCHECK_PERMUTATION_CLASS(RelationImpl, Flavor) \ | ||
PERMUTATION_METHOD(compute_permutation_numerator, RelationImpl, Flavor, UnivariateAccumulator0, ExtendedEdge) \ | ||
PERMUTATION_METHOD(compute_permutation_numerator, RelationImpl, Flavor, ValueAccumulator0, EvaluationEdge) \ | ||
PERMUTATION_METHOD(compute_permutation_numerator, RelationImpl, Flavor, ValueAccumulator0, EntityEdge) \ | ||
PERMUTATION_METHOD(compute_permutation_denominator, RelationImpl, Flavor, UnivariateAccumulator0, ExtendedEdge) \ | ||
PERMUTATION_METHOD(compute_permutation_denominator, RelationImpl, Flavor, ValueAccumulator0, EvaluationEdge) \ | ||
PERMUTATION_METHOD(compute_permutation_denominator, RelationImpl, Flavor, ValueAccumulator0, EntityEdge) |
Oops, something went wrong.