OpenCL PoW fix

- previous commit created some problems, now it should work
This commit is contained in:
Peter Šurda 2017-02-28 23:52:27 +01:00
parent 8d829b587e
commit 9263f53d86
Signed by untrusted user: PeterSurda
GPG Key ID: 0C5F50C0B5F37D87

View File

@ -26,12 +26,11 @@ except:
libAvailable = False
def initCL():
global ctx, queue, program, enabledGpus, hash_dt, vendors
gpus = []
global ctx, queue, program, hash_dt
del enabledGpus[:]
del vendors[:]
del gpus[:]
ctx = False
enabledGpus = []
vendors = []
hash_dt = None
try:
hash_dt = numpy.dtype([('target', numpy.uint64), ('v', numpy.str_, 73)])
try:
@ -52,10 +51,10 @@ def initCL():
logger.info("Loaded OpenCL kernel")
else:
logger.info("No OpenCL GPUs found")
enabledGpus = []
del enabledGpus[:]
except Exception as e:
logger.error("OpenCL fail: ", exc_info=True)
enabledGpus = []
del enabledGpus[:]
def openclAvailable():
return (len(gpus) > 0)