Move Assert to the GPU in both back-end.
Merge pull request #2092 from nouiz/gpu_assert

Move Assert to the GPU in both back-end.