Skip to content

Commit

Permalink
Removed the old Bohrium target system
Browse files Browse the repository at this point in the history
  • Loading branch information
madsbk committed Dec 12, 2017
1 parent 4e55b3b commit 90629db
Showing 1 changed file with 3 additions and 23 deletions.
26 changes: 3 additions & 23 deletions benchpress/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

# Check whether the numpy module is overruled by Bohrium
bh_is_loaded_as_np = np.__name__ == "bohrium"
bh_target = np.target.TARGET if bh_is_loaded_as_np else "none"

#In order to support runs without bohrium installed, we need some import hacks
try:
Expand Down Expand Up @@ -177,21 +176,11 @@ def __init__(self):
help = "Output file to store results in."
)

g2 = p.add_mutually_exclusive_group()
g2.add_argument('--target',
choices = ['None', 'numpy', 'bhc',
'numexpr', 'pygpu', 'chapel'],
default = "None",
help = "Enable npbackend using the specified target."
" Disable npbackend using None."
" (default: %(default)s)"
)
g2.add_argument('--bohrium',
p.add_argument('--bohrium',
choices = [True, False],
default = False,
type = t_or_f,
help = "Same as --target=bhc which means:"
" enable npbackend using Bohrium."
help = "Enable npbackend using Bohrium."
" (default: %(default)s)"
)
p.add_argument('--no-extmethods',
Expand Down Expand Up @@ -252,14 +241,10 @@ def __init__(self):
"""
)

# Unify the options: 'target' and 'bohrium'
# TODO: This should check the environment for target.
if bh_is_loaded_as_np:
self.bohrium = True
self.target = bh_target
else:
self.bohrium = False
self.target = "none"

self.no_extmethods = args.no_extmethods

Expand All @@ -272,14 +257,10 @@ def __init__(self):
#self.args = args

def start(self):
if self.bohrium:
bh.target.tally()
flush()
self.__elapsed = time.time()

def stop(self):
if self.bohrium:
bh.target.tally()
flush()
self.__elapsed = time.time() - self.__elapsed

Expand Down Expand Up @@ -344,9 +325,8 @@ def load_array(self, filename=None, label='input', dtype=None):
return self.load_arrays(filename, dtype)[label]

def pprint(self):
print("%s - target: %s, bohrium: %s, size: %s, elapsed-time: %f" % (
print("%s - bohrium: %s, size: %s, elapsed-time: %f" % (
self.__script,
self.target,
self.bohrium,
'*'.join([str(s) for s in self.size]),
self.__elapsed
Expand Down

0 comments on commit 90629db

Please sign in to comment.