-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
implemented async- and threaded- block partition, still not better th…
…an simpler model
- Loading branch information
1 parent
a117d56
commit b573e3c
Showing
3 changed files
with
59 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
def gflops(n: int, time: int) -> float: | ||
return (2*n**3/(time*1e-9))/(1e9) # 2n^3 flops / time (in ns) in GFLOPS | ||
|
||
|
||
if __name__ == '__main__': | ||
n = 2048 | ||
bench: dict = { | ||
'iterative': 634_936_604, | ||
'blocked': 19_087_074_146, | ||
'threaded_blocked': 11_113_214_750, | ||
'async_blocked': 10_820_800_292, | ||
} | ||
print(f'GFLOPS for {n}x{n} matrix multiplication') | ||
for name, time in bench.items(): | ||
print(f'{name}: {gflops(n, time):.6f} GFLOPS') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters