oid Sigmoid([Global]float[] x)
    {
        int i = get_global_id(0);
        x[i] = exp(x[i]) / (exp(x[i]) + 1);
    }

    [OpenCLKernel]
    void Threshold([Global] float[] x, float value)
    {
        int i = get_global_id(0);
        x[i] = x[i] &gt; value ? 1 : 0;
    }
}
</code></pre>
<p>And if we need to invoke using AmplifyFor loop which is an extension method for an array, here is the below code:</p>
<pre><code class="lang-csharp">public void Execute()
{
    //Create instance of OpenCL compiler 