GPU Selection works when len(answers)>ngpus
Fixes TypeError: sequence item 0: expected str instance, int found
triggered by
in pyopencl v2020.2.2
@@ -15,8 +15,8 @@ def require_init_gpu():
try:
# for Macbook 16 inch
cl_ctx = cl.create_some_context(answers=[0,2])
- except cl._cl.RuntimeError:
- cl_ctx = cl.create_some_context(answers=[0,0])
+ except (cl._cl.RuntimeError, TypeError):
+ cl_ctx = cl.create_some_context(interactive=False)
cl_queue = cl.CommandQueue(cl_ctx)
# **** start with two base classes ****
