Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Nov 4, 2024
1 parent 41b4114 commit 87d7856
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 32 deletions.
8 changes: 4 additions & 4 deletions include/tvm/graph/internal/Log.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class Inputs;
* members to compare.
*/
template<typename ObjType, typename MemberType, typename... Args>
bool lexLess(const ObjType & l, const ObjType & r, MemberType ObjType::*member, Args &&... args)
bool lexLess(const ObjType & l, const ObjType & r, MemberType ObjType::* member, Args &&... args)
{
return (l.*member) < (r.*member) || ((l.*member == r.*member) && lexLess(l, r, std::forward<Args>(args)...));
}
Expand All @@ -38,21 +38,21 @@ bool lexLess(const ObjType & l, const ObjType & r, MemberType ObjType::*member,
* to compare.
*/
template<typename ObjType, typename MemberType, typename... Args>
bool eq(const ObjType & l, const ObjType & r, MemberType ObjType::*member, Args &&... args)
bool eq(const ObjType & l, const ObjType & r, MemberType ObjType::* member, Args &&... args)
{
return (l.*member == r.*member) && eq(l, r, std::forward<Args>(args)...);
}

/** End of recursion. */
template<typename ObjType, typename MemberType>
bool lexLess(const ObjType & l, const ObjType & r, MemberType ObjType::*member)
bool lexLess(const ObjType & l, const ObjType & r, MemberType ObjType::* member)
{
return (l.*member) < (r.*member);
}

/** End of recursion. */
template<typename ObjType, typename MemberType>
bool eq(const ObjType & l, const ObjType & r, MemberType ObjType::*member)
bool eq(const ObjType & l, const ObjType & r, MemberType ObjType::* member)
{
return (l.*member) == (r.*member);
}
Expand Down
9 changes: 3 additions & 6 deletions include/tvm/scheme/HierarchicalLeastSquares.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,9 @@ namespace tvm
namespace scheme
{
/** A set of options for HierarchicalLeastSquares. */
class TVM_DLLAPI HierarchicalLeastSquaresOptions
{
/** If \a true, a damping task is added after the last level
*/
TVM_ADD_NON_DEFAULT_OPTION(autoDamping, false)
};
class TVM_DLLAPI HierarchicalLeastSquaresOptions{/** If \a true, a damping task is added after the last level
*/
TVM_ADD_NON_DEFAULT_OPTION(autoDamping, false)};

/** This class implements the hierarchical least square scheme. */
class TVM_DLLAPI HierarchicalLeastSquares : public abstract::LinearResolutionScheme<HierarchicalLeastSquares>
Expand Down
22 changes: 10 additions & 12 deletions include/tvm/scheme/WeightedLeastSquares.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,16 @@ namespace tvm
namespace scheme
{
/** A set of options for WeightedLeastSquares. */
class TVM_DLLAPI WeightedLeastSquaresOptions
{
/** If \a true, a damping task is added when no constraint with level >=1 has been
* given.
*/
TVM_ADD_NON_DEFAULT_OPTION(autoDamping, false)
/** The factor to emulate priority for priority levels >= 1.
* E.g. if a task T1 has a weight w1 and priority 1, and a task T2 has a weight w2 and
* priority 2, the weighted least-squares problem will be assembled with weights
* \p scalarizationWeight * w1 and w2 for T1 and T2 respectively. */
TVM_ADD_NON_DEFAULT_OPTION(scalarizationWeight, 1000.)
};
class TVM_DLLAPI WeightedLeastSquaresOptions{
/** If \a true, a damping task is added when no constraint with level >=1 has been
* given.
*/
TVM_ADD_NON_DEFAULT_OPTION(autoDamping, false)
/** The factor to emulate priority for priority levels >= 1.
* E.g. if a task T1 has a weight w1 and priority 1, and a task T2 has a weight w2 and
* priority 2, the weighted least-squares problem will be assembled with weights
* \p scalarizationWeight * w1 and w2 for T1 and T2 respectively. */
TVM_ADD_NON_DEFAULT_OPTION(scalarizationWeight, 1000.)};

/** This class implements the classic weighted least square scheme. */
class TVM_DLLAPI WeightedLeastSquares : public abstract::LinearResolutionScheme<WeightedLeastSquares>
Expand Down
6 changes: 3 additions & 3 deletions include/tvm/scheme/internal/CompiledAssignment.h
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ class WeightMultBase<NONE>
public:
static const bool useArg = false;

WeightMultBase(NoArg){};
WeightMultBase(NoArg) {};

template<typename T>
const T & applyWeightMult(const T & M)
Expand All @@ -376,7 +376,7 @@ class WeightMultBase<MINUS>
public:
static const bool useArg = false;

WeightMultBase(NoArg){};
WeightMultBase(NoArg) {};

double applyWeightMult(const double & M) { return -M; }

Expand Down Expand Up @@ -408,7 +408,7 @@ template<>
class WeightMultBase<SCALAR>
{
public:
WeightMultBase(const double & s) : s_(s){};
WeightMultBase(const double & s) : s_(s) {};

template<typename T>
decltype(double() * std::declval<T>()) applyWeightMult(const T & M)
Expand Down
8 changes: 4 additions & 4 deletions tests/CompiledAssignmentTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,8 @@ struct call_impl
{
static CompiledAssignmentWrapper<MatrixType> call(Tuple && t)
{
return call_impl<MatrixType, A, W, M, F, Tuple, Total == 1 + sizeof...(N), Total, N..., sizeof...(N)>::call(
std::forward<Tuple>(t));
return call_impl < MatrixType, A, W, M, F, Tuple, Total == 1 + sizeof...(N), Total, N...,
sizeof...(N) > ::call(std::forward<Tuple>(t));
}
};

Expand All @@ -220,8 +220,8 @@ template<typename MatrixType, AssignType A, WeightMult W, MatrixMult M, Source F
CompiledAssignmentWrapper<MatrixType> call(Tuple && t)
{
typedef typename std::decay<Tuple>::type ttype;
return detail::call_impl<MatrixType, A, W, M, F, Tuple, 0 == std::tuple_size<ttype>::value,
std::tuple_size<ttype>::value>::call(std::forward<Tuple>(t));
return detail::call_impl < MatrixType, A, W, M, F, Tuple, 0 == std::tuple_size<ttype>::value,
std::tuple_size<ttype>::value > ::call(std::forward<Tuple>(t));
}

template<WeightMult W>
Expand Down
5 changes: 2 additions & 3 deletions tests/doctest/doctest.h
Original file line number Diff line number Diff line change
Expand Up @@ -1007,7 +1007,7 @@ struct StringMaker<T *>
template<typename R, typename C>
struct StringMaker<R C::*>
{
static String convert(R C::*p)
static String convert(R C::* p)
{
if(p)
return detail::rawMemoryToString(p);
Expand Down Expand Up @@ -1159,8 +1159,7 @@ namespace detail
#endif // DOCTEST_CONFIG_TREAT_CHAR_STAR_AS_STRING
// clang-format on

struct DOCTEST_INTERFACE TestFailureException
{};
struct DOCTEST_INTERFACE TestFailureException{};

DOCTEST_INTERFACE bool checkIfShouldThrow(assertType::Enum at);

Expand Down

0 comments on commit 87d7856

Please sign in to comment.