size_t hardware::code::Real::get_read_write_size_update(const std::string& in, const int numeq) const { size_t D = kernelParameters->getFloatSize(); if (in == "update_alpha_cgm") { if (numeq == 0) throw Print_Error_Message("get_read_write_size_update with update_alpha_cgm and numeq=0", __FILE__, __LINE__); // this kernel reads 3 vectors of float, 3 float, 1 int and writes 1 vector of float return (4 * numeq + 3) * D + sizeof(int); } if (in == "update_beta_cgm") { if (numeq == 0) throw Print_Error_Message("get_read_write_size_update with update_beta_cgm and numeq=0", __FILE__, __LINE__); // this kernel reads 2 vectors of float, 1 float, 1 int and writes 1 vector of float return (3 * numeq + 1) * D + sizeof(int); } if (in == "update_zeta_cgm") { if (numeq == 0) throw Print_Error_Message("get_read_write_size_update with update_zeta_cgm and numeq=0", __FILE__, __LINE__); // this kernel reads 3 vectors of float, 2 float, 1 int and writes 1 vector of float return (4 * numeq + 2) * D + sizeof(int); } return 0; }
uint64_t hardware::code::Real::get_flop_size_update(const std::string& in, const int numeq) const { if (in == "update_alpha_cgm") { if (numeq == 0) throw Print_Error_Message("get_flop_size_update with update_alpha_cgm and numeq=0", __FILE__, __LINE__); return 4 * numeq; } if (in == "update_beta_cgm") { if (numeq == 0) throw Print_Error_Message("get_flop_size_update with update_beta_cgm and numeq=0", __FILE__, __LINE__); return 2 * numeq; } if (in == "update_zeta_cgm") { if (numeq == 0) throw Print_Error_Message("get_flop_size_update with update_zeta_cgm and numeq=0", __FILE__, __LINE__); return 11 * numeq; } return 0; }
// Class D_KS_eo void physics::fermionmatrix::D_KS_eo::operator()(const physics::lattices::Staggeredfield_eo* out, const physics::lattices::Gaugefield& gf, const physics::lattices::Staggeredfield_eo& in, const physics::AdditionalParameters* additionalParameters) const { if (additionalParameters == NULL) DKS_eo(out, gf, in, evenodd); else throw Print_Error_Message( "D_KS_eo operator applied passing to it some additional parameters! This should not happen!"); }
// Class MdagM_eo void physics::fermionmatrix::MdagM_eo::operator()(const physics::lattices::Staggeredfield_eo* out, const physics::lattices::Gaugefield& gf, const physics::lattices::Staggeredfield_eo& in, const physics::AdditionalParameters* additionalParameters) const { if (additionalParameters != NULL) { if (upper_left == EVEN) { // mass**2 - Deo*Doe DKS_eo(&tmp, gf, in, ODD); DKS_eo(out, gf, tmp, EVEN); } else { // mass**2 - Doe*Deo DKS_eo(&tmp, gf, in, EVEN); DKS_eo(out, gf, tmp, ODD); } hmc_float mass = additionalParameters->getMass(); saxpby(out, {mass * mass, 0.}, in, {-1., 0.}, *out); } else throw Print_Error_Message("MdagM_eo operator applied without the MANDATORY additional parameters! Aborting..."); }
hmc_float physics::fermionmatrix::Fermionmatrix_stagg_basic::getThresholdForMinimumEigenvalue(hmc_float) const { throw Print_Error_Message("Threshold for minimum eigenvalue not existing or not implemented!"); }
int main( int argc, char* argv[] ) { Logger::Start_Log( "converter.log", false ); for( int i = 0; i < argc; i++ ) to_lower( argv[i] ); if( argc == 1 ) { print_usage( argv[0], false ); return ERROR_SUCCESS; } if( strcmp( argv[1], "--help" ) == 0 || strcmp( argv[1], "-h" ) == 0 ) { print_usage( argv[0], true ); return ERROR_SUCCESS; } if( argc > 4 ) { Print_Error_Message( "Error: Too many arguments." ); return ERROR_BAD_ARGUMENTS; } char* path; char* fbxFilename; Parse_Path( argv[1], path, fbxFilename ); if( strlen( fbxFilename ) < 4 || strcmp( fbxFilename + strlen( fbxFilename ) - 4, ".fbx" ) != 0 ) { Print_Error_Message( "Error: the FBX file argument does not have the proper file extension.\n" ); return ERROR_BAD_ARGUMENTS; } if( strlen( fbxFilename ) == 4 ) { Print_Error_Message( "Error: the FBX file argument must be more than just the extension.\n" ); return ERROR_BAD_ARGUMENTS; } FBXImporter importer; importer.Import( path, fbxFilename ); if( argc == 4 ) { if( strcmp( argv[2], "-include" ) != 0 ) { Print_Error_Message( "Error: unknown parameter/option.\n" ); return ERROR_BAD_ARGUMENTS; } char* additionalTexture = argv[3]; importer.Add_Extra_Texture( additionalTexture ); } ModelWriter::Write( importer.GetModelData(), path, MODEL_CONVERTER_VERSION ); Logger::Stop_Log(); return ERROR_SUCCESS; }