* plugin/plugin-nvptx.c (nvptx_get_num_devices): Return zero
on cuInit failure.
From-SVN: r223352
+2015-05-19 Julian Brown <julian@codesourcery.com>
+
+ * plugin/plugin-nvptx.c (nvptx_get_num_devices): Return zero
+ on cuInit failure.
+
2015-05-13 Jakub Jelinek <jakub@redhat.com>
PR middle-end/66133
until cuInit has been called. Just call it now (but don't yet do any
further initialization). */
if (instantiated_devices == 0)
- cuInit (0);
+ {
+ r = cuInit (0);
+ /* This is not an error: e.g. we may have CUDA libraries installed but
+ no devices available. */
+ if (r != CUDA_SUCCESS)
+ return 0;
+ }
r = cuDeviceGetCount (&n);
if (r!= CUDA_SUCCESS)