提交 da2298c2 authored 作者: Razvan Pascanu's avatar Razvan Pascanu

merge no conflicts

...@@ -409,7 +409,7 @@ class ProfileMode(Mode): ...@@ -409,7 +409,7 @@ class ProfileMode(Mode):
else: else:
msg = ' ' msg = ' '
print ' %4.1f%% %5.1f%% %5.3fs %5.3fs %.2es %s %5d %2d %2d %s' % (f, ftot, t, tot, t/nb_call, msg, nb_call, nb_op, nb_apply, a) print ' %4.1f%% %5.1f%% %5.3fs %5.3fs %.2es %s %5d %2d %2d %s' % (f, ftot, t, tot, t/nb_call, msg, nb_call, nb_op, nb_apply, a)
print ' ... (remaining %i Ops account for %.2f%%(%.2fs) of the runtime)'\ print ' ... (remaining %i single Op account for %.2f%%(%.2fs) of the runtime)'\
%(max(0, len(sotimes)-n_ops_to_print), %(max(0, len(sotimes)-n_ops_to_print),
sum(f for f, t, a, ci, nb_call, nb_op in sotimes[n_ops_to_print:]), sum(f for f, t, a, ci, nb_call, nb_op in sotimes[n_ops_to_print:]),
sum(t for f, t, a, ci, nb_call, nb_op in sotimes[n_ops_to_print:])) sum(t for f, t, a, ci, nb_call, nb_op in sotimes[n_ops_to_print:]))
...@@ -449,7 +449,7 @@ class ProfileMode(Mode): ...@@ -449,7 +449,7 @@ class ProfileMode(Mode):
print ' %4.1f%% %5.1f%% %5.3fs %5.3fs %.2es %s %7.1f %5d %2d %s' % (f, ftot, t, tot, t/nb_call, msg, op_flops.get(a,-1), nb_call, nb_apply, a) print ' %4.1f%% %5.1f%% %5.3fs %5.3fs %.2es %s %7.1f %5d %2d %s' % (f, ftot, t, tot, t/nb_call, msg, op_flops.get(a,-1), nb_call, nb_apply, a)
else: else:
print ' %4.1f%% %5.1f%% %5.3fs %5.3fs %.2es %s %5d %2d %s' % (f, ftot, t, tot, t/nb_call, msg, nb_call, nb_apply, a) print ' %4.1f%% %5.1f%% %5.3fs %5.3fs %.2es %s %5d %2d %s' % (f, ftot, t, tot, t/nb_call, msg, nb_call, nb_apply, a)
print ' ... (remaining %i Apply account for %6.2f%%(%.2fs) of the runtime)'\ print ' ... (remaining %i Op account for %6.2f%%(%.2fs) of the runtime)'\
%(max(0, len(otimes)-n_ops_to_print), %(max(0, len(otimes)-n_ops_to_print),
sum(f for f, t, a, ci, nb_call, nb_op in otimes[n_ops_to_print:]), sum(f for f, t, a, ci, nb_call, nb_op in otimes[n_ops_to_print:]),
sum(t for f, t, a, ci, nb_call, nb_op in otimes[n_ops_to_print:])) sum(t for f, t, a, ci, nb_call, nb_op in otimes[n_ops_to_print:]))
......
...@@ -275,7 +275,7 @@ class ProfileStats(object): ...@@ -275,7 +275,7 @@ class ProfileStats(object):
' (did you forget to enable counters?)') ' (did you forget to enable counters?)')
return return
print >> file, 'Thunks' print >> file, 'Apply'
print >> file, '------' print >> file, '------'
#print >> file, '<% time> <cumulative %%> <apply time> <cumulative seconds> <time per call> <nb_call> <Apply Op name>' #print >> file, '<% time> <cumulative %%> <apply time> <cumulative seconds> <time per call> <nb_call> <Apply Op name>'
# headers # headers
......
...@@ -1041,7 +1041,8 @@ class ModuleCache(object): ...@@ -1041,7 +1041,8 @@ class ModuleCache(object):
cached modules regardless of their age. cached modules regardless of their age.
:param clear_base_files: If True, then delete base directories :param clear_base_files: If True, then delete base directories
'cuda_ndarray', 'cutils_ext' and 'lazylinker_ext' if they are present. 'cuda_ndarray', 'cutils_ext', 'lazylinker_ext' and 'scan_perform'
if they are present.
If False, those directories are left intact. If False, those directories are left intact.
:param delete_if_problem: See help of refresh() method. :param delete_if_problem: See help of refresh() method.
...@@ -1059,7 +1060,7 @@ class ModuleCache(object): ...@@ -1059,7 +1060,7 @@ class ModuleCache(object):
def clear_base_files(self): def clear_base_files(self):
""" """
Remove base directories 'cuda_ndarray', 'cutils_ext' and 'lazylinker_ext' if present. Remove base directories 'cuda_ndarray', 'cutils_ext', 'lazylinker_ext' and 'scan_perform' if present.
Note that we do not delete them outright because it may not work on Note that we do not delete them outright because it may not work on
some systems due to these modules being currently in use. Instead we some systems due to these modules being currently in use. Instead we
...@@ -1068,7 +1069,7 @@ class ModuleCache(object): ...@@ -1068,7 +1069,7 @@ class ModuleCache(object):
""" """
compilelock.get_lock() compilelock.get_lock()
try: try:
for base_dir in ('cuda_ndarray', 'cutils_ext', 'lazylinker_ext'): for base_dir in ('cuda_ndarray', 'cutils_ext', 'lazylinker_ext', 'scan_perform'):
to_delete = os.path.join(self.dirname, base_dir + '.delete.me') to_delete = os.path.join(self.dirname, base_dir + '.delete.me')
if os.path.isdir(to_delete): if os.path.isdir(to_delete):
try: try:
......
...@@ -2143,18 +2143,23 @@ def switch(cond, ift, iff): ...@@ -2143,18 +2143,23 @@ def switch(cond, ift, iff):
@_scal_elemwise_with_nfunc('bitwise_and', 2, 1) @_scal_elemwise_with_nfunc('bitwise_and', 2, 1)
def and_(a,b): def and_(a,b):
"""bitwise a & b""" """bitwise a & b"""
bitwise_and = and_ # numpy name for it
@_scal_elemwise_with_nfunc('bitwise_or', 2, 1) @_scal_elemwise_with_nfunc('bitwise_or', 2, 1)
def or_(a,b): def or_(a,b):
"""bitwise a | b""" """bitwise a | b"""
bitwise_or = or_ # numpy name for it
@_scal_elemwise_with_nfunc('bitwise_xor', 2, 1) @_scal_elemwise_with_nfunc('bitwise_xor', 2, 1)
def xor(a,b): def xor(a,b):
"""bitwise a ^ b""" """bitwise a ^ b"""
bitwise_xor = xor # numpy name for it
@_scal_elemwise_with_nfunc('invert', 1, 1) @_scal_elemwise_with_nfunc('invert', 1, 1)
def invert(a): def invert(a):
"""bitwise ~a""" """bitwise ~a"""
bitwise_not = invert # numpy alias for it
########################## ##########################
# Math # Math
...@@ -3152,14 +3157,13 @@ class Subtensor(Op): ...@@ -3152,14 +3157,13 @@ class Subtensor(Op):
if not isinstance(node.inputs[0].type, TensorType): if not isinstance(node.inputs[0].type, TensorType):
raise NotImplementedError() raise NotImplementedError()
# #
# two arrays are created: # two arrays are created in C code:
# is_slice: len == ndim, 0 means int, 1 means slice # is_slice: len == ndim, 0 means int, 1 means slice
# subtensor_spec: len = n_ints + 3 * n_slices # subtensor_spec: len = n_ints + 3 * n_slices
# #
fail = sub['fail'] fail = sub['fail']
init_cmds = [] init_cmds = [] # initialization for subtensor_spec
is_slice = [] is_slice = []
inplace = 1
NONE_CODE = sys.maxint - 1 NONE_CODE = sys.maxint - 1
pos = [0,1] #annoying version of global variable for init_entry pos = [0,1] #annoying version of global variable for init_entry
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论