add klo bench

This commit is contained in:
Dun Liang 2022-12-02 22:37:48 +08:00
parent a76c664c65
commit 87489d719e
2 changed files with 15 additions and 1 deletions

View File

@ -9,7 +9,7 @@
# file 'LICENSE.txt', which is part of this source code package.
# ***************************************************************
__version__ = '1.3.5.40'
__version__ = '1.3.5.41'
from jittor_utils import lock
with lock.lock_scope():
ori_int = int

View File

@ -0,0 +1,14 @@
import jittor as jt
jt.flags.use_device = 1
n = 100000
with jt.profile_scope(10, 10) as rep:
jt.code([2], "float32", [],
cuda_header='''__global__ void kernel(float* a) {}''',
cuda_src=f'''
for (int i=0; i<{n}; i++) kernel<<<1,32>>>(out0_p);
''').sync()
avg_ns = float(rep[1][4]) / n
print("kernel launch overhead(ns):", avg_ns)