fix GPU profiling

This commit is contained in:
George Hotz
2020-12-07 20:03:28 -08:00
parent b2eca6d45f
commit 3aac9aefce
2 changed files with 3 additions and 0 deletions

View File

@@ -1,2 +1,3 @@
*.hwx
anecompiler.swap.*
context_switch_log.txt

View File

@@ -23,6 +23,8 @@ class ProfileOp:
if DEBUG: self.st = time.time()
def __exit__(self, *junk):
if DEBUG:
if cl_queue is not None:
cl_queue.finish()
et = (time.time()-self.st)*1000.
debug_counts[self.name] += 1
debug_times[self.name] += et