# timing is stored by node, we compute timing by Op on demand
# timing is stored by node, we compute timing by Op on demand
rval={}
rval={}
returnrval#TODO: continue here
returnrval# TODO: continue here
fornode,countinself.apply_callcount.items():
fornode,countinself.apply_callcount.items():
rval.setdefault(node.op,0)
rval.setdefault(node.op,0)
rval[node.op]+=1
rval[node.op]+=1
returnrval
returnrval
fora,tinop_time.items():
fora,tinself.op_time.items():
ifhasattr(a,'flops'):
ifhasattr(a,'flops'):
op_flops[a]=a.flops*op_call[a]/t/1e6
op_flops[a]=a.flops*op_call[a]/t/1e6
flops_msg=''
flops_msg=''
ifop_flops:
ifop_flops:
flops_msg=' <MFlops/s>'
flops_msg=' <MFlops/s>'
print'\nHACK WARNING: we print the flops for some OP, but the logic don\' always work. You need to know the internal of Theano to make it work correctly. Otherwise don\'t use!'
print('\nHACK WARNING: we print the flops for some OP, but the'
print'\nOp-wise summary: <%% of local_time spent on this kind of Op> <cumulative %%> <self seconds> <cumulative seconds> <time per call> %s <nb_call> <nb apply> <Op name>'%(flops_msg)
' logic don\' always work. You need to know the internal'
print' Theano Op time (included in fct call, Time spent running thunks) %.3fs %.1f%%(of total) %.1f%%(of fct call)'%(local_time,local_time/total_time*100,time_pr_in_fct)
# this is the param the -ffast-math activate. I put the explicitly as FillMissing must disable some of them. Putting -ffast-math would make it disable all other parameter at the same time.
# this is the param the -ffast-math activate. I put the explicitly as
# FillMissing must disable some of them. Putting -ffast-math would
# make it disable all other parameter at the same time.
ret+=["-fno-math-errno",
ret+=["-fno-math-errno",
#"-funsafe-math-optimizations",
#"-funsafe-math-optimizations",
#"-fno-signaling-nans",
#"-fno-signaling-nans",
#"-fcx-limited-range",
#"-fcx-limited-range",
#"-fno-rounding-math",
#"-fno-rounding-math",
#"-ffinite-math-only",
#"-ffinite-math-only",
"-Wno-unused-label",#the current code generate label event if they are not used. Could use gcc attribute for those label only
"-Wno-unused-variable",#idem as the precedent
#the current code generate label event if they are not used.
"-Wno-write-strings",#generated by our code generator...
#Could use gcc attribute for those label only
"-Wno-unused-label",
"-Wno-unused-variable",# idem as the precedent
"-Wno-write-strings",# generated by our code generator...