Skip to content

Commit

Permalink
added default args, tested as python lib
Browse files Browse the repository at this point in the history
  • Loading branch information
dkohlbre committed Nov 26, 2014
1 parent 7aac3df commit 4b54a85
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,17 @@ Example Usage

./qtt.py -c pow -i math.h -l /usr/lib/x86_64-linux-gnu/libm.so "double (double,double)" '(1,2),(5,4)'

Or, from python:

from qtt import QTT

timer = QTT()

timer.add_c_test(cfunction="atof",typestring="double (const char*)",arglist=[("343"),("46445.34324")])

timer.gcc_build()


What?
======
Time your (or standard) C functions!
Expand All @@ -23,6 +34,4 @@ It doesn't have install yet, run it from the checkout directory.

It should work on all x86_64 systems.

Support for using QTT as a library should be ready soon.

./qtt.py --help is pretty helpful
4 changes: 2 additions & 2 deletions qtt.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def c_snippet(self,cfunction,typestring,arglist,testnum):
return (testruns_s,functext)


def add_c_test(self,tmpfile,cfunction,includefiles,typestring,arglist,libfiles):
def add_c_test(self,cfunction,typestring,arglist,libfiles="",includefiles="",tmpfile="/tmp/qtt_tmp.c"):

self.all_add_gcc_files.append(libfiles)
self.temp_file = tmpfile
Expand Down Expand Up @@ -243,7 +243,7 @@ def qtt_getargs():
arglist = eval('['+args.arglist+']')
except:
print_info("FATAL: Cannot parse arglist argument as python tuples!")
timer.add_c_test(args.tmpfile,args.cfunction,args.includefiles,args.typestring,arglist,args.libfile)
timer.add_c_test(tmpfile=args.tmpfile,cfunction=args.cfunction,includefiles=args.includefiles,typestring=args.typestring,arglist=arglist,libfiles=args.libfile)
r = timer.gcc_build()
elif args.asmcode != None:
r = timer.asm_snippet(args)
Expand Down

0 comments on commit 4b54a85

Please sign in to comment.