Skip to content

Commit

Permalink
fixed gtest, detected mem leak
Browse files Browse the repository at this point in the history
  • Loading branch information
alexstrel committed Mar 8, 2024
1 parent 2f84088 commit d5a766b
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 27 deletions.
10 changes: 5 additions & 5 deletions include/enum_quda.h
Original file line number Diff line number Diff line change
Expand Up @@ -563,16 +563,16 @@ typedef enum QudaSpinTasteGamma_s {
} QudaSpinTasteGamma;

typedef enum QudaContractType_s {
QUDA_CONTRACT_TYPE_STAGGERED_FT_T, // Staggered, FT in tdim
QUDA_CONTRACT_TYPE_DR_FT_T, // DegrandRossi insertion, FT in tdim
QUDA_CONTRACT_TYPE_DR_FT_Z, // DegrandRossi insertion, FT in zdim
QUDA_CONTRACT_TYPE_STAGGERED, // Staggered, no summation (TODO: remove line)
QUDA_CONTRACT_TYPE_DR, // DegrandRossi insertion, no summation
QUDA_CONTRACT_TYPE_OPEN, // Open spin elementals, no summation
QUDA_CONTRACT_TYPE_OPEN_SUM_T, // Open spin elementals, spatially summed over tdim
QUDA_CONTRACT_TYPE_OPEN_SUM_Z, // Open spin elementals, spatially summed over zdim
QUDA_CONTRACT_TYPE_OPEN_FT_T, // Open spin elementals, FT in tdim
QUDA_CONTRACT_TYPE_OPEN_FT_Z, // Open spin elementals, FT in zdim
QUDA_CONTRACT_TYPE_DR, // DegrandRossi insertion, no summation
QUDA_CONTRACT_TYPE_DR_FT_T, // DegrandRossi insertion, FT in tdim
QUDA_CONTRACT_TYPE_DR_FT_Z, // DegrandRossi insertion, FT in zdim
QUDA_CONTRACT_TYPE_STAGGERED, // Staggered, no summation (TODO: remove line)
QUDA_CONTRACT_TYPE_STAGGERED_FT_T, // Staggered, FT in tdim
QUDA_CONTRACT_TYPE_INVALID = QUDA_INVALID_ENUM
} QudaContractType;

Expand Down
10 changes: 5 additions & 5 deletions include/enum_quda_fortran.h
Original file line number Diff line number Diff line change
Expand Up @@ -497,16 +497,16 @@
#define QUDA_SPIN_TASTE_INVALID QUDA_INVALID_ENUM

#define QudaContractType integer(4)
#define QUDA_CONTRACT_TYPE_STAGGERED_FT_T,
#define QUDA_CONTRACT_TYPE_DR_FT_T,
#define QUDA_CONTRACT_TYPE_DR_FT_Z,
#define QUDA_CONTRACT_TYPE_STAGGERED,
#define QUDA_CONTRACT_TYPE_DR,
#define QUDA_CONTRACT_TYPE_OPEN ,
#define QUDA_CONTRACT_TYPE_OPEN_SUM_T,
#define QUDA_CONTRACT_TYPE_OPEN_SUM_Z,
#define QUDA_CONTRACT_TYPE_OPEN_FT_T,
#define QUDA_CONTRACT_TYPE_OPEN_FT_Z,
#define QUDA_CONTRACT_TYPE_DR,
#define QUDA_CONTRACT_TYPE_DR_FT_T,
#define QUDA_CONTRACT_TYPE_DR_FT_Z,
#define QUDA_CONTRACT_TYPE_STAGGERED,
#define QUDA_CONTRACT_TYPE_STAGGERED_FT_T,
#define QUDA_CONTRACT_TYPE_INVALID = QUDA_INVALID_ENUM

#define QudaContractGamma integer(4)
Expand Down
12 changes: 4 additions & 8 deletions tests/contractFT_test_gtest.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,10 @@ TEST_P(ContractFTTest, verify)

std::string gettestname(::testing::TestParamInfo<test_t> param)
{
auto contractType = ::testing::get<0>(param.param);
auto prec = ::testing::get<1>(param.param);
std::string str("contract_");

const char *names[] = {"DegrandRossi_FT_t","DegrandRossi_FT_z", "Staggered_FT_t"};

std::string str(names[contractType]);
str += std::string("_");
str += std::string(get_prec_str(getPrecision(prec)));
str += get_contract_str(::testing::get<0>(param.param));
str += std::string("_") + get_prec_str(::testing::get<1>(param.param));

return str;
}
Expand All @@ -58,5 +54,5 @@ auto contract_types = Values(QUDA_CONTRACT_TYPE_STAGGERED_FT_T); //FIXME : exten

auto precisions = Values(QUDA_DOUBLE_PRECISION, QUDA_SINGLE_PRECISION);

INSTANTIATE_TEST_SUITE_P(QUDA, ContractFTTest, Combine(contract_types, precisions), gettestname);
INSTANTIATE_TEST_SUITE_P(contraction_ft, ContractFTTest, Combine(contract_types, precisions), gettestname);

2 changes: 0 additions & 2 deletions tests/utils/command_line_params.h
Original file line number Diff line number Diff line change
Expand Up @@ -541,8 +541,6 @@ extern double eofa_mq1;
extern double eofa_mq2;
extern double eofa_mq3;

extern QudaContractType contract_type;

// SU(3) smearing options
extern double gauge_smear_rho;
extern double gauge_smear_epsilon;
Expand Down
14 changes: 7 additions & 7 deletions tests/utils/misc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,15 @@ const char *get_contract_str(QudaContractType type)

switch (type) {
case QUDA_CONTRACT_TYPE_OPEN: ret = "open"; break;
case QUDA_CONTRACT_TYPE_OPEN_SUM_T: ret = "open-sum-t"; break;
case QUDA_CONTRACT_TYPE_OPEN_SUM_Z: ret = "open-sum-z"; break;
case QUDA_CONTRACT_TYPE_OPEN_FT_T: ret = "open-ft-t"; break;
case QUDA_CONTRACT_TYPE_OPEN_FT_Z: ret = "open-ft-z"; break;
case QUDA_CONTRACT_TYPE_OPEN_SUM_T: ret = "open_sum_t"; break;
case QUDA_CONTRACT_TYPE_OPEN_SUM_Z: ret = "open_sum_z"; break;
case QUDA_CONTRACT_TYPE_OPEN_FT_T: ret = "open_ft_t"; break;
case QUDA_CONTRACT_TYPE_OPEN_FT_Z: ret = "open_ft_z"; break;
case QUDA_CONTRACT_TYPE_DR: ret = "dr"; break;
case QUDA_CONTRACT_TYPE_DR_FT_T: ret = "dr-ft-t"; break;
case QUDA_CONTRACT_TYPE_DR_FT_Z: ret = "dr-ft-z"; break;
case QUDA_CONTRACT_TYPE_DR_FT_T: ret = "dr_ft_t"; break;
case QUDA_CONTRACT_TYPE_DR_FT_Z: ret = "dr_ft_z"; break;
case QUDA_CONTRACT_TYPE_STAGGERED: ret = "stag"; break;
case QUDA_CONTRACT_TYPE_STAGGERED_FT_T: ret = "stag-ft-t"; break;
case QUDA_CONTRACT_TYPE_STAGGERED_FT_T: ret = "stag_ft_t"; break;
default: ret = "unknown"; break;
}

Expand Down

0 comments on commit d5a766b

Please sign in to comment.