Class: Kumi::IR::Loop::Builder

Inherits:
Base::Builder show all
Defined in:
lib/kumi/ir/loop/builder.rb

Instance Attribute Summary

Attributes inherited from Base::Builder

#current_block, #function, #ir_module

Instance Method Summary collapse

Methods inherited from Base::Builder

#emit, #initialize, #new_block, #set_block

Constructor Details

This class inherits a constructor from Kumi::IR::Base::Builder

Instance Method Details

#acc_init(result:, fn:, init:, nil_init:, dtype: nil, metadata: {}) ⇒ Object



63
64
65
# File 'lib/kumi/ir/loop/builder.rb', line 63

def acc_init(result:, fn:, init:, nil_init:, dtype: nil, metadata: {})
  append Ops::AccInit.new(result:, fn:, init:, nil_init:, dtype:, metadata:)
end

#acc_load(result:, acc:, dtype: nil, metadata: {}) ⇒ Object



71
72
73
# File 'lib/kumi/ir/loop/builder.rb', line 71

def acc_load(result:, acc:, dtype: nil, metadata: {})
  append Ops::AccLoad.new(result:, acc:, dtype:, metadata:)
end

#acc_step(acc:, value:, fn:, nil_init:, metadata: {}) ⇒ Object



67
68
69
# File 'lib/kumi/ir/loop/builder.rb', line 67

def acc_step(acc:, value:, fn:, nil_init:, metadata: {})
  append Ops::AccStep.new(acc:, value:, fn:, nil_init:, metadata:)
end

#array_init(result:, metadata: {}) ⇒ Object



43
44
45
# File 'lib/kumi/ir/loop/builder.rb', line 43

def array_init(result:, metadata: {})
  append Ops::ArrayInit.new(result:, metadata:)
end

#array_len(result:, array:, metadata: {}) ⇒ Object



51
52
53
# File 'lib/kumi/ir/loop/builder.rb', line 51

def array_len(result:, array:, metadata: {})
  append Ops::ArrayLen.new(result:, array:, metadata:)
end

#array_push(array:, value:, metadata: {}) ⇒ Object



47
48
49
# File 'lib/kumi/ir/loop/builder.rb', line 47

def array_push(array:, value:, metadata: {})
  append Ops::ArrayPush.new(array:, value:, metadata:)
end

#constant(result:, value:, axes: [], dtype: nil, metadata: {}) ⇒ Object



7
8
9
# File 'lib/kumi/ir/loop/builder.rb', line 7

def constant(result:, value:, axes: [], dtype: nil, metadata: {})
  append Ops::Constant.new(result:, value:, axes:, dtype:, metadata:)
end

#index_read(result:, array:, index:, axes: [], dtype: nil, metadata: {}) ⇒ Object



55
56
57
# File 'lib/kumi/ir/loop/builder.rb', line 55

def index_read(result:, array:, index:, axes: [], dtype: nil, metadata: {})
  append Ops::IndexRead.new(result:, array:, index:, axes:, dtype:, metadata:)
end

#kernel_call(result:, fn:, args:, axes: [], dtype: nil, metadata: {}) ⇒ Object



19
20
21
# File 'lib/kumi/ir/loop/builder.rb', line 19

def kernel_call(result:, fn:, args:, axes: [], dtype: nil, metadata: {})
  append Ops::KernelCall.new(result:, fn:, args:, axes:, dtype:, metadata:)
end

#load_field(result:, object:, field:, axes: [], dtype: nil, metadata: {}) ⇒ Object



15
16
17
# File 'lib/kumi/ir/loop/builder.rb', line 15

def load_field(result:, object:, field:, axes: [], dtype: nil, metadata: {})
  append Ops::LoadField.new(result:, object:, field:, axes:, dtype:, metadata:)
end

#load_input(result:, key:, axes: [], dtype: nil, metadata: {}) ⇒ Object



11
12
13
# File 'lib/kumi/ir/loop/builder.rb', line 11

def load_input(result:, key:, axes: [], dtype: nil, metadata: {})
  append Ops::LoadInput.new(result:, key:, axes:, dtype:, metadata:)
end

#loop_end(axis:, metadata: {}) ⇒ Object



39
40
41
# File 'lib/kumi/ir/loop/builder.rb', line 39

def loop_end(axis:, metadata: {})
  append Ops::LoopEnd.new(axis:, metadata:)
end

#loop_start(result:, source:, axis:, index:, metadata: {}) ⇒ Object



35
36
37
# File 'lib/kumi/ir/loop/builder.rb', line 35

def loop_start(result:, source:, axis:, index:, metadata: {})
  append Ops::LoopStart.new(result:, source:, axis:, index:, metadata:)
end

#make_object(result:, inputs:, keys:, axes: [], dtype: nil, metadata: {}) ⇒ Object



27
28
29
# File 'lib/kumi/ir/loop/builder.rb', line 27

def make_object(result:, inputs:, keys:, axes: [], dtype: nil, metadata: {})
  append Ops::MakeObject.new(result:, inputs:, keys:, axes:, dtype:, metadata:)
end

#ref(result:, value:, axes: [], dtype: nil, metadata: {}) ⇒ Object



31
32
33
# File 'lib/kumi/ir/loop/builder.rb', line 31

def ref(result:, value:, axes: [], dtype: nil, metadata: {})
  append Ops::Ref.new(result:, value:, axes:, dtype:, metadata:)
end

#select(result:, cond:, on_true:, on_false:, axes: [], dtype: nil, metadata: {}) ⇒ Object



23
24
25
# File 'lib/kumi/ir/loop/builder.rb', line 23

def select(result:, cond:, on_true:, on_false:, axes: [], dtype: nil, metadata: {})
  append Ops::Select.new(result:, cond:, on_true:, on_false:, axes:, dtype:, metadata:)
end

#shift_read(result:, array:, index:, length:, offset:, policy:, fill: nil, dtype: nil, metadata: {}) ⇒ Object



59
60
61
# File 'lib/kumi/ir/loop/builder.rb', line 59

def shift_read(result:, array:, index:, length:, offset:, policy:, fill: nil, dtype: nil, metadata: {})
  append Ops::ShiftRead.new(result:, array:, index:, length:, offset:, policy:, fill:, dtype:, metadata:)
end