Skip to content

OpenVINO™ is an open source toolkit for optimizing and deploying AI inference

4.4 KB
Raw Blame
<CustomLayer name="CustomOp" type="SimpleGPU" version="1">
    <Kernel entry="custom_kernel">
        <Source filename="custom_op.cl"/>
        <Define name="alpha" type="float" param="alpha" default="1.0"/>
        <Define name="beta" type="float" param="beta" default="0.0"/>
    </Kernel>
    <Buffers><!-- use the same order as the kernel entry function, so in this case (input0,input1,output0,int,float,weights) -->
        <Tensor arg-index="0" type="input" port-index="0"/>
        <Tensor arg-index="1" type="output" port-index="0" format="BFYX"/>
    </Buffers>
    <CompilerOptions options="-cl-mad-enable"/>
    <WorkSizes global="B*F*Y*X,1,1"/>
</CustomLayer>

<CustomLayer name="CustomOpIntBuf" type="SimpleGPU" version="1">
    <Kernel entry="custom_kernel_intr_buffer">
        <Source filename="custom_op_internal_buffer.cl"/>
    </Kernel>
    <Buffers>
        <Tensor arg-index="0" type="input" port-index="0" />   <!-- pts -->
        <Tensor arg-index="1" type="output" port-index="0" format="BFYX"/>  <!-- output -->
        <Tensor arg-index="2" type="internal" port-index="0" size="INPUT0_DIMS[0]*INPUT0_DIMS[1]*INPUT0_DIMS[2]*INPUT0_DIMS[3]" format="BFYX"/> <!-- simple fixed size -->    
                                                                   <!-- need to pass total memory required for allocation -->
    </Buffers>
    <CompilerOptions options="-cl-mad-enable"/>
    <WorkSizes global="B*F*Y*X,1,1"/>
</CustomLayer>

<CustomLayer name="CustomOpAnyFmt" type="SimpleGPU" version="1">
    <Kernel entry="custom_kernel_axis_probe">
        <Source filename="custom_op_any_format.cl"/>
    </Kernel>
    <Buffers>
        <Tensor arg-index="0" type="input" port-index="0"/>
        <Tensor arg-index="1" type="output" port-index="0" format="ANY"/>
    </Buffers>
    <CompilerOptions options="-cl-mad-enable"/>
    <!-- Over the individual X and Y extents, not their product, so a transposed output
         layout changes the dispatch instead of cancelling out. -->
    <WorkSizes global="X,Y,1"/>
</CustomLayer>

<CustomLayer name="CustomOpAnyFmt3D" type="SimpleGPU" version="1">
    <Kernel entry="custom_kernel_axis_probe_3d">
        <Source filename="custom_op_any_format_3d.cl"/>
    </Kernel>
    <Buffers>
        <Tensor arg-index="0" type="input" port-index="0"/>
        <Tensor arg-index="1" type="output" port-index="0" format="ANY"/>
    </Buffers>
    <CompilerOptions options="-cl-mad-enable"/>
    <WorkSizes global="Y,F,B"/>
</CustomLayer>

<CustomLayer name="CustomOpTwoIn" type="SimpleGPU" version="1">
    <Kernel entry="custom_kernel_two_inputs">
        <Source filename="custom_op_two_inputs.cl"/>
    </Kernel>
    <Buffers>
        <Tensor arg-index="0" type="input" port-index="0" format="BFYX"/>
        <Tensor arg-index="1" type="input" port-index="1" format="BFYX"/>
        <Tensor arg-index="2" type="output" port-index="0" format="BFYX"/>
    </Buffers>
    <CompilerOptions options="-cl-mad-enable"/>
    <WorkSizes global="B*F*Y*X,1,1"/>
</CustomLayer>

<CustomLayer name="CustomOpAnyFmtYxfb" type="SimpleGPU" version="1">
    <Kernel entry="custom_kernel_yxfb_copy">
        <Source filename="custom_op_any_format_yxfb.cl"/>
    </Kernel>
    <Buffers>
        <Tensor arg-index="0" type="input" port-index="0" format="YXFB"/>
        <Tensor arg-index="1" type="output" port-index="0" format="ANY"/>
    </Buffers>
    <CompilerOptions options="-cl-mad-enable"/>
    <WorkSizes global="B*F*Y*X,1,1"/>
</CustomLayer>

<CustomLayer name="CustomOpTwoInFmt" type="SimpleGPU" version="1">
    <Kernel entry="custom_kernel_second_port_copy">
        <Source filename="custom_op_two_inputs_fmt.cl"/>
    </Kernel>
    <Buffers>
        <Tensor arg-index="0" type="input" port-index="0" format="BFYX"/>
        <Tensor arg-index="1" type="input" port-index="1" format="YXFB"/>
        <Tensor arg-index="2" type="output" port-index="0" format="YXFB"/>
    </Buffers>
    <CompilerOptions options="-cl-mad-enable"/>
    <WorkSizes global="B*F*Y*X,1,1"/>
</CustomLayer>

<CustomLayer name="CustomOpAnyFmtDyn" type="SimpleGPU" version="1">
    <Kernel entry="custom_kernel_dyn_copy">
        <Source filename="custom_op_any_format_dyn.cl"/>
    </Kernel>
    <Buffers>
        <Tensor arg-index="0" type="input" port-index="0"/>
        <Tensor arg-index="1" type="output" port-index="0" format="ANY"/>
    </Buffers>
    <CompilerOptions options="-cl-mad-enable"/>
    <WorkSizes global="B*F*Y*X,1,1"/>
</CustomLayer>