25 const char *
names[] = {
"OpenSpin",
"DegrandRossi"};
37 printfQuda(
"prec sloppy_prec S_dimension T_dimension Ls_dimension\n");
48 int main(
int argc,
char **argv)
59 app->parse(argc, argv);
60 }
catch (
const CLI::ParseError &e) {
89 if (result)
warningQuda(
"Google tests for QUDA contraction failed!");
106 int test(
int contractionType,
int Prec)
112 default:
errorQuda(
"Undefined QUDA precision type %d\n", Prec);
127 void *d_result = malloc(2 *
V * 16 * data_size);
131 ((
float *)spinorX)[i] = rand() / (float)RAND_MAX;
132 ((
float *)spinorY)[i] = rand() / (float)RAND_MAX;
136 ((
double *)spinorX)[i] = rand() / (double)RAND_MAX;
137 ((
double *)spinorY)[i] = rand() / (double)RAND_MAX;
148 switch (contractionType) {
151 default:
errorQuda(
"Undefined contraction type %d\n", contractionType);
180 using ::testing::TestWithParam;
196 int prec = ::testing::get<0>(GetParam());
197 int contractionType = ::testing::get<1>(GetParam());
198 auto faults =
test(contractionType,
prec);
199 EXPECT_EQ(faults, 0) <<
"CPU and GPU implementations do not agree";
205 int prec = ::testing::get<0>(
param.param);
206 int contractType = ::testing::get<1>(
param.param);
::testing::tuple< int, int > param
virtual ~ContractionTest()
TestEventListener * Release(TestEventListener *listener)
TestEventListener * default_result_printer() const
TestEventListeners & listeners()
static UnitTest * GetInstance()
static const ParamType & GetParam()
std::shared_ptr< QUDAApp > make_app(std::string app_description, std::string app_name)
std::array< int, 4 > gridsize_from_cmdline
QudaPrecision prec_sloppy
int contraction_reference(Float *spinorX, Float *spinorY, Float *d_result, QudaContractType cType, int X[])
int test(int contractionType, int Prec)
int main(int argc, char **argv)
TEST_P(ContractionTest, verify)
constexpr int NcontractType
std::string getContractName(testing::TestParamInfo<::testing::tuple< int, int >> param)
INSTANTIATE_TEST_SUITE_P(QUDA, ContractionTest, Combine(Range(0, 2), Range(0, NcontractType)), getContractName)
QudaInvertParam inv_param
enum QudaPrecision_s QudaPrecision
enum QudaContractType_s QudaContractType
@ QUDA_CONTRACT_TYPE_OPEN
@ QUDA_CONTRACT_TYPE_INVALID
#define EXPECT_EQ(val1, val2)
int RUN_ALL_TESTS() GTEST_MUST_USE_RESULT_
int dimPartitioned(int dim)
void initComms(int argc, char **argv, std::array< int, 4 > &commDims)
void setContractInvertParam(QudaInvertParam &inv_param)
const char * get_prec_str(QudaPrecision prec)
const char * get_contract_str(QudaContractType type)
void setTransferGPU(bool)
void contractQuda(const ColorSpinorField &x, const ColorSpinorField &y, void *result, QudaContractType cType)
internal::ParamGenerator< T > Range(T start, T end, IncrementT step)
internal::CartesianProductHolder< Generator... > Combine(const Generator &... g)
internal::ValueArray< T... > Values(T... v)
internal::ParamGenerator< bool > Bool()
GTEST_API_ void InitGoogleTest(int *argc, char **argv)
Main header file for the QUDA library.
void initQuda(int device)
QudaInvertParam newQudaInvertParam(void)
QudaPrecision cuda_prec_sloppy
QudaPrecision cuda_prec_precondition