Skip to content

Commit e5923cb

Browse files
committed
Merge branch 'lazy_backend_switch' of 9prady9/arrayfire-python into features_3.4
2 parents 64c959a + 8b5b58e commit e5923cb

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

arrayfire/library.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -534,9 +534,23 @@ def __init__(self):
534534
except:
535535
pass
536536

537+
c_dim4 = c_dim_t*4
538+
539+
out = c_dim_t(0)
540+
dims = c_dim4(10, 10, 10, 10)
541+
542+
for key, value in self.__clibs:
543+
err = value.af_randu(ct.pointer(out), 4, ct.pointer(dims), 0)
544+
if (err == ERR.NONE.value):
545+
if (self.__name != key):
546+
self.__name = key
547+
break
548+
else:
549+
self.__name = None
550+
pass
551+
537552
if (self.__name is None):
538-
raise RuntimeError("Could not load any ArrayFire libraries.\n" +
539-
more_info_str)
553+
raise RuntimeError("Could not load any ArrayFire libraries.\n" + more_info_str)
540554

541555
def get_id(self, name):
542556
return self.__backend_name_map[name]

0 commit comments

Comments
 (0)