10 #ifndef vtk_m_cuda_interop_SetOpenGLDevice_h
11 #define vtk_m_cuda_interop_SetOpenGLDevice_h
14 #include <cuda_gl_interop.h>
25 static void SetCudaGLDevice(
int id)
31 cudaError_t cError = cudaGLSetGLDevice(
id);
33 cudaError_t cError = cudaSetDevice(
id);
35 if (cError != cudaSuccess)
37 std::string cuda_error_msg(
"Unable to setup cuda/opengl interop. Error: ");
38 cuda_error_msg.append(cudaGetErrorString(cError));
46 #endif //vtk_m_cuda_interop_SetOpenGLDevice_h