18 #ifndef viskores_cuda_interop_SetOpenGLDevice_h
19 #define viskores_cuda_interop_SetOpenGLDevice_h
22 #include <cuda_gl_interop.h>
33 static void SetCudaGLDevice(
int id)
39 cudaError_t cError = cudaGLSetGLDevice(
id);
41 cudaError_t cError = cudaSetDevice(
id);
43 if (cError != cudaSuccess)
45 std::string cuda_error_msg(
"Unable to setup cuda/opengl interop. Error: ");
46 cuda_error_msg.append(cudaGetErrorString(cError));
54 #endif //viskores_cuda_interop_SetOpenGLDevice_h