Skip to content

Commit

Permalink
#92: Set the test seed to constant for reproducibility
Browse files Browse the repository at this point in the history
  • Loading branch information
mmodat committed Jul 24, 2023
1 parent 688d9ac commit fb586da
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 20 deletions.
2 changes: 1 addition & 1 deletion niftyreg_build_version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
285
287
6 changes: 6 additions & 0 deletions reg-lib/cuda/blockMatchingKernel.cu
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,12 @@ __device__ __inline__ float blockReduceSum(float val, unsigned tid) {
shared[tid] += shared[tid + i];
__syncthreads();
}
// if (tid == 0){
// for (unsigned i = 1; i < 64; ++i) {
// shared[0] += shared[i];
// }
// }
// __syncthreads();
return shared[0];
}
/* *************************************************************** */
Expand Down
3 changes: 1 addition & 2 deletions reg-test/reg_test_blockMatching.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ class BMTest {
return;

// Create a random number generator
std::random_device rd;
std::mt19937 gen(rd());
std::mt19937 gen(0);
std::uniform_real_distribution<float> distr(0, 1);

// Create 2D and 3D reference images
Expand Down
3 changes: 1 addition & 2 deletions reg-test/reg_test_conjugateGradient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ class ConjugateGradientTest: public InterfaceOptimiser {
return;

// Create a random number generator
std::random_device rd;
std::mt19937 gen(rd());
std::mt19937 gen(0);
std::uniform_real_distribution<float> distr(0, 1);

// Create a reference 2D image
Expand Down
3 changes: 1 addition & 2 deletions reg-test/reg_test_getDeformationField.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ class GetDeformationFieldTest {
return;

// Create a random number generator
std::random_device rd;
std::mt19937 gen(rd());
std::mt19937 gen(0);
std::uniform_real_distribution<float> distr(0, 1);

// Create a 2D reference image
Expand Down
3 changes: 1 addition & 2 deletions reg-test/reg_test_lncc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ class LNCCTest {
return;

// Create a random number generator
std::random_device rd;
std::mt19937 gen(rd());
std::mt19937 gen(0);
std::uniform_real_distribution<float> distr(0, 1);

// Create reference and floating 2D images
Expand Down
3 changes: 1 addition & 2 deletions reg-test/reg_test_normaliseGradient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ class NormaliseGradientTest {
return;

// Create a random number generator
std::random_device rd;
std::mt19937 gen(rd());
std::mt19937 gen(0);
std::uniform_real_distribution<float> distr(0, 1);

// Create a reference 2D image
Expand Down
4 changes: 1 addition & 3 deletions reg-test/reg_test_regr_blockMatching.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ class BMTest {
if (!testCases.empty())
return;

// Create a random number generator
std::random_device rd;
std::mt19937 gen(rd());
std::mt19937 gen(0);
std::uniform_real_distribution<float> distr(0, 1);

// Create a reference and floating 2D images
Expand Down
3 changes: 1 addition & 2 deletions reg-test/reg_test_regr_lts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ class LTSTest {
return;

// Create a random number generator
std::random_device rd;
std::mt19937 gen(rd());
std::mt19937 gen(0);
std::uniform_real_distribution<float> distr(0, 1);

// Create a reference and floating 2D images
Expand Down
3 changes: 1 addition & 2 deletions reg-test/reg_test_regr_nmi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ class NmiTest {
return;

// Create a random number generator
std::random_device rd;
std::mt19937 gen(rd());
std::mt19937 gen(0);
std::uniform_real_distribution<float> distr(0, 1);

// Create 2D reference, floating and control point grid images
Expand Down
3 changes: 1 addition & 2 deletions reg-test/reg_test_voxelCentricToNodeCentric.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ class VoxelCentricToNodeCentricTest {
return;

// Create a random number generator
std::random_device rd;
std::mt19937 gen(rd());
std::mt19937 gen(0);
std::uniform_real_distribution<float> distr(0, 1);

// Create a 2D reference image
Expand Down

0 comments on commit fb586da

Please sign in to comment.