tmcdonell/cuda — pull request #2 by mainland (2012-08-31 10:21:58+00:00)
Title: Write NULL to pointers before using them as a destination for device memory allocation.

On a 64-bit architecture, compiling a GHC program that uses the cuda package
with -O sometimes leaves garbage in the high 4 bytes of device pointers. The
CUDA SDK samples seem to NULL out pointers before using them as a destination
for device memory allocation, but I couldn't find any documentation that this is
required. However, this patch solves all my crashing problems.