KernelPipeline.activated: def of stelliferous@0.0.2.0 Import: import stelliferous@0.0.2.0/kernel_pipeline.bend as KernelPipeline Lines 47-63 of stelliferous@0.0.2.0/kernel_pipeline.bend: https://jend.leeeet.dev/read.txt?path=stelliferous@0.0.2.0/kernel_pipeline.bend&start_line=47&end_line=63 import Base import stelliferous@0.0.2.0/storage_buffer.bend as Storage import stelliferous@0.0.2.0/math_activation.bend as Activations # One tight pass over each finished leaf while it is still in cache; applying # the activation inside the store measured about twice as slow. The built-in # is chosen once per leaf, so each pass is specialized; the identity skips it. # Sigmoid, SiLU, tanh and GELU pass their values through tiles. def activated(~custom: F32 -> F32,activation: Activations.Activation,+count: U32,buffer: Storage.Buffer) -> Storage.Buffer: match activation: case Activations.Identity{}: buffer case Activations.ReLU{}: unit_mapped(~Activations.relu_value,count,buffer) case Activations.ReLU6{}: unit_mapped(~Activations.relu6_value,count,buffer) case Activations.LeakyReLU{slope}: mapped(~F32,~leaky_relu_value,count,slope,buffer) case Activations.Sigmoid{}: unit_lanes(~Activations.sigmoid_value,count,buffer) case Activations.SiLU{}: unit_lanes(~Activations.silu_value,count,buffer) case Activations.Tanh{}: unit_lanes(~Activations.tanh_value,count,buffer) case Activations.HardSigmoid{}: unit_mapped(~Activations.hard_sigmoid_value,count,buffer) case Activations.HardSwish{}: unit_mapped(~Activations.hard_swish_value,count,buffer) case Activations.GELUTanh{}: unit_lanes(~Activations.gelu_tanh_value,count,buffer) case Activations.Custom{operations}: unit_mapped(~custom,count,buffer) Uses (16): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/kernel_pipeline.bend&name=leaky_relu_value https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/kernel_pipeline.bend&name=mapped https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/kernel_pipeline.bend&name=unit_lanes https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/kernel_pipeline.bend&name=unit_mapped https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/math_activation.bend&name=Activation https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/math_activation.bend&name=gelu_tanh_value https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/math_activation.bend&name=hard_sigmoid_value https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/math_activation.bend&name=hard_swish_value https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/math_activation.bend&name=relu6_value https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/math_activation.bend&name=relu_value https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/math_activation.bend&name=sigmoid_value https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/math_activation.bend&name=silu_value https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/math_activation.bend&name=tanh_value https://jend.leeeet.dev/definition.txt?path=stelliferous@0.0.2.0/storage_buffer.bend&name=Buffer