kumi 0.0.23 → 0.0.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/README.md +2 -2
- data/golden/array_element/expected/schema_ruby.rb +1 -1
- data/golden/array_index/expected/schema_ruby.rb +1 -1
- data/golden/array_operations/expected/schema_ruby.rb +1 -1
- data/golden/cascade_logic/expected/lir_02_inlined.txt +8 -8
- data/golden/cascade_logic/expected/schema_ruby.rb +1 -1
- data/golden/chained_fusion/expected/lir_02_inlined.txt +36 -36
- data/golden/chained_fusion/expected/lir_03_cse.txt +23 -23
- data/golden/chained_fusion/expected/lir_04_1_loop_fusion.txt +25 -25
- data/golden/chained_fusion/expected/lir_04_loop_invcm.txt +23 -23
- data/golden/chained_fusion/expected/lir_06_const_prop.txt +23 -23
- data/golden/chained_fusion/expected/schema_javascript.mjs +23 -23
- data/golden/chained_fusion/expected/schema_ruby.rb +28 -28
- data/golden/element_arrays/expected/schema_ruby.rb +1 -1
- data/golden/empty_and_null_inputs/expected/lir_02_inlined.txt +18 -18
- data/golden/empty_and_null_inputs/expected/lir_03_cse.txt +17 -17
- data/golden/empty_and_null_inputs/expected/lir_04_1_loop_fusion.txt +17 -17
- data/golden/empty_and_null_inputs/expected/lir_04_loop_invcm.txt +17 -17
- data/golden/empty_and_null_inputs/expected/lir_06_const_prop.txt +17 -17
- data/golden/empty_and_null_inputs/expected/schema_javascript.mjs +13 -13
- data/golden/empty_and_null_inputs/expected/schema_ruby.rb +18 -18
- data/golden/game_of_life/expected/lir_00_unoptimized.txt +33 -33
- data/golden/game_of_life/expected/lir_01_hoist_scalar_references.txt +33 -33
- data/golden/game_of_life/expected/lir_02_inlined.txt +1370 -1370
- data/golden/game_of_life/expected/lir_03_cse.txt +448 -448
- data/golden/game_of_life/expected/lir_04_1_loop_fusion.txt +448 -448
- data/golden/game_of_life/expected/lir_04_loop_invcm.txt +448 -448
- data/golden/game_of_life/expected/lir_06_const_prop.txt +448 -448
- data/golden/game_of_life/expected/schema_javascript.mjs +85 -85
- data/golden/game_of_life/expected/schema_ruby.rb +86 -86
- data/golden/hash_keys/expected/schema_ruby.rb +1 -1
- data/golden/hash_keys/schema.kumi +4 -5
- data/golden/hash_value/expected/schema_ruby.rb +1 -1
- data/golden/hierarchical_complex/expected/lir_02_inlined.txt +15 -15
- data/golden/hierarchical_complex/expected/lir_03_cse.txt +1 -1
- data/golden/hierarchical_complex/expected/lir_04_1_loop_fusion.txt +1 -1
- data/golden/hierarchical_complex/expected/lir_04_loop_invcm.txt +1 -1
- data/golden/hierarchical_complex/expected/lir_06_const_prop.txt +1 -1
- data/golden/hierarchical_complex/expected/schema_javascript.mjs +1 -1
- data/golden/hierarchical_complex/expected/schema_ruby.rb +2 -2
- data/golden/inline_rename_scope_leak/expected/ast.txt +48 -0
- data/golden/inline_rename_scope_leak/expected/input_plan.txt +10 -0
- data/golden/inline_rename_scope_leak/expected/lir_00_unoptimized.txt +35 -0
- data/golden/inline_rename_scope_leak/expected/lir_01_hoist_scalar_references.txt +35 -0
- data/golden/inline_rename_scope_leak/expected/lir_02_inlined.txt +49 -0
- data/golden/inline_rename_scope_leak/expected/lir_03_cse.txt +49 -0
- data/golden/inline_rename_scope_leak/expected/lir_04_1_loop_fusion.txt +49 -0
- data/golden/inline_rename_scope_leak/expected/lir_04_loop_invcm.txt +49 -0
- data/golden/inline_rename_scope_leak/expected/lir_06_const_prop.txt +49 -0
- data/golden/inline_rename_scope_leak/expected/nast.txt +31 -0
- data/golden/inline_rename_scope_leak/expected/schema_javascript.mjs +51 -0
- data/golden/inline_rename_scope_leak/expected/schema_ruby.rb +82 -0
- data/golden/inline_rename_scope_leak/expected/snast.txt +31 -0
- data/golden/inline_rename_scope_leak/expected.json +7 -0
- data/golden/inline_rename_scope_leak/input.json +4 -0
- data/golden/inline_rename_scope_leak/schema.kumi +24 -0
- data/golden/input_reference/expected/schema_ruby.rb +1 -1
- data/golden/interleaved_fusion/expected/lir_02_inlined.txt +35 -35
- data/golden/interleaved_fusion/expected/lir_03_cse.txt +26 -26
- data/golden/interleaved_fusion/expected/lir_04_1_loop_fusion.txt +27 -26
- data/golden/interleaved_fusion/expected/lir_04_loop_invcm.txt +26 -26
- data/golden/interleaved_fusion/expected/lir_06_const_prop.txt +26 -26
- data/golden/interleaved_fusion/expected/schema_javascript.mjs +23 -23
- data/golden/interleaved_fusion/expected/schema_ruby.rb +29 -29
- data/golden/let_inline/expected/schema_ruby.rb +1 -1
- data/golden/loop_fusion/expected/lir_02_inlined.txt +17 -17
- data/golden/loop_fusion/expected/lir_03_cse.txt +14 -14
- data/golden/loop_fusion/expected/lir_04_1_loop_fusion.txt +14 -14
- data/golden/loop_fusion/expected/lir_04_loop_invcm.txt +14 -14
- data/golden/loop_fusion/expected/lir_06_const_prop.txt +14 -14
- data/golden/loop_fusion/expected/schema_javascript.mjs +12 -12
- data/golden/loop_fusion/expected/schema_ruby.rb +16 -16
- data/golden/min_reduce_scope/expected/schema_ruby.rb +1 -1
- data/golden/mixed_dimensions/expected/lir_02_inlined.txt +5 -5
- data/golden/mixed_dimensions/expected/lir_03_cse.txt +5 -5
- data/golden/mixed_dimensions/expected/lir_04_1_loop_fusion.txt +5 -5
- data/golden/mixed_dimensions/expected/lir_04_loop_invcm.txt +5 -5
- data/golden/mixed_dimensions/expected/lir_06_const_prop.txt +5 -5
- data/golden/mixed_dimensions/expected/schema_javascript.mjs +3 -3
- data/golden/mixed_dimensions/expected/schema_ruby.rb +6 -6
- data/golden/multirank_hoisting/expected/lir_02_inlined.txt +48 -48
- data/golden/multirank_hoisting/expected/lir_03_cse.txt +35 -35
- data/golden/multirank_hoisting/expected/lir_04_1_loop_fusion.txt +35 -35
- data/golden/multirank_hoisting/expected/lir_04_loop_invcm.txt +35 -35
- data/golden/multirank_hoisting/expected/lir_06_const_prop.txt +35 -35
- data/golden/multirank_hoisting/expected/schema_javascript.mjs +34 -34
- data/golden/multirank_hoisting/expected/schema_ruby.rb +36 -36
- data/golden/nested_hash/expected/schema_ruby.rb +1 -1
- data/golden/reduction_broadcast/expected/lir_02_inlined.txt +30 -30
- data/golden/reduction_broadcast/expected/lir_03_cse.txt +22 -22
- data/golden/reduction_broadcast/expected/lir_04_1_loop_fusion.txt +22 -22
- data/golden/reduction_broadcast/expected/lir_04_loop_invcm.txt +22 -22
- data/golden/reduction_broadcast/expected/lir_06_const_prop.txt +22 -22
- data/golden/reduction_broadcast/expected/schema_javascript.mjs +18 -18
- data/golden/reduction_broadcast/expected/schema_ruby.rb +23 -23
- data/golden/roll/expected/lir_00_unoptimized.txt +8 -8
- data/golden/roll/expected/lir_01_hoist_scalar_references.txt +8 -8
- data/golden/roll/expected/lir_02_inlined.txt +8 -8
- data/golden/roll/expected/lir_03_cse.txt +8 -8
- data/golden/roll/expected/lir_04_1_loop_fusion.txt +8 -8
- data/golden/roll/expected/lir_04_loop_invcm.txt +8 -8
- data/golden/roll/expected/lir_06_const_prop.txt +8 -8
- data/golden/roll/expected/schema_ruby.rb +1 -1
- data/golden/shift/expected/lir_00_unoptimized.txt +12 -12
- data/golden/shift/expected/lir_01_hoist_scalar_references.txt +12 -12
- data/golden/shift/expected/lir_02_inlined.txt +12 -12
- data/golden/shift/expected/lir_03_cse.txt +12 -12
- data/golden/shift/expected/lir_04_1_loop_fusion.txt +12 -12
- data/golden/shift/expected/lir_04_loop_invcm.txt +12 -12
- data/golden/shift/expected/lir_06_const_prop.txt +12 -12
- data/golden/shift/expected/schema_ruby.rb +1 -1
- data/golden/shift_2d/expected/lir_00_unoptimized.txt +48 -48
- data/golden/shift_2d/expected/lir_01_hoist_scalar_references.txt +48 -48
- data/golden/shift_2d/expected/lir_02_inlined.txt +48 -48
- data/golden/shift_2d/expected/lir_03_cse.txt +48 -48
- data/golden/shift_2d/expected/lir_04_1_loop_fusion.txt +48 -48
- data/golden/shift_2d/expected/lir_04_loop_invcm.txt +48 -48
- data/golden/shift_2d/expected/lir_06_const_prop.txt +48 -48
- data/golden/shift_2d/expected/schema_ruby.rb +1 -1
- data/golden/simple_math/expected/schema_ruby.rb +1 -1
- data/golden/streaming_basics/expected/lir_02_inlined.txt +25 -25
- data/golden/streaming_basics/expected/lir_03_cse.txt +13 -13
- data/golden/streaming_basics/expected/lir_04_1_loop_fusion.txt +13 -13
- data/golden/streaming_basics/expected/lir_04_loop_invcm.txt +13 -13
- data/golden/streaming_basics/expected/lir_06_const_prop.txt +13 -13
- data/golden/streaming_basics/expected/schema_javascript.mjs +13 -13
- data/golden/streaming_basics/expected/schema_ruby.rb +14 -14
- data/golden/tuples/expected/lir_00_unoptimized.txt +4 -4
- data/golden/tuples/expected/lir_01_hoist_scalar_references.txt +4 -4
- data/golden/tuples/expected/lir_02_inlined.txt +4 -4
- data/golden/tuples/expected/lir_03_cse.txt +4 -4
- data/golden/tuples/expected/lir_04_1_loop_fusion.txt +4 -4
- data/golden/tuples/expected/lir_04_loop_invcm.txt +4 -4
- data/golden/tuples/expected/lir_06_const_prop.txt +4 -4
- data/golden/tuples/expected/schema_ruby.rb +1 -1
- data/golden/tuples_and_arrays/expected/lir_00_unoptimized.txt +1 -1
- data/golden/tuples_and_arrays/expected/lir_01_hoist_scalar_references.txt +1 -1
- data/golden/tuples_and_arrays/expected/lir_02_inlined.txt +17 -17
- data/golden/tuples_and_arrays/expected/lir_03_cse.txt +14 -14
- data/golden/tuples_and_arrays/expected/lir_04_1_loop_fusion.txt +14 -14
- data/golden/tuples_and_arrays/expected/lir_04_loop_invcm.txt +14 -14
- data/golden/tuples_and_arrays/expected/lir_06_const_prop.txt +14 -14
- data/golden/tuples_and_arrays/expected/schema_javascript.mjs +13 -13
- data/golden/tuples_and_arrays/expected/schema_ruby.rb +14 -14
- data/golden/us_tax_2024/expected/ast.txt +865 -0
- data/golden/us_tax_2024/expected/input_plan.txt +61 -0
- data/golden/us_tax_2024/expected/lir_00_unoptimized.txt +901 -0
- data/golden/us_tax_2024/expected/lir_01_hoist_scalar_references.txt +901 -0
- data/golden/us_tax_2024/expected/lir_02_inlined.txt +5178 -0
- data/golden/us_tax_2024/expected/lir_03_cse.txt +2499 -0
- data/golden/us_tax_2024/expected/lir_04_1_loop_fusion.txt +2519 -0
- data/golden/us_tax_2024/expected/lir_04_loop_invcm.txt +2499 -0
- data/golden/us_tax_2024/expected/lir_06_const_prop.txt +2499 -0
- data/golden/us_tax_2024/expected/nast.txt +976 -0
- data/golden/us_tax_2024/expected/schema_javascript.mjs +584 -0
- data/golden/us_tax_2024/expected/schema_ruby.rb +639 -0
- data/golden/us_tax_2024/expected/snast.txt +976 -0
- data/golden/us_tax_2024/expected.json +1 -0
- data/golden/us_tax_2024/input.json +168 -0
- data/golden/us_tax_2024/schema.kumi +203 -0
- data/golden/with_constants/expected/schema_ruby.rb +1 -1
- data/lib/kumi/core/analyzer/passes/lir/inline_declarations_pass.rb +227 -107
- data/lib/kumi/version.rb +1 -1
- metadata +33 -1
@@ -32,25 +32,25 @@
|
|
32
32
|
)
|
33
33
|
(Declaration department_summary
|
34
34
|
%t24 = load_input "departments" :: array
|
35
|
-
%
|
36
|
-
%
|
37
|
-
%
|
35
|
+
%t46 = const "manager" :: string
|
36
|
+
%t48 = const 1 :: integer
|
37
|
+
%t49 = const 0 :: integer
|
38
38
|
loop departments id=L5 in %t24 as el=%departments_el_25, idx=%departments_i_26
|
39
39
|
%t27 = load_field departments_el_25["name"] :: string
|
40
40
|
%acc33 = decl_acc :: integer
|
41
41
|
%t34 = load_field departments_el_25["employees"] :: any
|
42
|
-
%
|
43
|
-
loop employees id=L6 in %t34 as el=%
|
44
|
-
%
|
45
|
-
%acc33 = acc_add agg.sum(%acc33, %
|
46
|
-
%
|
47
|
-
%
|
48
|
-
%
|
49
|
-
%
|
42
|
+
%acc41 = decl_acc :: integer
|
43
|
+
loop employees id=L6 in %t34 as el=%t35, idx=%t36
|
44
|
+
%t37 = load_field t35["salary"] :: integer
|
45
|
+
%acc33 = acc_add agg.sum(%acc33, %t37) :: integer
|
46
|
+
%t45 = load_field t35["role"] :: string
|
47
|
+
%t47 = call core.eq(%t45, %t46) :: boolean
|
48
|
+
%t50 = select %t47, %t48, %t49 :: integer
|
49
|
+
%acc41 = acc_add agg.sum(%acc41, %t50) :: integer
|
50
50
|
end_loop
|
51
|
-
%
|
52
|
-
%
|
53
|
-
%t30 = make_object{name: %t27, total_payroll: %
|
51
|
+
%t38 = acc_load %acc33 :: integer
|
52
|
+
%t51 = acc_load %acc41 :: integer
|
53
|
+
%t30 = make_object{name: %t27, total_payroll: %t38, manager_count: %t51} :: object
|
54
54
|
yield %t30
|
55
55
|
end_loop
|
56
56
|
)
|
@@ -36,26 +36,26 @@ export function _manager_count(input) {
|
|
36
36
|
export function _department_summary(input) {
|
37
37
|
let out = [];
|
38
38
|
let t24 = input["departments"];
|
39
|
-
const
|
40
|
-
const
|
41
|
-
const
|
39
|
+
const t46 = "manager";
|
40
|
+
const t48 = 1;
|
41
|
+
const t49 = 0;
|
42
42
|
t24.forEach((departments_el_25, departments_i_26) => {
|
43
43
|
let t27 = departments_el_25["name"];
|
44
44
|
let acc33 = 0;
|
45
45
|
let t34 = departments_el_25["employees"];
|
46
|
-
let
|
47
|
-
t34.forEach((
|
48
|
-
let
|
49
|
-
acc33 +=
|
50
|
-
let
|
51
|
-
let
|
52
|
-
let
|
53
|
-
|
46
|
+
let acc41 = 0;
|
47
|
+
t34.forEach((t35, t36) => {
|
48
|
+
let t37 = t35["salary"];
|
49
|
+
acc33 += t37;
|
50
|
+
let t45 = t35["role"];
|
51
|
+
let t47 = t45 == t46;
|
52
|
+
let t50 = t47 ? t48 : t49;
|
53
|
+
acc41 += t50;
|
54
54
|
});
|
55
55
|
let t30 = {
|
56
56
|
"name": t27,
|
57
57
|
"total_payroll": acc33,
|
58
|
-
"manager_count":
|
58
|
+
"manager_count": acc41
|
59
59
|
};
|
60
60
|
out.push(t30);
|
61
61
|
});
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# Autogenerated by Kumi Codegen
|
2
|
-
module Kumi::Compiled::
|
2
|
+
module Kumi::Compiled::KUMI_f73439f44efea38d0e3ff71d0a88169a9b4e6158dd1d4fc358b80ff61c3dbbac
|
3
3
|
def self.from(input_data = nil)
|
4
4
|
instance = Object.new
|
5
5
|
instance.extend(self)
|
@@ -67,28 +67,28 @@ module Kumi::Compiled::KUMI_41f6e269d8de923ee6a1de8aef241075923042855e9ac9437d98
|
|
67
67
|
def _department_summary(input = @input)
|
68
68
|
out = []
|
69
69
|
t24 = input["departments"] || input[:departments]
|
70
|
-
|
71
|
-
|
72
|
-
|
70
|
+
t46 = "manager"
|
71
|
+
t48 = 1
|
72
|
+
t49 = 0
|
73
73
|
t24.each_with_index do |departments_el_25, departments_i_26|
|
74
74
|
t27 = departments_el_25["name"] || departments_el_25[:name]
|
75
75
|
acc33 = 0
|
76
76
|
t34 = departments_el_25["employees"] || departments_el_25[:employees]
|
77
|
-
|
78
|
-
t34.each_with_index do |
|
79
|
-
|
80
|
-
acc33 +=
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
77
|
+
acc41 = 0
|
78
|
+
t34.each_with_index do |t35, t36|
|
79
|
+
t37 = t35["salary"] || t35[:salary]
|
80
|
+
acc33 += t37
|
81
|
+
t45 = t35["role"] || t35[:role]
|
82
|
+
t47 = t45 == t46
|
83
|
+
t50 = t47 ? t48 : t49
|
84
|
+
acc41 += t50
|
85
85
|
end
|
86
|
-
|
87
|
-
|
86
|
+
t38 = acc33
|
87
|
+
t51 = acc41
|
88
88
|
t30 = {
|
89
89
|
"name" => t27,
|
90
|
-
"total_payroll" =>
|
91
|
-
"manager_count" =>
|
90
|
+
"total_payroll" => t38,
|
91
|
+
"manager_count" => t51
|
92
92
|
}
|
93
93
|
out << t30
|
94
94
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# Autogenerated by Kumi Codegen
|
2
|
-
module Kumi::Compiled::
|
2
|
+
module Kumi::Compiled::KUMI_e5612f974eced7c5db52fb03f8ecfd82174c52d530c1f073b180f04d7d4b5886
|
3
3
|
def self.from(input_data = nil)
|
4
4
|
instance = Object.new
|
5
5
|
instance.extend(self)
|
@@ -26,17 +26,17 @@
|
|
26
26
|
%t16 = load_input "matrix" :: array
|
27
27
|
%acc28 = decl_acc :: integer
|
28
28
|
%t29 = load_input "numbers" :: array
|
29
|
-
loop numbers id=L6 in %t29 as el=%
|
30
|
-
%
|
31
|
-
%acc28 = acc_add agg.sum(%acc28, %
|
29
|
+
loop numbers id=L6 in %t29 as el=%t30, idx=%t31
|
30
|
+
%t32 = load_field t30["value"] :: integer
|
31
|
+
%acc28 = acc_add agg.sum(%acc28, %t32) :: integer
|
32
32
|
end_loop
|
33
|
-
%
|
33
|
+
%t33 = acc_load %acc28 :: integer
|
34
34
|
loop matrix id=L4 in %t16 as el=%matrix_el_17, idx=%matrix_i_18
|
35
35
|
%t19 = load_field matrix_el_17["row"] :: any
|
36
36
|
loop row id=L5 in %t19 as el=%row_el_20, idx=%row_i_21
|
37
37
|
%t22 = load_input "scalar_val" :: integer
|
38
38
|
%t24 = load_field row_el_20["cell"] :: float
|
39
|
-
%t25 = make_tuple(%t22, %
|
39
|
+
%t25 = make_tuple(%t22, %t33, %t24) :: tuple<integer, integer, float>
|
40
40
|
yield %t25
|
41
41
|
end_loop
|
42
42
|
end_loop
|
@@ -26,17 +26,17 @@
|
|
26
26
|
%t16 = load_input "matrix" :: array
|
27
27
|
%acc28 = decl_acc :: integer
|
28
28
|
%t29 = load_input "numbers" :: array
|
29
|
-
loop numbers id=L6 in %t29 as el=%
|
30
|
-
%
|
31
|
-
%acc28 = acc_add agg.sum(%acc28, %
|
29
|
+
loop numbers id=L6 in %t29 as el=%t30, idx=%t31
|
30
|
+
%t32 = load_field t30["value"] :: integer
|
31
|
+
%acc28 = acc_add agg.sum(%acc28, %t32) :: integer
|
32
32
|
end_loop
|
33
|
-
%
|
33
|
+
%t33 = acc_load %acc28 :: integer
|
34
34
|
loop matrix id=L4 in %t16 as el=%matrix_el_17, idx=%matrix_i_18
|
35
35
|
%t19 = load_field matrix_el_17["row"] :: any
|
36
36
|
loop row id=L5 in %t19 as el=%row_el_20, idx=%row_i_21
|
37
37
|
%t22 = load_input "scalar_val" :: integer
|
38
38
|
%t24 = load_field row_el_20["cell"] :: float
|
39
|
-
%t25 = make_tuple(%t22, %
|
39
|
+
%t25 = make_tuple(%t22, %t33, %t24) :: tuple<integer, integer, float>
|
40
40
|
yield %t25
|
41
41
|
end_loop
|
42
42
|
end_loop
|
@@ -26,17 +26,17 @@
|
|
26
26
|
%t16 = load_input "matrix" :: array
|
27
27
|
%acc28 = decl_acc :: integer
|
28
28
|
%t29 = load_input "numbers" :: array
|
29
|
-
loop numbers id=L6 in %t29 as el=%
|
30
|
-
%
|
31
|
-
%acc28 = acc_add agg.sum(%acc28, %
|
29
|
+
loop numbers id=L6 in %t29 as el=%t30, idx=%t31
|
30
|
+
%t32 = load_field t30["value"] :: integer
|
31
|
+
%acc28 = acc_add agg.sum(%acc28, %t32) :: integer
|
32
32
|
end_loop
|
33
|
-
%
|
33
|
+
%t33 = acc_load %acc28 :: integer
|
34
34
|
loop matrix id=L4 in %t16 as el=%matrix_el_17, idx=%matrix_i_18
|
35
35
|
%t19 = load_field matrix_el_17["row"] :: any
|
36
36
|
loop row id=L5 in %t19 as el=%row_el_20, idx=%row_i_21
|
37
37
|
%t22 = load_input "scalar_val" :: integer
|
38
38
|
%t24 = load_field row_el_20["cell"] :: float
|
39
|
-
%t25 = make_tuple(%t22, %
|
39
|
+
%t25 = make_tuple(%t22, %t33, %t24) :: tuple<integer, integer, float>
|
40
40
|
yield %t25
|
41
41
|
end_loop
|
42
42
|
end_loop
|
@@ -26,17 +26,17 @@
|
|
26
26
|
%t16 = load_input "matrix" :: array
|
27
27
|
%acc28 = decl_acc :: integer
|
28
28
|
%t29 = load_input "numbers" :: array
|
29
|
-
loop numbers id=L6 in %t29 as el=%
|
30
|
-
%
|
31
|
-
%acc28 = acc_add agg.sum(%acc28, %
|
29
|
+
loop numbers id=L6 in %t29 as el=%t30, idx=%t31
|
30
|
+
%t32 = load_field t30["value"] :: integer
|
31
|
+
%acc28 = acc_add agg.sum(%acc28, %t32) :: integer
|
32
32
|
end_loop
|
33
|
-
%
|
33
|
+
%t33 = acc_load %acc28 :: integer
|
34
34
|
%t22 = load_input "scalar_val" :: integer
|
35
35
|
loop matrix id=L4 in %t16 as el=%matrix_el_17, idx=%matrix_i_18
|
36
36
|
%t19 = load_field matrix_el_17["row"] :: any
|
37
37
|
loop row id=L5 in %t19 as el=%row_el_20, idx=%row_i_21
|
38
38
|
%t24 = load_field row_el_20["cell"] :: float
|
39
|
-
%t25 = make_tuple(%t22, %
|
39
|
+
%t25 = make_tuple(%t22, %t33, %t24) :: tuple<integer, integer, float>
|
40
40
|
yield %t25
|
41
41
|
end_loop
|
42
42
|
end_loop
|
@@ -26,17 +26,17 @@
|
|
26
26
|
%t16 = load_input "matrix" :: array
|
27
27
|
%acc28 = decl_acc :: integer
|
28
28
|
%t29 = load_input "numbers" :: array
|
29
|
-
loop numbers id=L6 in %t29 as el=%
|
30
|
-
%
|
31
|
-
%acc28 = acc_add agg.sum(%acc28, %
|
29
|
+
loop numbers id=L6 in %t29 as el=%t30, idx=%t31
|
30
|
+
%t32 = load_field t30["value"] :: integer
|
31
|
+
%acc28 = acc_add agg.sum(%acc28, %t32) :: integer
|
32
32
|
end_loop
|
33
|
-
%
|
33
|
+
%t33 = acc_load %acc28 :: integer
|
34
34
|
%t22 = load_input "scalar_val" :: integer
|
35
35
|
loop matrix id=L4 in %t16 as el=%matrix_el_17, idx=%matrix_i_18
|
36
36
|
%t19 = load_field matrix_el_17["row"] :: any
|
37
37
|
loop row id=L5 in %t19 as el=%row_el_20, idx=%row_i_21
|
38
38
|
%t24 = load_field row_el_20["cell"] :: float
|
39
|
-
%t25 = make_tuple(%t22, %
|
39
|
+
%t25 = make_tuple(%t22, %t33, %t24) :: tuple<integer, integer, float>
|
40
40
|
yield %t25
|
41
41
|
end_loop
|
42
42
|
end_loop
|
@@ -28,9 +28,9 @@ export function _mixed_array(input) {
|
|
28
28
|
let t16 = input["matrix"];
|
29
29
|
let acc28 = 0;
|
30
30
|
let t29 = input["numbers"];
|
31
|
-
t29.forEach((
|
32
|
-
let
|
33
|
-
acc28 +=
|
31
|
+
t29.forEach((t30, t31) => {
|
32
|
+
let t32 = t30["value"];
|
33
|
+
acc28 += t32;
|
34
34
|
});
|
35
35
|
let t22 = input["scalar_val"];
|
36
36
|
t16.forEach((matrix_el_17, matrix_i_18) => {
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# Autogenerated by Kumi Codegen
|
2
|
-
module Kumi::Compiled::
|
2
|
+
module Kumi::Compiled::KUMI_bbe68fd87d3413dc8dc47548ccbe52c6bf4a9912417fdfc1a4c2fd87cd576fd9
|
3
3
|
def self.from(input_data = nil)
|
4
4
|
instance = Object.new
|
5
5
|
instance.extend(self)
|
@@ -59,18 +59,18 @@ module Kumi::Compiled::KUMI_6956147434af4c2cdea2b50d3a8b5f46f84443101a3d62ab0701
|
|
59
59
|
t16 = input["matrix"] || input[:matrix]
|
60
60
|
acc28 = 0
|
61
61
|
t29 = input["numbers"] || input[:numbers]
|
62
|
-
t29.each_with_index do |
|
63
|
-
|
64
|
-
acc28 +=
|
62
|
+
t29.each_with_index do |t30, t31|
|
63
|
+
t32 = t30["value"] || t30[:value]
|
64
|
+
acc28 += t32
|
65
65
|
end
|
66
|
-
|
66
|
+
t33 = acc28
|
67
67
|
t22 = input["scalar_val"] || input[:scalar_val]
|
68
68
|
t16.each_with_index do |matrix_el_17, matrix_i_18|
|
69
69
|
out_1 = []
|
70
70
|
t19 = matrix_el_17["row"] || matrix_el_17[:row]
|
71
71
|
t19.each_with_index do |row_el_20, row_i_21|
|
72
72
|
t24 = row_el_20["cell"] || row_el_20[:cell]
|
73
|
-
t25 = [t22,
|
73
|
+
t25 = [t22, t33, t24]
|
74
74
|
out_1 << t25
|
75
75
|
end
|
76
76
|
out << out_1
|
@@ -29,22 +29,22 @@
|
|
29
29
|
end_loop
|
30
30
|
)
|
31
31
|
(Declaration elem_affine
|
32
|
+
%t66 = load_input "global_offset" :: float
|
33
|
+
%t67 = const 1.0 :: float
|
34
|
+
%t68 = call core.add(%t66, %t67) :: float
|
32
35
|
%t19 = load_input "batch" :: array
|
33
36
|
loop batch id=L4 in %t19 as el=%batch_el_20, idx=%batch_i_21
|
37
|
+
%t62 = load_input "batch" :: array
|
38
|
+
%t64 = load_field batch_el_20["mean"] :: float
|
39
|
+
%t65 = call core.add(%t64, %t68) :: float
|
34
40
|
%t22 = load_field batch_el_20["row"] :: any
|
35
|
-
%t81 = load_input "global_offset" :: float
|
36
|
-
%t82 = const 1.0 :: float
|
37
|
-
%t83 = call core.add(%t81, %t82) :: float
|
38
41
|
loop row id=L5 in %t22 as el=%row_el_23, idx=%row_i_24
|
39
|
-
%t25 = load_field row_el_23["col"] :: any
|
40
42
|
%t57 = load_input "batch" :: array
|
41
43
|
%t58 = load_field batch_el_20["row"] :: any
|
42
44
|
%t59 = load_field row_el_23["scale"] :: float
|
43
45
|
%t60 = const 2.0 :: float
|
44
46
|
%t61 = call core.mul(%t59, %t60) :: float
|
45
|
-
%
|
46
|
-
%t64 = load_field batch_el_20["mean"] :: float
|
47
|
-
%t65 = call core.add(%t64, %t83) :: float
|
47
|
+
%t25 = load_field row_el_23["col"] :: any
|
48
48
|
loop col id=L6 in %t25 as el=%col_el_26, idx=%col_i_27
|
49
49
|
%t28 = load_field col_el_26["val"] :: float
|
50
50
|
%t30 = call core.mul(%t28, %t61) :: float
|
@@ -55,31 +55,31 @@
|
|
55
55
|
end_loop
|
56
56
|
)
|
57
57
|
(Declaration row_sum_affine
|
58
|
+
%t86 = load_input "global_offset" :: float
|
59
|
+
%t87 = const 1.0 :: float
|
60
|
+
%t88 = call core.add(%t86, %t87) :: float
|
58
61
|
%t33 = load_input "batch" :: array
|
59
62
|
loop batch id=L7 in %t33 as el=%batch_el_34, idx=%batch_i_35
|
63
|
+
%t82 = load_input "batch" :: array
|
64
|
+
%t84 = load_field batch_el_34["mean"] :: float
|
65
|
+
%t85 = call core.add(%t84, %t88) :: float
|
60
66
|
%t36 = load_field batch_el_34["row"] :: any
|
61
67
|
loop row id=L8 in %t36 as el=%row_el_37, idx=%row_i_38
|
68
|
+
%t77 = load_input "batch" :: array
|
69
|
+
%t78 = load_field batch_el_34["row"] :: any
|
70
|
+
%t79 = load_field row_el_37["scale"] :: float
|
71
|
+
%t80 = const 2.0 :: float
|
72
|
+
%t81 = call core.mul(%t79, %t80) :: float
|
62
73
|
%acc_39 = decl_acc :: float
|
63
74
|
%t40 = load_field row_el_37["col"] :: any
|
64
|
-
%t84 = load_input "batch" :: array
|
65
|
-
%t85 = load_field batch_el_34["row"] :: any
|
66
|
-
%t86 = load_field row_el_37["scale"] :: float
|
67
|
-
%t87 = const 2.0 :: float
|
68
|
-
%t88 = call core.mul(%t86, %t87) :: float
|
69
|
-
%t89 = load_input "batch" :: array
|
70
|
-
%t90 = load_input "global_offset" :: float
|
71
|
-
%t91 = const 1.0 :: float
|
72
|
-
%t92 = call core.add(%t90, %t91) :: float
|
73
|
-
%t93 = load_field batch_el_34["mean"] :: float
|
74
|
-
%t94 = call core.add(%t93, %t92) :: float
|
75
75
|
loop col id=L9 in %t40 as el=%col_el_41, idx=%col_i_42
|
76
|
-
%
|
77
|
-
%
|
78
|
-
%
|
79
|
-
%
|
80
|
-
%
|
81
|
-
%
|
82
|
-
%acc_39 = acc_add agg.sum(%acc_39, %
|
76
|
+
%t69 = load_input "batch" :: array
|
77
|
+
%t70 = load_field batch_el_34["row"] :: any
|
78
|
+
%t71 = load_field row_el_37["col"] :: any
|
79
|
+
%t72 = load_field col_el_41["val"] :: float
|
80
|
+
%t74 = call core.mul(%t72, %t81) :: float
|
81
|
+
%t76 = call core.add(%t74, %t85) :: float
|
82
|
+
%acc_39 = acc_add agg.sum(%acc_39, %t76) :: float
|
83
83
|
end_loop
|
84
84
|
%t44 = acc_load %acc_39 :: float
|
85
85
|
yield %t44
|
@@ -87,37 +87,37 @@
|
|
87
87
|
end_loop
|
88
88
|
)
|
89
89
|
(Declaration batch_total_affine
|
90
|
+
%t115 = load_input "global_offset" :: float
|
91
|
+
%t116 = const 1.0 :: float
|
92
|
+
%t117 = call core.add(%t115, %t116) :: float
|
90
93
|
%t45 = load_input "batch" :: array
|
91
94
|
loop batch id=L10 in %t45 as el=%batch_el_46, idx=%batch_i_47
|
95
|
+
%t111 = load_input "batch" :: array
|
96
|
+
%t113 = load_field batch_el_46["mean"] :: float
|
97
|
+
%t114 = call core.add(%t113, %t117) :: float
|
92
98
|
%acc_48 = decl_acc :: float
|
93
99
|
%t49 = load_field batch_el_46["row"] :: any
|
94
100
|
loop row id=L11 in %t49 as el=%row_el_50, idx=%row_i_51
|
95
|
-
%
|
96
|
-
%
|
97
|
-
%
|
98
|
-
%
|
99
|
-
%t110 =
|
100
|
-
%
|
101
|
-
%
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
%t97 = load_field row_el_50["col"] :: any
|
101
|
+
%t106 = load_input "batch" :: array
|
102
|
+
%t107 = load_field batch_el_46["row"] :: any
|
103
|
+
%t108 = load_field row_el_50["scale"] :: float
|
104
|
+
%t109 = const 2.0 :: float
|
105
|
+
%t110 = call core.mul(%t108, %t109) :: float
|
106
|
+
%t89 = load_input "batch" :: array
|
107
|
+
%t90 = load_field batch_el_46["row"] :: any
|
108
|
+
%acc92 = decl_acc :: float
|
109
|
+
%t93 = load_field row_el_50["col"] :: any
|
110
|
+
loop col id=L12 in %t93 as el=%t94, idx=%t95
|
106
111
|
%t98 = load_input "batch" :: array
|
107
112
|
%t99 = load_field batch_el_46["row"] :: any
|
108
|
-
%t100 = load_field row_el_50["
|
109
|
-
%t101 =
|
110
|
-
%
|
111
|
-
%
|
112
|
-
%
|
113
|
-
%t106 = call core.add(%t105, %t112) :: float
|
114
|
-
%t107 = load_field col_el_41["val"] :: float
|
115
|
-
%t108 = call core.mul(%t107, %t102) :: float
|
116
|
-
%t109 = call core.add(%t108, %t106) :: float
|
117
|
-
%acc77 = acc_add agg.sum(%acc77, %t109) :: float
|
113
|
+
%t100 = load_field row_el_50["col"] :: any
|
114
|
+
%t101 = load_field t94["val"] :: float
|
115
|
+
%t103 = call core.mul(%t101, %t110) :: float
|
116
|
+
%t105 = call core.add(%t103, %t114) :: float
|
117
|
+
%acc92 = acc_add agg.sum(%acc92, %t105) :: float
|
118
118
|
end_loop
|
119
|
-
%
|
120
|
-
%acc_48 = acc_add agg.sum(%acc_48, %
|
119
|
+
%t97 = acc_load %acc92 :: float
|
120
|
+
%acc_48 = acc_add agg.sum(%acc_48, %t97) :: float
|
121
121
|
end_loop
|
122
122
|
%t53 = acc_load %acc_48 :: float
|
123
123
|
yield %t53
|
@@ -29,19 +29,19 @@
|
|
29
29
|
end_loop
|
30
30
|
)
|
31
31
|
(Declaration elem_affine
|
32
|
+
%t66 = load_input "global_offset" :: float
|
33
|
+
%t67 = const 1.0 :: float
|
34
|
+
%t68 = call core.add(%t66, %t67) :: float
|
32
35
|
%t19 = load_input "batch" :: array
|
33
36
|
loop batch id=L4 in %t19 as el=%batch_el_20, idx=%batch_i_21
|
37
|
+
%t64 = load_field batch_el_20["mean"] :: float
|
34
38
|
%t22 = load_field batch_el_20["row"] :: any
|
35
|
-
%
|
36
|
-
%t82 = const 1.0 :: float
|
37
|
-
%t83 = call core.add(%t81, %t82) :: float
|
39
|
+
%t65 = call core.add(%t64, %t68) :: float
|
38
40
|
loop row id=L5 in %t22 as el=%row_el_23, idx=%row_i_24
|
39
|
-
%t25 = load_field row_el_23["col"] :: any
|
40
41
|
%t59 = load_field row_el_23["scale"] :: float
|
41
42
|
%t60 = const 2.0 :: float
|
42
43
|
%t61 = call core.mul(%t59, %t60) :: float
|
43
|
-
%
|
44
|
-
%t65 = call core.add(%t64, %t83) :: float
|
44
|
+
%t25 = load_field row_el_23["col"] :: any
|
45
45
|
loop col id=L6 in %t25 as el=%col_el_26, idx=%col_i_27
|
46
46
|
%t28 = load_field col_el_26["val"] :: float
|
47
47
|
%t30 = call core.mul(%t28, %t61) :: float
|
@@ -52,25 +52,25 @@
|
|
52
52
|
end_loop
|
53
53
|
)
|
54
54
|
(Declaration row_sum_affine
|
55
|
+
%t86 = load_input "global_offset" :: float
|
56
|
+
%t87 = const 1.0 :: float
|
57
|
+
%t88 = call core.add(%t86, %t87) :: float
|
55
58
|
%t33 = load_input "batch" :: array
|
56
59
|
loop batch id=L7 in %t33 as el=%batch_el_34, idx=%batch_i_35
|
60
|
+
%t84 = load_field batch_el_34["mean"] :: float
|
57
61
|
%t36 = load_field batch_el_34["row"] :: any
|
62
|
+
%t85 = call core.add(%t84, %t88) :: float
|
58
63
|
loop row id=L8 in %t36 as el=%row_el_37, idx=%row_i_38
|
64
|
+
%t79 = load_field row_el_37["scale"] :: float
|
65
|
+
%t80 = const 2.0 :: float
|
66
|
+
%t81 = call core.mul(%t79, %t80) :: float
|
59
67
|
%acc_39 = decl_acc :: float
|
60
68
|
%t40 = load_field row_el_37["col"] :: any
|
61
|
-
%t86 = load_field row_el_37["scale"] :: float
|
62
|
-
%t87 = const 2.0 :: float
|
63
|
-
%t88 = call core.mul(%t86, %t87) :: float
|
64
|
-
%t90 = load_input "global_offset" :: float
|
65
|
-
%t91 = const 1.0 :: float
|
66
|
-
%t92 = call core.add(%t90, %t91) :: float
|
67
|
-
%t93 = load_field batch_el_34["mean"] :: float
|
68
|
-
%t94 = call core.add(%t93, %t92) :: float
|
69
69
|
loop col id=L9 in %t40 as el=%col_el_41, idx=%col_i_42
|
70
|
-
%
|
71
|
-
%
|
72
|
-
%
|
73
|
-
%acc_39 = acc_add agg.sum(%acc_39, %
|
70
|
+
%t72 = load_field col_el_41["val"] :: float
|
71
|
+
%t74 = call core.mul(%t72, %t81) :: float
|
72
|
+
%t76 = call core.add(%t74, %t85) :: float
|
73
|
+
%acc_39 = acc_add agg.sum(%acc_39, %t76) :: float
|
74
74
|
end_loop
|
75
75
|
%t44 = acc_load %acc_39 :: float
|
76
76
|
yield %t44
|
@@ -78,29 +78,29 @@
|
|
78
78
|
end_loop
|
79
79
|
)
|
80
80
|
(Declaration batch_total_affine
|
81
|
+
%t115 = load_input "global_offset" :: float
|
82
|
+
%t116 = const 1.0 :: float
|
83
|
+
%t117 = call core.add(%t115, %t116) :: float
|
81
84
|
%t45 = load_input "batch" :: array
|
82
85
|
loop batch id=L10 in %t45 as el=%batch_el_46, idx=%batch_i_47
|
86
|
+
%t113 = load_field batch_el_46["mean"] :: float
|
83
87
|
%acc_48 = decl_acc :: float
|
84
88
|
%t49 = load_field batch_el_46["row"] :: any
|
89
|
+
%t114 = call core.add(%t113, %t117) :: float
|
85
90
|
loop row id=L11 in %t49 as el=%row_el_50, idx=%row_i_51
|
86
|
-
%
|
87
|
-
%
|
88
|
-
%t110 =
|
89
|
-
%
|
90
|
-
%
|
91
|
-
loop col id=L12 in %
|
92
|
-
%
|
93
|
-
%
|
94
|
-
%
|
95
|
-
%
|
96
|
-
%t106 = call core.add(%t105, %t112) :: float
|
97
|
-
%t107 = load_field col_el_41["val"] :: float
|
98
|
-
%t108 = call core.mul(%t107, %t102) :: float
|
99
|
-
%t109 = call core.add(%t108, %t106) :: float
|
100
|
-
%acc77 = acc_add agg.sum(%acc77, %t109) :: float
|
91
|
+
%t108 = load_field row_el_50["scale"] :: float
|
92
|
+
%t109 = const 2.0 :: float
|
93
|
+
%t110 = call core.mul(%t108, %t109) :: float
|
94
|
+
%acc92 = decl_acc :: float
|
95
|
+
%t93 = load_field row_el_50["col"] :: any
|
96
|
+
loop col id=L12 in %t93 as el=%t94, idx=%t95
|
97
|
+
%t101 = load_field t94["val"] :: float
|
98
|
+
%t103 = call core.mul(%t101, %t110) :: float
|
99
|
+
%t105 = call core.add(%t103, %t114) :: float
|
100
|
+
%acc92 = acc_add agg.sum(%acc92, %t105) :: float
|
101
101
|
end_loop
|
102
|
-
%
|
103
|
-
%acc_48 = acc_add agg.sum(%acc_48, %
|
102
|
+
%t97 = acc_load %acc92 :: float
|
103
|
+
%acc_48 = acc_add agg.sum(%acc_48, %t97) :: float
|
104
104
|
end_loop
|
105
105
|
%t53 = acc_load %acc_48 :: float
|
106
106
|
yield %t53
|