Different GPU cards offer varying levels of support for double-precision floating-point numbers. You may therefore decide to support both single- and double-precision floating-point numbers in your GPU code.
It is generally easiest to support multiple floating-point types through the use of templated classes, where the floating-point type is the parameter of the template class.
If you decide to use this approach, then you may also benefit by using the
C++ SharedMemory
class supplied by Nvidia, a copy of
which is in the sample file AvgOptDevice.cu
in the
AvgOptCuda sample project.