CUDA device check during run-time

Hi All,

Currently I am developing a multi-platform application using CUDA. I want to make the application to work with or without CUDA. Is there any way to create a single binary that:

  1. checks the availability of CUDA device, SDK, and Toolkit on run-time
  2. when CUDA device, SDK, and Toolkit exist, it executes CUDA-based functions.
  3. when CUDA device, SDK, and Toolkit don’t exist, it executes CPU-based functions.

Thank you very much in advance.

Nicky