make OpenCL work elsewhere
MODIFY
tinygrad/tensor.py
tinygrad/tensor.py
@@ -12,7 +12,11 @@ cl_ctx, cl_queue = None, None
def require_init_gpu():
global cl_ctx, cl_queue
if cl_queue is None:
- cl_ctx = cl.create_some_context(answers=[0,2]) # change if you don't have mac
+ 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])
cl_queue = cl.CommandQueue(cl_ctx)
# **** start with two base classes ****

make OpenCL work elsewhere