Remove import from debug from openclpow, remove shebang, format
This commit is contained in:
parent
e77238fa07
commit
81645eadef
|
@ -1,16 +1,24 @@
|
||||||
#!/usr/bin/env python2.7
|
|
||||||
"""
|
"""
|
||||||
Module for Proof of Work using OpenCL
|
Module for Proof of Work using OpenCL
|
||||||
"""
|
"""
|
||||||
|
import logging
|
||||||
import os
|
import os
|
||||||
from struct import pack
|
from struct import pack
|
||||||
|
|
||||||
import paths
|
import paths
|
||||||
from bmconfigparser import BMConfigParser
|
from bmconfigparser import BMConfigParser
|
||||||
from debug import logger
|
|
||||||
from state import shutdown
|
from state import shutdown
|
||||||
|
|
||||||
libAvailable = True
|
try:
|
||||||
|
import numpy
|
||||||
|
import pyopencl as cl
|
||||||
|
libAvailable = True
|
||||||
|
except ImportError:
|
||||||
|
libAvailable = False
|
||||||
|
|
||||||
|
|
||||||
|
logger = logging.getLogger('default')
|
||||||
|
|
||||||
ctx = False
|
ctx = False
|
||||||
queue = False
|
queue = False
|
||||||
program = False
|
program = False
|
||||||
|
@ -19,17 +27,10 @@ enabledGpus = []
|
||||||
vendors = []
|
vendors = []
|
||||||
hash_dt = None
|
hash_dt = None
|
||||||
|
|
||||||
try:
|
|
||||||
import pyopencl as cl
|
|
||||||
import numpy
|
|
||||||
except ImportError:
|
|
||||||
libAvailable = False
|
|
||||||
|
|
||||||
|
|
||||||
def initCL():
|
def initCL():
|
||||||
"""Initlialise OpenCL engine"""
|
"""Initlialise OpenCL engine"""
|
||||||
# pylint: disable=global-statement
|
global ctx, queue, program, hash_dt # pylint: disable=global-statement
|
||||||
global ctx, queue, program, hash_dt, libAvailable
|
|
||||||
if libAvailable is False:
|
if libAvailable is False:
|
||||||
return
|
return
|
||||||
del enabledGpus[:]
|
del enabledGpus[:]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user