Modified and extended ROpenCL for the book

enqueueNDRangeKernel() now takes localWorkSize as an optional parameter
so you don’t _have_ to specify it, in which case the OpenCL driver will
choose an appropriate number. With OpenCL as it currently stands <2.0
you still have to choose globalWorkSize as a multiple of localWorkSize,
so stick to multiples of 1024 and you should be safe. Also it can now
take global and localWorkSize as vectors (up to 2D right now) to make
support for 2D matrix algs more natural for R programmers rather than
forcing them always into a 1D world. [TODO complete by adding in
support for 3D.]

enqueueReadBuffer() can now take an optional offset into the R vector
to start copying into. This enables a single R result vector to be
built up through multiple kernel invocations and saves some memory copy
overhead as well as reducing overall memory requirements.

assignKernelArg() added to enable the parameter to a compiled kernel to
be changed between invocations. Called it assign to differentiate from
OpenCL setKernelArg which is already exposed and called internally.
assignKernelArg figures out appropriate setKernelArg to call based on
the R parameter value type.

Added deviceSupports[Single|Double|Half]Precision() convenience
functions to make it easier for R programmers to switch their code
based on the precision capability of the underlying device (returns
TRUE|FALSE). If you pass in a second arg as an empty list(), then this
will be filled out with the details of exactly what floating point
capabilities the device has for this precision (rounding etc).
Added unified error handling and OpenCL API calls

Added unified error handling for OpenCL calls through last error logged
state (R runs single threaded in any case). This includes error
handling for ALL errors and mapping to (OpenCL equivalent) strings so
that messages can be communicated back out to the R programmer and they
can look them up in standard OpenCL documentation for further
explanation. Compilation is fine-grained conditional throughout the
code based on what version of OpenCL is actually supported by the host
operating system and compilation environment(!)

getDeviceIDs() has been changed to return all devices within a
platform, i.e. the previous GPU filter option has been removed - having
ROpenCL versions of the same named OpenCL API call behave differently
makes life confusing. However, I have enforced that GPU devices are
listed first so that behaviour should not affect already existing code
that just picked the first item off the list as a GPU. Previously there
was no way for R to get access to the CPU device and this was limiting
how R programmers could use OpenCL, so…

getGPUDeviceIDs() and getCPUDeviceIDs() added to bring back the
convenience of previous behaviour of getDeviceIDs() - so really I have
just done a bit of rationalisation between all three of these and how
things are named.

Added getPlatformInfo() which for convenience just returns everything
that can be queried in a list where each item is named according to its
OpenCL query parameter, e.g. after calling
  info <- getPlatformInfo(p)
you get back a list which you can access like
  info$CL_PLATFORM_VERSION
Parameters such as CL_PLATFORM_EXTENSIONS return a value which is
itself a list where each item in the list corresponds to a string name
of each extension supported.
This model of returning large amounts of info as a list of named items
is also followed by all the other configuration query functions that
have been added.

Added getDeviceType() for convenience which will return a string of
either: CL_DEVICE_TYPE_CPU, CL_DEVICE_TYPE_GPU etc.

Added getDeviceDoubleFP(), getDeviceSingleFP(), getDeviceHalfFP() which
are used by the R deviceSupports[Double|Single|Half]Precision()
function.

Added getDeviceInfo() which returns a very long list of named items,
but not all OpenCL query options I have implemented yet, but all the
conditional compilation stubs are present. I have implemented all the
key ones most R programmers will care about when writing their C kernel
functions.

Added getKernelWorkGroupInfo() primarily to enable the preferred
localWorkSize for a given kernel to be looked up.

Extended createContext() so that it support multiple memory flag
settings (pass them in as a single space separated string) and not just
CL_MEM_WRITE_ONLY and CL_MEM_READ_ONLY.

Fixed enqueueWriteBufferIntegerVector() so that it uses int datatype
and not double.
Fixed enqueueReadBufferIntegerVector() in same fashion.

Added explicit enqueue1DRangeKernel() and enqueue2DRangeKernel().

enqueueReadBuffer[Integer|Float]Vector() now take an offset into the R
vector to start copying into.
Renamed createProgram to buildKernel
Merge pull request #1 from jmgurgeh/master

Changes for parallel R book