added getDevice internal function for opencl

this function can be used to retrieve the currently active device
modified buildProgram opencl helper function

buildProgram is used to build kernels for all devices associated
to a given context earlier.

After this change, kernel shall be built only for currently active
device.
moved ocl kernel resources from stack to heap

cl::Program and cl::Kernel objects were being created on global
stack earlier. Even though that is efficient and worked fine on
linux and macosx platforms. It caused out of control runtime errors
on windows platforms at the exit of the application that is using
the library. This could be mostly a driver bug in OpenCL drivers
for windows, therefore this change might be reverted in future.
Moved cl_khr_fp64 extension

* Moved cl_khr_fp64 extension pragma to common location.
* Modified the following functions to reflect the above change.
    * transpose
    * reduce
    * scan
    * binaryOp
* added line of code in scan unit tests to handle double precision
  related checks for devices that doesnt have the necessary hardware