-
Notifications
You must be signed in to change notification settings - Fork 233
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changed ff_dim to ff_dim_t, added in nonnegative_int type
- Loading branch information
Victor Li
committed
Nov 8, 2024
1 parent
1d5140d
commit 670fb62
Showing
28 changed files
with
504 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#ifndef _FLEXFLOW_LIB_OP_ATTRS_INCLUDE_OP_ATTRS_FF_DIM_T_H | ||
#define _FLEXFLOW_LIB_OP_ATTRS_INCLUDE_OP_ATTRS_FF_DIM_T_H | ||
|
||
#include "op-attrs/ff_dim_t.dtg.h" | ||
#include "rapidcheck.h" | ||
|
||
namespace rc { | ||
template <> | ||
struct Arbitrary<FlexFlow::ff_dim_t> { | ||
static Gen<FlexFlow::ff_dim_t> arbitrary(); | ||
}; | ||
} // namespace rc | ||
|
||
#endif // _FLEXFLOW_LIB_OP_ATTRS_INCLUDE_OP_ATTRS_FF_DIM_T_H |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#ifndef _FLEXFLOW_LIB_OP_ATTRS_INCLUDE_OP_ATTRS_RELATIVE_FF_DIM_T_H | ||
#define _FLEXFLOW_LIB_OP_ATTRS_INCLUDE_OP_ATTRS_RELATIVE_FF_DIM_T_H | ||
|
||
#include "op-attrs/relative_ff_dim_t.dtg.h" | ||
#include "rapidcheck.h" | ||
|
||
namespace rc { | ||
template <> | ||
struct Arbitrary<FlexFlow::relative_ff_dim_t> { | ||
static Gen<FlexFlow::relative_ff_dim_t> arbitrary(); | ||
}; | ||
} // namespace rc | ||
|
||
#endif // _FLEXFLOW_LIB_OP_ATTRS_INCLUDE_OP_ATTRS_RELATIVE_FF_DIM_T_H |
14 changes: 14 additions & 0 deletions
14
lib/op-attrs/include/op-attrs/relative_ff_dim_t.struct.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
namespace = "FlexFlow" | ||
name = "relative_ff_dim_t" | ||
|
||
features = [ | ||
"eq", | ||
"ord", | ||
"hash", | ||
"json", | ||
"fmt", | ||
] | ||
|
||
[[fields]] | ||
name = "value" | ||
type = "int" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#include "op-attrs/ff_dim_t.h" | ||
|
||
namespace rc { | ||
Gen<FlexFlow::ff_dim_t> Arbitrary<FlexFlow::ff_dim_t>::arbitrary() { | ||
return gen::construct<FlexFlow::ff_dim_t>( | ||
gen::inRange<int>(0, MAX_TENSOR_DIM)); | ||
} | ||
} // namespace rc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#include "op-attrs/relative_ff_dim_t.h" | ||
#include "rapidcheck.h" | ||
|
||
namespace rc { | ||
Gen<FlexFlow::relative_ff_dim_t> | ||
Arbitrary<FlexFlow::relative_ff_dim_t>::arbitrary() { | ||
return gen::construct<FlexFlow::relative_ff_dim_t>( | ||
gen::inRange<int>(-MAX_TENSOR_DIM, MAX_TENSOR_DIM)); | ||
} | ||
} // namespace rc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
#ifndef _FLEXFLOW_LIB_UTILS_INCLUDE_UTILS_NONNEGATIVE_INT_NONNEGATIVE_INT_H | ||
#define _FLEXFLOW_LIB_UTILS_INCLUDE_UTILS_NONNEGATIVE_INT_NONNEGATIVE_INT_H | ||
|
||
#include "rapidcheck.h" | ||
|
||
#include <any> | ||
#include <fmt/format.h> | ||
#include <functional> | ||
#include <nlohmann/json.hpp> | ||
#include <string> | ||
|
||
namespace FlexFlow { | ||
class nonnegative_int { | ||
public: | ||
nonnegative_int() = delete; | ||
explicit nonnegative_int(int value); | ||
|
||
explicit operator int() const noexcept; | ||
|
||
bool operator<(nonnegative_int const &other) const; | ||
bool operator==(nonnegative_int const &other) const; | ||
bool operator>(nonnegative_int const &other) const; | ||
bool operator<=(nonnegative_int const &other) const; | ||
bool operator!=(nonnegative_int const &other) const; | ||
bool operator>=(nonnegative_int const &other) const; | ||
|
||
bool operator<(int const &other) const; | ||
bool operator==(int const &other) const; | ||
bool operator>(int const &other) const; | ||
bool operator<=(int const &other) const; | ||
bool operator!=(int const &other) const; | ||
bool operator>=(int const &other) const; | ||
|
||
friend bool operator<(int const &lhs, nonnegative_int const &rhs); | ||
friend bool operator==(int const &lhs, nonnegative_int const &rhs); | ||
friend bool operator>(int const &lhs, nonnegative_int const &rhs); | ||
friend bool operator<=(int const &lhs, nonnegative_int const &rhs); | ||
friend bool operator!=(int const &lhs, nonnegative_int const &rhs); | ||
friend bool operator>=(int const &lhs, nonnegative_int const &rhs); | ||
|
||
friend std::ostream &operator<<(std::ostream &os, nonnegative_int const &n); | ||
|
||
int get_value() const; | ||
|
||
private: | ||
int value_; | ||
}; | ||
} // namespace FlexFlow | ||
|
||
namespace nlohmann { | ||
template <> | ||
struct adl_serializer<::FlexFlow::nonnegative_int> { | ||
static ::FlexFlow::nonnegative_int from_json(json const &j); | ||
static void to_json(json &j, ::FlexFlow::nonnegative_int t); | ||
}; | ||
} // namespace nlohmann | ||
|
||
namespace std { | ||
template <> | ||
struct hash<FlexFlow::nonnegative_int> { | ||
std::size_t operator()(FlexFlow::nonnegative_int const &n) const noexcept; | ||
}; | ||
} // namespace std | ||
|
||
#endif |
Oops, something went wrong.