# endif
DEAL_II_ENABLE_EXTRA_DIAGNOSTICS
+# include <deal.II/base/exceptions.h>
# include <deal.II/base/logstream.h>
# include <deal.II/base/utilities.h>
{
namespace SD
{
+ /**
+ * @addtogroup Exceptions
+ * @{
+ */
+
+ /**
+ * An exception to indicate that the SymEngine library has not been built
+ * against the LLVM compiler.
+ */
+ DeclExceptionMsg(ExcSymEngineLLVMNotAvailable,
+ "SymEngine has not been built with LLVM support.");
+
+ /**
+ * An exception to indicate that SymEngine's LLVM optimizer doesn't work
+ * with the desired return type.
+ */
+ DeclExceptionMsg(ExcSymEngineLLVMReturnTypeNotSupported,
+ "The SymEngine LLVM optimizer does not (yet) support the "
+ "selected return type.");
+
+ //@}
+
+
// Forward declarations
template <typename ReturnType>
class BatchOptimizer;
ExcMessage(
"Cannot call set_optimization_method() once the optimizer is finalized."));
- method = optimization_method;
# ifndef HAVE_SYMENGINE_LLVM
- if (this->optimization_method() == OptimizerType::llvm)
+ if (optimization_method == OptimizerType::llvm)
{
- // Fall-back if the LLVM JIT compiler is not available
- deallog
- << "Warning: The LLVM is not available, so the batch optimizer "
- << "is using a lambda optimizer instead." << std::endl;
- method = OptimizerType::lambda;
+ AssertThrow(false, ExcSymEngineLLVMNotAvailable());
}
# endif
- flags = optimization_flags;
+ method = optimization_method;
+ flags = optimization_flags;
}
}
else
{
- AssertThrow(false,
- ExcMessage("The SymEngine LLVM optimizer does not "
- "(yet) support the selected ReturnType."));
+ AssertThrow(false, ExcSymEngineLLVMReturnTypeNotSupported());
}
# else
- AssertThrow(false, ExcMessage("The LLVM compiler is not available."));
+ AssertThrow(false, ExcSymEngineLLVMNotAvailable());
# endif
}
else