Using K constants.
Allocate memory Ptr for userData object. Kind of dumb, but it looks like NVidia stuff crashes if it's null.
Added a test method for testing GPU mining. Can't even test the test method due to crash with my NVidia.