Skip to content

Commit

Permalink
Fix build with icpc and icpx
Browse files Browse the repository at this point in the history
  • Loading branch information
thelfer committed Nov 13, 2023
1 parent 020bb6b commit 714873e
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 15 deletions.
2 changes: 1 addition & 1 deletion bindings/python/mfront/DSLFactory.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ void declareDSLFactory() {
.def("getDSLFactory", DSLFactory::getDSLFactory,
return_value_policy<reference_existing_object>())
.staticmethod("getDSLFactory")
.def("createNewParser", &DSLFactory::createNewParser)
.def("createNewParser", &DSLFactory::createNewDSL)
.def("createNewDSL", &DSLFactory::createNewDSL);
}
4 changes: 2 additions & 2 deletions include/TFEL/ContractViolation.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ namespace tfel {
* \param[in] msg: message
*/
#ifndef TFEL_NO_REPORT_CONTRACT_VIOLATION
[[noreturn]] TFEL_HOST TFELEXCEPTION_VISIBILITY_EXPORT void reportContractViolation(
const char* const msg);
[[noreturn]] TFEL_HOST TFELEXCEPTION_VISIBILITY_EXPORT void
reportContractViolation(const char* const msg);
#else /* TFEL_NO_REPORT_CONTRACT_VIOLATION */
TFEL_HOST_DEVICE constexpr void reportContractViolation(const char* const) {
} // end of reportContractViolation
Expand Down
14 changes: 12 additions & 2 deletions include/TFEL/Math/ST2toST2/ST2toST2ST2toST2ProductExpr.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,12 @@ namespace tfel::math {
*/
template <typename ST2toST2Type, typename ST2toST2Type2>
TFEL_HOST_DEVICE constexpr Expr(const ST2toST2Type& a,
const ST2toST2Type2& b) {
const ST2toST2Type2& b)
: array_holder<StensorDimeToSize<
getSpaceDimension<ST2toST2ResultType>()>::value *
StensorDimeToSize<
getSpaceDimension<ST2toST2ResultType>()>::value,
numeric_type<ST2toST2ResultType>>() {
static_assert(implementsST2toST2Concept<ST2toST2Type>());
static_assert(implementsST2toST2Concept<ST2toST2Type2>());
static_assert(getSpaceDimension<ST2toST2Type>() == 1u);
Expand Down Expand Up @@ -106,7 +111,12 @@ namespace tfel::math {
*/
template <typename ST2toST2Type, typename ST2toST2Type2>
TFEL_HOST_DEVICE constexpr Expr(const ST2toST2Type& a,
const ST2toST2Type2& b) {
const ST2toST2Type2& b)
: array_holder<StensorDimeToSize<
getSpaceDimension<ST2toST2ResultType>()>::value *
StensorDimeToSize<
getSpaceDimension<ST2toST2ResultType>()>::value,
numeric_type<ST2toST2ResultType>>() {
static_assert(implementsST2toST2Concept<ST2toST2Type>());
static_assert(implementsST2toST2Concept<ST2toST2Type2>());
static_assert(getSpaceDimension<ST2toST2Type>() == 2u);
Expand Down
6 changes: 3 additions & 3 deletions mfront/tests/unit-tests/ComputeStiffnessTensorTest.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ struct ComputeStiffnessTensorTest final : public tfel::tests::TestCase {
const auto h = tfel::material::ModellingHypothesis::UNDEFINEDHYPOTHESIS;
auto& f = mfront::DSLFactory::getDSLFactory();
auto dsl = std::dynamic_pointer_cast<mfront::AbstractBehaviourDSL>(
f.createNewParser("Implicit"));
f.createNewDSL("Implicit"));
dsl->analyseString("@ComputeStiffnessTensor {150e9,0.3};");
const auto& bd = dsl->getBehaviourDescription().getBehaviourData(h);
TFEL_TESTS_ASSERT(bd.getParameters().size() == 2u);
Expand All @@ -103,7 +103,7 @@ struct ComputeStiffnessTensorTest final : public tfel::tests::TestCase {
const auto h = tfel::material::ModellingHypothesis::UNDEFINEDHYPOTHESIS;
auto& f = mfront::DSLFactory::getDSLFactory();
auto dsl = std::dynamic_pointer_cast<mfront::AbstractBehaviourDSL>(
f.createNewParser("Implicit"));
f.createNewDSL("Implicit"));
dsl->analyseString(
"@OrthotropicBehaviour;"
"@ComputeStiffnessTensor {150e9,150e9,150e9,"
Expand All @@ -129,7 +129,7 @@ struct ComputeStiffnessTensorTest final : public tfel::tests::TestCase {
}
void check(const std::string& n, const std::string& s) {
auto& f = mfront::DSLFactory::getDSLFactory();
auto dsl = f.createNewParser(n);
auto dsl = f.createNewDSL(n);
try {
dsl->analyseString(s);
} catch (std::runtime_error& e) {
Expand Down
2 changes: 1 addition & 1 deletion mfront/tests/unit-tests/DSLTest.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ struct DSLTest final : public tfel::tests::TestCase {
private:
void check(const std::string& n, const std::string& s) {
auto& f = mfront::DSLFactory::getDSLFactory();
auto dsl = f.createNewParser(n);
auto dsl = f.createNewDSL(n);
try {
dsl->analyseString(s);
} catch (std::runtime_error& e) {
Expand Down
2 changes: 1 addition & 1 deletion mfront/tests/unit-tests/OrthotropicAxesConventionTest.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ struct OrthotropicAxesConventionTest final : public tfel::tests::TestCase {
private:
void check(const std::string& s) {
auto& f = mfront::DSLFactory::getDSLFactory();
auto dsl = f.createNewParser("Implicit");
auto dsl = f.createNewDSL("Implicit");
try {
dsl->analyseString(s);
} catch (std::runtime_error& e) {
Expand Down
2 changes: 1 addition & 1 deletion mfront/tests/unit-tests/StandardElasticityBrickTest.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ struct StandardElasticityBrickTest final : public tfel::tests::TestCase {
private:
void check(const std::string& s) {
auto& f = mfront::DSLFactory::getDSLFactory();
auto dsl = f.createNewParser("Implicit");
auto dsl = f.createNewDSL("Implicit");
try {
dsl->analyseString("@DSL \"StandardElasticity\";\n" + s);
} catch (std::runtime_error& e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ struct StandardElastoViscoPlasticityBrickTest final
private:
void check(const std::string& s) {
auto& f = mfront::DSLFactory::getDSLFactory();
auto dsl = f.createNewParser("Implicit");
auto dsl = f.createNewDSL("Implicit");
try {
dsl->analyseString(s);
} catch (std::runtime_error& e) {
Expand Down
2 changes: 1 addition & 1 deletion mfront/tests/unit-tests/SwellingTest.cxx.in
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ struct SwellingTest final
private:
void check(const std::string& s){
auto& f = mfront::DSLFactory::getDSLFactory();
auto dsl = f.createNewParser("DefaultDSL");
auto dsl = f.createNewDSL("DefaultDSL");
try{
dsl->analyseString(s);
}
Expand Down
10 changes: 8 additions & 2 deletions mtest/src/GenericSolver.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ namespace mtest {
using namespace tfel::math;
using namespace tfel::material;
// compute material properties and state variables
s.prepare(scs, t, dt);
const auto ri = s.prepare(scs, t, dt);
if (!ri.first) {
return ri;
}
// packaging step
if (scs.period == 1) {
if (!s.doPackagingStep(scs)) {
Expand Down Expand Up @@ -80,7 +83,10 @@ namespace mtest {
using size_type = matrix<real>::size_type;
auto& u1 = scs.u1;
// compute material properties and state variables
s.prepare(scs, t, dt);
const auto ri = s.prepare(scs, t, dt);
if (!ri.first) {
return ri;
}
// initializing the acceleration algorithm
if (o.aa != nullptr) {
o.aa->preExecuteTasks();
Expand Down

0 comments on commit 714873e

Please sign in to comment.