You can often see OpenCL kernels such as

```
kernel void aKernel(global float* input, global float* output, const uint N)
{
      const uint global_id = get_global_id(0);
      if (global_id >= N) return;
    // ...
}

```

I am wondering if this `if (global_id >= N) return;` is really necessary, especially if you create your buffer with the global size.

* In which cases they are mandatory?
* Is it a OpenCL code convention?