-
Notifications
You must be signed in to change notification settings - Fork 414
Changed the random number generator in packer to deterministic vtr::irand #2871
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
53cd616
bf028ef
71a4c20
313753c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,6 +55,7 @@ | |
#include "vpr_context.h" | ||
#include "vtr_math.h" | ||
#include "vtr_vector.h" | ||
#include "vtr_random.h" | ||
|
||
namespace { | ||
|
||
|
@@ -160,6 +161,8 @@ GreedyClusterer::do_clustering(ClusterLegalizer& cluster_legalizer, | |
|
||
print_pack_status_header(); | ||
|
||
vtr::RngContainer rng(0); | ||
AlexandreSinger marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess that the only user of this RngContainer object is GreedyCandidateSelector. If this is the case, I think it makes more sense to add it as a member variable to GreedyCandidateSelector and initilize it in its constructor instead of passing it down a deep function call hierarchy. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree! That would make things much cleaner! Especially since it is an independent object! |
||
|
||
// Continue clustering as long as a valid seed is returned from the seed | ||
// selector. | ||
while (seed_mol != nullptr) { | ||
|
@@ -183,7 +186,8 @@ GreedyClusterer::do_clustering(ClusterLegalizer& cluster_legalizer, | |
balance_block_type_utilization, | ||
attraction_groups, | ||
num_used_type_instances, | ||
mutable_device_ctx); | ||
mutable_device_ctx, | ||
rng); | ||
|
||
if (!new_cluster_id.is_valid()) { | ||
// If the previous strategy failed, try to grow the cluster again, | ||
|
@@ -197,7 +201,8 @@ GreedyClusterer::do_clustering(ClusterLegalizer& cluster_legalizer, | |
balance_block_type_utilization, | ||
attraction_groups, | ||
num_used_type_instances, | ||
mutable_device_ctx); | ||
mutable_device_ctx, | ||
rng); | ||
} | ||
|
||
// Ensure that the seed was packed successfully. | ||
|
@@ -239,7 +244,8 @@ LegalizationClusterId GreedyClusterer::try_grow_cluster( | |
bool balance_block_type_utilization, | ||
AttractionInfo& attraction_groups, | ||
std::map<t_logical_block_type_ptr, size_t>& num_used_type_instances, | ||
DeviceContext& mutable_device_ctx) { | ||
DeviceContext& mutable_device_ctx, | ||
vtr::RngContainer& rng) { | ||
|
||
// Check to ensure that this molecule is unclustered. | ||
VTR_ASSERT(!cluster_legalizer.is_mol_clustered(seed_mol)); | ||
|
@@ -267,7 +273,8 @@ LegalizationClusterId GreedyClusterer::try_grow_cluster( | |
legalization_cluster_id, | ||
cluster_legalizer, | ||
prepacker, | ||
attraction_groups); | ||
attraction_groups, | ||
rng); | ||
|
||
/* | ||
* When attraction groups are created, the purpose is to pack more densely by adding more molecules | ||
|
@@ -316,7 +323,8 @@ LegalizationClusterId GreedyClusterer::try_grow_cluster( | |
legalization_cluster_id, | ||
cluster_legalizer, | ||
prepacker, | ||
attraction_groups); | ||
attraction_groups, | ||
rng); | ||
|
||
// If the next candidate molecule is the same as the previous | ||
// candidate molecule, increment the number of repeated | ||
|
Uh oh!
There was an error while loading. Please reload this page.