Fixed an LLVM assert in the OpenCL and CUDA targets.