Added "require_cudadevice" to testcases. Make configure check whether a device is available.