Added the CUDA backend's version of an Accelerate FFI.
Haddock wibbles.
Used more descriptive names and added haddock comments to inContext and inDefaultContext.
Changed to match new ForeignFun definition. Also more haddock wibbles.
Changed backend representation to use CIO instead of IO. Also removed tuple conversion of DevicePtrs.
Merge pull request #3 from robeverest/master

An FFI for the CUDA backend.
Added explicit casting to intersect. Fixes AccelerateHS/accelerate#79
Added support for foreign scalar functions. Also renamed foreign utility functions so as to differentiate between the different types of FFI calls.
fix: canonicalizePath fails for non-existent directories
Fixed bug in handling of scalar foreign functions and clarity wibbles
Redux "fix: canonicalizePath fails for non-existent directories"

This reverts/fixes commit 8ff5593f0cfe560b15e345867fc030113c081125.
run 'autoconf' if the configure script is not found

fixes: AccelerateHS/accelerate#76
launch config: choose larger block sizes for fold*
Fixed bug where mod and div didn't work for shapes on 64bit.
compute 1.x: pass shapes of free arrays as kernel parameters
bug fix: permute launch configuration

thread launch configuration should be based on the size of the source array, not the defaults
roll our own context

store device properties and weak pointer so that we don't need to continually recreate these things on every invocation of 'run'.
cleanup some of the foreign function stuff

- don't do case handling inline with the pattern match
- trailing whitespace, wibbles
tidy codegen for foreign functions

- don't handle case matches inline
- collect foreign headers as we go instead of in a second pass
compile fix

#derp