File tree Expand file tree Collapse file tree 5 files changed +13
-9
lines changed
Expand file tree Collapse file tree 5 files changed +13
-9
lines changed Original file line number Diff line number Diff line change 1717#include " kernels/transpose_kernels.h"
1818#include " op-attrs/get_output_shapes.h"
1919#include " op-attrs/ops/transpose.h"
20+ #include " utils/integer_conversions.h"
2021
2122using namespace FlexFlow ::Kernels::Transpose;
2223
@@ -39,11 +40,11 @@ OpTaskInvocation init(TransposeAttrs const &attrs) {
3940static DeviceSpecificDeviceStates
4041 init_task_impl (TaskArgumentAccessor const &acc) {
4142 auto const &attrs = acc.get_argument <TransposeAttrs>(ATTRS);
42- size_t size = attrs.perm .size ();
43+ int size = int_from_size_t ( attrs.perm .size () );
4344
4445 std::vector<ff_dim_t > perm = [&] {
4546 std::vector<ff_dim_t > result;
46- for (size_t i : range (size)) {
47+ for (int i : range (size)) {
4748 result.push_back (ff_dim_t {nonnegative_int{size - i - 1 }});
4849 }
4950 return result;
Original file line number Diff line number Diff line change @@ -57,9 +57,9 @@ struct stack_basic_string {
5757
5858 friend struct std ::hash<stack_basic_string>;
5959
60- friend fmt::basic_string_view<Char>
60+ friend std::string
6161 format_as (stack_basic_string<Char, MAXSIZE> const &s) {
62- return {s.contents .stack_contents (). data () , s.length ()};
62+ return {s.contents .cbegin () , s.contents . cend ()};
6363 }
6464
6565private:
Original file line number Diff line number Diff line change @@ -292,10 +292,6 @@ struct stack_vector {
292292 return (this ->m_size == 0 );
293293 }
294294
295- std::array<element_type, MAXSIZE> stack_contents () const {
296- return this ->contents ;
297- }
298-
299295 friend std::string format_as (stack_vector<T, MAXSIZE> const &v) {
300296 CHECK_FMTABLE (T);
301297
@@ -305,7 +301,6 @@ struct stack_vector {
305301 });
306302 return " [" + result + " ]" ;
307303 }
308-
309304private:
310305 std::size_t m_size = 0 ;
311306 std::array<element_type, MAXSIZE> contents;
Original file line number Diff line number Diff line change 1+ #include " utils/stack_string.h"
2+
3+ namespace FlexFlow {
4+
5+ template struct stack_basic_string <char , 5 >;
6+
7+ } // namespace FlexFlow
Original file line number Diff line number Diff line change @@ -6,5 +6,6 @@ namespace FlexFlow {
66using T = ordered_value_type<0 >;
77
88template struct stack_vector <T, 5 >;
9+ template struct stack_vector <int , 5 >;
910
1011} // namespace FlexFlow
You can’t perform that action at this time.
0 commit comments