summaryrefslogtreecommitdiff
path: root/benchmarks/CUDA/CP/driver/futures.py
diff options
context:
space:
mode:
authorTor Aamodt <[email protected]>2010-07-15 18:09:46 -0800
committerTor Aamodt <[email protected]>2010-07-15 18:09:46 -0800
commit69f2911e04ffb1b19eef1fafb8c040af271f656e (patch)
tree231d3b6bdc3a202f7c255bfcf7bf2c36e32cee9e /benchmarks/CUDA/CP/driver/futures.py
creating branch for adding support for CUDA 3.x and Fermi
[git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 6829]
Diffstat (limited to 'benchmarks/CUDA/CP/driver/futures.py')
-rw-r--r--benchmarks/CUDA/CP/driver/futures.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/benchmarks/CUDA/CP/driver/futures.py b/benchmarks/CUDA/CP/driver/futures.py
new file mode 100644
index 0000000..2e0b94b
--- /dev/null
+++ b/benchmarks/CUDA/CP/driver/futures.py
@@ -0,0 +1,14 @@
+# (c) 2007 The Board of Trustees of the University of Illinois.
+
+class Future:
+ def __init__(self, thunk):
+ self.evaluated = 0
+ self.value = thunk
+
+ def get(self):
+ if self.evaluated:
+ return self.value
+ else:
+ self.value = self.value()
+ self.evaluated = 1
+ return self.value