changed dim_type typedef to int from long long

Performance improvements for CUDA and OpenCL kernels.
Fixes #117