init
This commit is contained in:
21
mat_cal.py
Normal file
21
mat_cal.py
Normal file
@@ -0,0 +1,21 @@
|
||||
from multiprocessing import Process
|
||||
import numpy as np
|
||||
import os
|
||||
|
||||
def burn():
|
||||
a = np.random.rand(2000, 2000)
|
||||
b = np.random.rand(2000, 2000)
|
||||
|
||||
while True:
|
||||
# 浮点 + SIMD + 内存访问
|
||||
np.dot(a, b)
|
||||
|
||||
if __name__ == "__main__":
|
||||
procs = []
|
||||
for _ in range(os.cpu_count()):
|
||||
p = Process(target=burn)
|
||||
p.start()
|
||||
procs.append(p)
|
||||
|
||||
for p in procs:
|
||||
p.join()
|
||||
Reference in New Issue
Block a user