plugin-nvptx.c (nvptx_get_num_devices): Return zero on cuInit failure.
* plugin/plugin-nvptx.c (nvptx_get_num_devices): Return zero on cuInit failure. From-SVN: r223352
This commit is contained in:
parent
9626d143b9
commit
c831982647
@ -1,3 +1,8 @@
|
||||
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
|
||||
|
@ -782,7 +782,13 @@ nvptx_get_num_devices (void)
|
||||
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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user