From 69f2911e04ffb1b19eef1fafb8c040af271f656e Mon Sep 17 00:00:00 2001 From: Tor Aamodt Date: Thu, 15 Jul 2010 18:09:46 -0800 Subject: creating branch for adding support for CUDA 3.x and Fermi [git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 6829] --- .../CUDA/CP/common/python/textfilecompare.py | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 benchmarks/CUDA/CP/common/python/textfilecompare.py (limited to 'benchmarks/CUDA/CP/common/python/textfilecompare.py') diff --git a/benchmarks/CUDA/CP/common/python/textfilecompare.py b/benchmarks/CUDA/CP/common/python/textfilecompare.py new file mode 100644 index 0000000..2f6ef68 --- /dev/null +++ b/benchmarks/CUDA/CP/common/python/textfilecompare.py @@ -0,0 +1,27 @@ +# (c) Copyright 2007 The Board of Trustees of the University of Illinois. + +from binaryfilecompare import eof, many + +# Rename the builtin 'float' variable to avoid name conflicts +builtin_float = float + +def verbatim(f): + """Read a line of text from file 'f'.""" + line = f.readline() + return line + +def float(f): + """Read a line of text from file 'f' as a single floating-point + number.""" + words = f.readline().split() + if len(words) != 1: + raise ValueError, "Expecting line to contain a single number" + return builtin_float(words[0]) + +def floats(f): + """Read a line of text from file 'f' as a list of floating-point + numbers.""" + words = f.readline().split() + return [builtin_float(x) for x in words] + + -- cgit v1.3