snapshot before regression test
This commit is contained in:
502
Test/SimdTest/App/main.py
Normal file
502
Test/SimdTest/App/main.py
Normal file
@@ -0,0 +1,502 @@
|
||||
from stdint import *
|
||||
import vipersimd
|
||||
import numpy
|
||||
from stdio import printf
|
||||
import stdlib
|
||||
from stdlib import calloc
|
||||
import t, c
|
||||
import memhub
|
||||
import testcheck
|
||||
|
||||
|
||||
# 全局内存池
|
||||
arena: t.CUInt8T | t.CPtr = None
|
||||
pool: memhub.MemPool | t.CPtr = None
|
||||
|
||||
# 外部函数: clock() 用于性能计时
|
||||
def clock() -> t.CLong | t.CExtern: pass
|
||||
|
||||
CLOCK_PER_SEC: t.CDefine = 1000
|
||||
|
||||
|
||||
# ============================================================
|
||||
# 1. AVX2 double4 正确性测试
|
||||
# ============================================================
|
||||
|
||||
def test_avx2_add_sub_mul_div():
|
||||
testcheck.section("AVX2 add/sub/mul/div 4d")
|
||||
a: numpy.ndarray | t.CPtr = numpy.zeros(pool, 4)
|
||||
a.data[0] = t.CDouble(1.0)
|
||||
a.data[1] = t.CDouble(2.0)
|
||||
a.data[2] = t.CDouble(3.0)
|
||||
a.data[3] = t.CDouble(4.0)
|
||||
|
||||
b: numpy.ndarray | t.CPtr = numpy.zeros(pool, 4)
|
||||
b.data[0] = t.CDouble(5.0)
|
||||
b.data[1] = t.CDouble(6.0)
|
||||
b.data[2] = t.CDouble(7.0)
|
||||
b.data[3] = t.CDouble(8.0)
|
||||
|
||||
out: numpy.ndarray | t.CPtr = numpy.zeros(pool, 4)
|
||||
|
||||
# add
|
||||
vipersimd.simd_add4d(a.data, b.data, out.data)
|
||||
testcheck.check(out.data[0] == t.CDouble(6.0), "add[0]==6", "add[0]==6")
|
||||
testcheck.check(out.data[1] == t.CDouble(8.0), "add[1]==8", "add[1]==8")
|
||||
testcheck.check(out.data[2] == t.CDouble(10.0), "add[2]==10", "add[2]==10")
|
||||
testcheck.check(out.data[3] == t.CDouble(12.0), "add[3]==12", "add[3]==12")
|
||||
|
||||
# sub
|
||||
vipersimd.simd_sub4d(a.data, b.data, out.data)
|
||||
testcheck.check(out.data[0] == t.CDouble(-4.0), "sub[0]==-4", "sub[0]==-4")
|
||||
testcheck.check(out.data[3] == t.CDouble(-4.0), "sub[3]==-4", "sub[3]==-4")
|
||||
|
||||
# mul
|
||||
vipersimd.simd_mul4d(a.data, b.data, out.data)
|
||||
testcheck.check(out.data[0] == t.CDouble(5.0), "mul[0]==5", "mul[0]==5")
|
||||
testcheck.check(out.data[1] == t.CDouble(12.0), "mul[1]==12", "mul[1]==12")
|
||||
testcheck.check(out.data[2] == t.CDouble(21.0), "mul[2]==21", "mul[2]==21")
|
||||
testcheck.check(out.data[3] == t.CDouble(32.0), "mul[3]==32", "mul[3]==32")
|
||||
|
||||
# div
|
||||
vipersimd.simd_div4d(b.data, a.data, out.data)
|
||||
testcheck.check(out.data[0] == t.CDouble(5.0), "div[0]==5", "div[0]==5")
|
||||
testcheck.check(out.data[1] == t.CDouble(3.0), "div[1]==3", "div[1]==3")
|
||||
|
||||
a.delete()
|
||||
b.delete()
|
||||
out.delete()
|
||||
|
||||
|
||||
def test_avx2_neg_abs_sqrt():
|
||||
testcheck.section("AVX2 neg/abs/sqrt 4d")
|
||||
a: numpy.ndarray | t.CPtr = numpy.zeros(pool, 4)
|
||||
a.data[0] = t.CDouble(1.0)
|
||||
a.data[1] = t.CDouble(-4.0)
|
||||
a.data[2] = t.CDouble(9.0)
|
||||
a.data[3] = t.CDouble(-16.0)
|
||||
|
||||
out: numpy.ndarray | t.CPtr = numpy.zeros(pool, 4)
|
||||
|
||||
# neg
|
||||
vipersimd.simd_neg4d(a.data, out.data)
|
||||
testcheck.check(out.data[0] == t.CDouble(-1.0), "neg[0]==-1", "neg[0]==-1")
|
||||
testcheck.check(out.data[1] == t.CDouble(4.0), "neg[1]==4", "neg[1]==4")
|
||||
testcheck.check(out.data[2] == t.CDouble(-9.0), "neg[2]==-9", "neg[2]==-9")
|
||||
testcheck.check(out.data[3] == t.CDouble(16.0), "neg[3]==16", "neg[3]==16")
|
||||
|
||||
# abs
|
||||
vipersimd.simd_abs4d(a.data, out.data)
|
||||
testcheck.check(out.data[0] == t.CDouble(1.0), "abs[0]==1", "abs[0]==1")
|
||||
testcheck.check(out.data[1] == t.CDouble(4.0), "abs[1]==4", "abs[1]==4")
|
||||
testcheck.check(out.data[2] == t.CDouble(9.0), "abs[2]==9", "abs[2]==9")
|
||||
testcheck.check(out.data[3] == t.CDouble(16.0), "abs[3]==16", "abs[3]==16")
|
||||
|
||||
# sqrt
|
||||
vipersimd.simd_sqrt4d(out.data, out.data)
|
||||
testcheck.check(out.data[0] == t.CDouble(1.0), "sqrt[0]==1", "sqrt[0]==1")
|
||||
testcheck.check(out.data[1] == t.CDouble(2.0), "sqrt[1]==2", "sqrt[1]==2")
|
||||
testcheck.check(out.data[2] == t.CDouble(3.0), "sqrt[2]==3", "sqrt[2]==3")
|
||||
testcheck.check(out.data[3] == t.CDouble(4.0), "sqrt[3]==4", "sqrt[3]==4")
|
||||
|
||||
a.delete()
|
||||
out.delete()
|
||||
|
||||
|
||||
def test_avx2_min_max():
|
||||
testcheck.section("AVX2 min/max 4d")
|
||||
a: numpy.ndarray | t.CPtr = numpy.zeros(pool, 4)
|
||||
a.data[0] = t.CDouble(1.0)
|
||||
a.data[1] = t.CDouble(8.0)
|
||||
a.data[2] = t.CDouble(3.0)
|
||||
a.data[3] = t.CDouble(6.0)
|
||||
|
||||
b: numpy.ndarray | t.CPtr = numpy.zeros(pool, 4)
|
||||
b.data[0] = t.CDouble(5.0)
|
||||
b.data[1] = t.CDouble(2.0)
|
||||
b.data[2] = t.CDouble(7.0)
|
||||
b.data[3] = t.CDouble(4.0)
|
||||
|
||||
out: numpy.ndarray | t.CPtr = numpy.zeros(pool, 4)
|
||||
|
||||
vipersimd.simd_min4d(a.data, b.data, out.data)
|
||||
testcheck.check(out.data[0] == t.CDouble(1.0), "min[0]==1", "min[0]==1")
|
||||
testcheck.check(out.data[1] == t.CDouble(2.0), "min[1]==2", "min[1]==2")
|
||||
testcheck.check(out.data[2] == t.CDouble(3.0), "min[2]==3", "min[2]==3")
|
||||
testcheck.check(out.data[3] == t.CDouble(4.0), "min[3]==4", "min[3]==4")
|
||||
|
||||
vipersimd.simd_max4d(a.data, b.data, out.data)
|
||||
testcheck.check(out.data[0] == t.CDouble(5.0), "max[0]==5", "max[0]==5")
|
||||
testcheck.check(out.data[1] == t.CDouble(8.0), "max[1]==8", "max[1]==8")
|
||||
testcheck.check(out.data[2] == t.CDouble(7.0), "max[2]==7", "max[2]==7")
|
||||
testcheck.check(out.data[3] == t.CDouble(6.0), "max[3]==6", "max[3]==6")
|
||||
|
||||
a.delete()
|
||||
b.delete()
|
||||
out.delete()
|
||||
|
||||
|
||||
def test_avx2_scalar_ops():
|
||||
testcheck.section("AVX2 scalar broadcast ops")
|
||||
a: numpy.ndarray | t.CPtr = numpy.zeros(pool, 4)
|
||||
a.data[0] = t.CDouble(1.0)
|
||||
a.data[1] = t.CDouble(2.0)
|
||||
a.data[2] = t.CDouble(3.0)
|
||||
a.data[3] = t.CDouble(4.0)
|
||||
|
||||
s: numpy.ndarray | t.CPtr = numpy.zeros(pool, 1)
|
||||
s.data[0] = t.CDouble(10.0)
|
||||
|
||||
out: numpy.ndarray | t.CPtr = numpy.zeros(pool, 4)
|
||||
|
||||
vipersimd.simd_mul_scalar4d(a.data, s.data, out.data)
|
||||
testcheck.check(out.data[0] == t.CDouble(10.0), "mul_scalar[0]==10", "mul_scalar[0]==10")
|
||||
testcheck.check(out.data[1] == t.CDouble(20.0), "mul_scalar[1]==20", "mul_scalar[1]==20")
|
||||
testcheck.check(out.data[3] == t.CDouble(40.0), "mul_scalar[3]==40", "mul_scalar[3]==40")
|
||||
|
||||
vipersimd.simd_add_scalar4d(a.data, s.data, out.data)
|
||||
testcheck.check(out.data[0] == t.CDouble(11.0), "add_scalar[0]==11", "add_scalar[0]==11")
|
||||
testcheck.check(out.data[3] == t.CDouble(14.0), "add_scalar[3]==14", "add_scalar[3]==14")
|
||||
|
||||
a.delete()
|
||||
s.delete()
|
||||
out.delete()
|
||||
|
||||
|
||||
def test_avx2_hsum_dot():
|
||||
testcheck.section("AVX2 hsum/dot 4d")
|
||||
a: numpy.ndarray | t.CPtr = numpy.zeros(pool, 4)
|
||||
a.data[0] = t.CDouble(1.0)
|
||||
a.data[1] = t.CDouble(2.0)
|
||||
a.data[2] = t.CDouble(3.0)
|
||||
a.data[3] = t.CDouble(4.0)
|
||||
|
||||
b: numpy.ndarray | t.CPtr = numpy.zeros(pool, 4)
|
||||
b.data[0] = t.CDouble(5.0)
|
||||
b.data[1] = t.CDouble(6.0)
|
||||
b.data[2] = t.CDouble(7.0)
|
||||
b.data[3] = t.CDouble(8.0)
|
||||
|
||||
out: numpy.ndarray | t.CPtr = numpy.zeros(pool, 1)
|
||||
|
||||
vipersimd.simd_hsum4d(a.data, out.data)
|
||||
testcheck.check(out.data[0] == t.CDouble(10.0), "hsum==10", "hsum==10")
|
||||
|
||||
vipersimd.simd_dot4d(a.data, b.data, out.data)
|
||||
testcheck.check(out.data[0] == t.CDouble(70.0), "dot==70", "dot==70")
|
||||
|
||||
a.delete()
|
||||
b.delete()
|
||||
out.delete()
|
||||
|
||||
|
||||
def test_avx2_fma():
|
||||
testcheck.section("AVX2 FMA 4d")
|
||||
a: numpy.ndarray | t.CPtr = numpy.zeros(pool, 4)
|
||||
a.data[0] = t.CDouble(1.0)
|
||||
a.data[1] = t.CDouble(2.0)
|
||||
a.data[2] = t.CDouble(3.0)
|
||||
a.data[3] = t.CDouble(4.0)
|
||||
|
||||
b: numpy.ndarray | t.CPtr = numpy.zeros(pool, 4)
|
||||
b.data[0] = t.CDouble(5.0)
|
||||
b.data[1] = t.CDouble(6.0)
|
||||
b.data[2] = t.CDouble(7.0)
|
||||
b.data[3] = t.CDouble(8.0)
|
||||
|
||||
c_val: numpy.ndarray | t.CPtr = numpy.ones(pool, 4)
|
||||
|
||||
out: numpy.ndarray | t.CPtr = numpy.zeros(pool, 4)
|
||||
|
||||
vipersimd.simd_fma4d(a.data, b.data, c_val.data, out.data)
|
||||
testcheck.check(out.data[0] == t.CDouble(6.0), "fma[0]==6", "fma[0]==6")
|
||||
testcheck.check(out.data[1] == t.CDouble(13.0), "fma[1]==13", "fma[1]==13")
|
||||
testcheck.check(out.data[2] == t.CDouble(22.0), "fma[2]==22", "fma[2]==22")
|
||||
testcheck.check(out.data[3] == t.CDouble(33.0), "fma[3]==33", "fma[3]==33")
|
||||
|
||||
a.delete()
|
||||
b.delete()
|
||||
c_val.delete()
|
||||
out.delete()
|
||||
|
||||
|
||||
# ============================================================
|
||||
# 2. 批量数组运算正确性测试
|
||||
# ============================================================
|
||||
|
||||
def test_batch_array_ops():
|
||||
testcheck.section("Batch array operations")
|
||||
n: t.CSizeT = 16
|
||||
a: numpy.ndarray | t.CPtr = numpy.arange(pool, t.CDouble(1.0), t.CDouble(17.0), t.CDouble(1.0))
|
||||
b: numpy.ndarray | t.CPtr = numpy.full(pool, 16, t.CDouble(2.0))
|
||||
out: numpy.ndarray | t.CPtr = numpy.zeros(pool, 16)
|
||||
|
||||
# add array
|
||||
vipersimd.simd_add_array(a.data, b.data, out.data, n)
|
||||
testcheck.check(out.data[0] == t.CDouble(3.0), "add_arr[0]==3", "add_arr[0]==3")
|
||||
testcheck.check(out.data[15] == t.CDouble(18.0), "add_arr[15]==18", "add_arr[15]==18")
|
||||
|
||||
# mul array
|
||||
vipersimd.simd_mul_array(a.data, b.data, out.data, n)
|
||||
testcheck.check(out.data[0] == t.CDouble(2.0), "mul_arr[0]==2", "mul_arr[0]==2")
|
||||
testcheck.check(out.data[3] == t.CDouble(8.0), "mul_arr[3]==8", "mul_arr[3]==8")
|
||||
|
||||
# sqrt array
|
||||
c: numpy.ndarray | t.CPtr = numpy.zeros(pool, 4)
|
||||
c.data[0] = t.CDouble(4.0)
|
||||
c.data[1] = t.CDouble(9.0)
|
||||
c.data[2] = t.CDouble(16.0)
|
||||
c.data[3] = t.CDouble(25.0)
|
||||
out4: numpy.ndarray | t.CPtr = numpy.zeros(pool, 4)
|
||||
vipersimd.simd_sqrt_array(c.data, out4.data, t.CSizeT(4))
|
||||
testcheck.check(out4.data[0] == t.CDouble(2.0), "sqrt_arr[0]==2", "sqrt_arr[0]==2")
|
||||
testcheck.check(out4.data[3] == t.CDouble(5.0), "sqrt_arr[3]==5", "sqrt_arr[3]==5")
|
||||
|
||||
# abs array
|
||||
d: numpy.ndarray | t.CPtr = numpy.zeros(pool, 4)
|
||||
d.data[0] = t.CDouble(-1.0)
|
||||
d.data[1] = t.CDouble(-2.0)
|
||||
d.data[2] = t.CDouble(3.0)
|
||||
d.data[3] = t.CDouble(-4.0)
|
||||
vipersimd.simd_abs_array(d.data, out4.data, t.CSizeT(4))
|
||||
testcheck.check(out4.data[0] == t.CDouble(1.0), "abs_arr[0]==1", "abs_arr[0]==1")
|
||||
testcheck.check(out4.data[1] == t.CDouble(2.0), "abs_arr[1]==2", "abs_arr[1]==2")
|
||||
testcheck.check(out4.data[3] == t.CDouble(4.0), "abs_arr[3]==4", "abs_arr[3]==4")
|
||||
|
||||
# dot array
|
||||
e: numpy.ndarray | t.CPtr = numpy.zeros(pool, 4)
|
||||
e.data[0] = t.CDouble(1.0)
|
||||
e.data[1] = t.CDouble(2.0)
|
||||
e.data[2] = t.CDouble(3.0)
|
||||
e.data[3] = t.CDouble(4.0)
|
||||
f: numpy.ndarray | t.CPtr = numpy.ones(pool, 4)
|
||||
out1: numpy.ndarray | t.CPtr = numpy.zeros(pool, 1)
|
||||
vipersimd.simd_dot_array(e.data, f.data, t.CSizeT(4), out1.data)
|
||||
testcheck.check(out1.data[0] == t.CDouble(10.0), "dot_arr==10", "dot_arr==10")
|
||||
|
||||
a.delete()
|
||||
b.delete()
|
||||
out.delete()
|
||||
c.delete()
|
||||
out4.delete()
|
||||
d.delete()
|
||||
e.delete()
|
||||
f.delete()
|
||||
out1.delete()
|
||||
|
||||
|
||||
# ============================================================
|
||||
# 3. LLVMIR 精确标量运算测试
|
||||
# ============================================================
|
||||
|
||||
def test_llvmir_scalar():
|
||||
testcheck.section("LLVMIR precise scalar ops")
|
||||
|
||||
# sqrt
|
||||
r: t.CDouble = vipersimd.simd_sqrt(t.CDouble(4.0))
|
||||
testcheck.check(r == t.CDouble(2.0), "sqrt(4)==2", "sqrt(4)==2")
|
||||
|
||||
# fabs
|
||||
r = vipersimd.simd_fabs(t.CDouble(-3.5))
|
||||
testcheck.check(r == t.CDouble(3.5), "fabs(-3.5)==3.5", "fabs(-3.5)==3.5")
|
||||
|
||||
# floor
|
||||
r = vipersimd.simd_floor(t.CDouble(3.7))
|
||||
testcheck.check(r == t.CDouble(3.0), "floor(3.7)==3", "floor(3.7)==3")
|
||||
|
||||
# ceil
|
||||
r = vipersimd.simd_ceil(t.CDouble(3.2))
|
||||
testcheck.check(r == t.CDouble(4.0), "ceil(3.2)==4", "ceil(3.2)==4")
|
||||
|
||||
# round
|
||||
r = vipersimd.simd_round(t.CDouble(3.5))
|
||||
testcheck.check(r == t.CDouble(4.0), "round(3.5)==4", "round(3.5)==4")
|
||||
|
||||
# trunc
|
||||
r = vipersimd.simd_trunc(t.CDouble(3.9))
|
||||
testcheck.check(r == t.CDouble(3.0), "trunc(3.9)==3", "trunc(3.9)==3")
|
||||
|
||||
# fma: 2*3+1 = 7
|
||||
r = vipersimd.simd_fma(t.CDouble(2.0), t.CDouble(3.0), t.CDouble(1.0))
|
||||
testcheck.check(r == t.CDouble(7.0), "fma(2,3,1)==7", "fma(2,3,1)==7")
|
||||
|
||||
# copysign
|
||||
r = vipersimd.simd_copysign(t.CDouble(3.0), t.CDouble(-1.0))
|
||||
testcheck.check(r == t.CDouble(-3.0), "copysign(3,-1)==-3", "copysign(3,-1)==-3")
|
||||
|
||||
# neg
|
||||
r = vipersimd.simd_neg(t.CDouble(1.5))
|
||||
testcheck.check(r == t.CDouble(-1.5), "neg(1.5)==-1.5", "neg(1.5)==-1.5")
|
||||
|
||||
# minnum
|
||||
r = vipersimd.simd_minnum(t.CDouble(2.0), t.CDouble(3.0))
|
||||
testcheck.check(r == t.CDouble(2.0), "minnum(2,3)==2", "minnum(2,3)==2")
|
||||
|
||||
# maxnum
|
||||
r = vipersimd.simd_maxnum(t.CDouble(2.0), t.CDouble(3.0))
|
||||
testcheck.check(r == t.CDouble(3.0), "maxnum(2,3)==3", "maxnum(2,3)==3")
|
||||
|
||||
# exp
|
||||
r = vipersimd.simd_exp(t.CDouble(1.0))
|
||||
testcheck.check(r > t.CDouble(2.71) and r < t.CDouble(2.72), "exp(1)~=2.718", "exp(1)~=2.718")
|
||||
|
||||
# log
|
||||
r = vipersimd.simd_log(t.CDouble(2.718281828459045))
|
||||
testcheck.check(r > t.CDouble(0.999) and r < t.CDouble(1.001), "log(e)~=1", "log(e)~=1")
|
||||
|
||||
# sin
|
||||
r = vipersimd.simd_sin(t.CDouble(0.0))
|
||||
testcheck.check(r > t.CDouble(-0.001) and r < t.CDouble(0.001), "sin(0)~=0", "sin(0)~=0")
|
||||
|
||||
# cos
|
||||
r = vipersimd.simd_cos(t.CDouble(0.0))
|
||||
testcheck.check(r > t.CDouble(0.999) and r < t.CDouble(1.001), "cos(0)~=1", "cos(0)~=1")
|
||||
|
||||
# pow
|
||||
r = vipersimd.simd_pow(t.CDouble(2.0), t.CDouble(10.0))
|
||||
testcheck.check(r == t.CDouble(1024.0), "pow(2,10)==1024", "pow(2,10)==1024")
|
||||
|
||||
|
||||
# ============================================================
|
||||
# 4. 性能基准测试: SIMD vs 标量
|
||||
# ============================================================
|
||||
|
||||
N_ELEM: t.CDefine = 40000
|
||||
N_ITER: t.CDefine = 50000
|
||||
|
||||
def scalar_add_array(a: t.CPtr, b: t.CPtr, out: t.CPtr, n: t.CSizeT):
|
||||
i: t.CSizeT = 0
|
||||
da: t.CDouble | t.CPtr = a
|
||||
db: t.CDouble | t.CPtr = b
|
||||
dout: t.CDouble | t.CPtr = out
|
||||
while i < n:
|
||||
dout[i] = da[i] + db[i]
|
||||
i += 1
|
||||
|
||||
def scalar_mul_array(a: t.CPtr, b: t.CPtr, out: t.CPtr, n: t.CSizeT):
|
||||
i: t.CSizeT = 0
|
||||
da: t.CDouble | t.CPtr = a
|
||||
db: t.CDouble | t.CPtr = b
|
||||
dout: t.CDouble | t.CPtr = out
|
||||
while i < n:
|
||||
dout[i] = da[i] * db[i]
|
||||
i += 1
|
||||
|
||||
def scalar_sqrt_array(a: t.CPtr, out: t.CPtr, n: t.CSizeT):
|
||||
i: t.CSizeT = 0
|
||||
da: t.CDouble | t.CPtr = a
|
||||
dout: t.CDouble | t.CPtr = out
|
||||
while i < n:
|
||||
dout[i] = vipersimd.simd_sqrt(da[i])
|
||||
i += 1
|
||||
|
||||
def benchmark_simd_vs_scalar():
|
||||
testcheck.section("Benchmark: SIMD vs Scalar")
|
||||
|
||||
a: numpy.ndarray | t.CPtr = numpy.full(pool, N_ELEM, t.CDouble(1.5))
|
||||
b: numpy.ndarray | t.CPtr = numpy.full(pool, N_ELEM, t.CDouble(2.5))
|
||||
out: numpy.ndarray | t.CPtr = numpy.zeros(pool, N_ELEM)
|
||||
|
||||
# --- SIMD add benchmark ---
|
||||
t0: t.CLong = clock()
|
||||
iter: t.CInt = 0
|
||||
while iter < N_ITER:
|
||||
vipersimd.simd_add_array(a.data, b.data, out.data, t.CSizeT(N_ELEM))
|
||||
iter += 1
|
||||
t1: t.CLong = clock()
|
||||
simd_add_ms: t.CLong = t1 - t0
|
||||
|
||||
# --- Scalar add benchmark ---
|
||||
t0 = clock()
|
||||
iter = 0
|
||||
while iter < N_ITER:
|
||||
scalar_add_array(a.data, b.data, out.data, t.CSizeT(N_ELEM))
|
||||
iter += 1
|
||||
t1 = clock()
|
||||
scalar_add_ms: t.CLong = t1 - t0
|
||||
|
||||
printf(" ADD: SIMD=%ldms Scalar=%ldms", simd_add_ms, scalar_add_ms)
|
||||
if scalar_add_ms > 0:
|
||||
printf(" speedup=%.1fx\n", t.CDouble(scalar_add_ms) / t.CDouble(simd_add_ms))
|
||||
else:
|
||||
printf(" speedup=N/A\n")
|
||||
|
||||
# --- SIMD mul benchmark ---
|
||||
t0 = clock()
|
||||
iter = 0
|
||||
while iter < N_ITER:
|
||||
vipersimd.simd_mul_array(a.data, b.data, out.data, t.CSizeT(N_ELEM))
|
||||
iter += 1
|
||||
t1 = clock()
|
||||
simd_mul_ms: t.CLong = t1 - t0
|
||||
|
||||
# --- Scalar mul benchmark ---
|
||||
t0 = clock()
|
||||
iter = 0
|
||||
while iter < N_ITER:
|
||||
scalar_mul_array(a.data, b.data, out.data, t.CSizeT(N_ELEM))
|
||||
iter += 1
|
||||
t1 = clock()
|
||||
scalar_mul_ms: t.CLong = t1 - t0
|
||||
|
||||
printf(" MUL: SIMD=%ldms Scalar=%ldms", simd_mul_ms, scalar_mul_ms)
|
||||
if scalar_mul_ms > 0:
|
||||
printf(" speedup=%.1fx\n", t.CDouble(scalar_mul_ms) / t.CDouble(simd_mul_ms))
|
||||
else:
|
||||
printf(" speedup=N/A\n")
|
||||
|
||||
# --- SIMD sqrt benchmark ---
|
||||
t0 = clock()
|
||||
iter = 0
|
||||
while iter < N_ITER:
|
||||
vipersimd.simd_sqrt_array(a.data, out.data, t.CSizeT(N_ELEM))
|
||||
iter += 1
|
||||
t1 = clock()
|
||||
simd_sqrt_ms: t.CLong = t1 - t0
|
||||
|
||||
# --- Scalar sqrt benchmark ---
|
||||
t0 = clock()
|
||||
iter = 0
|
||||
while iter < N_ITER:
|
||||
scalar_sqrt_array(a.data, out.data, t.CSizeT(N_ELEM))
|
||||
iter += 1
|
||||
t1 = clock()
|
||||
scalar_sqrt_ms: t.CLong = t1 - t0
|
||||
|
||||
printf(" SQRT: SIMD=%ldms Scalar=%ldms", simd_sqrt_ms, scalar_sqrt_ms)
|
||||
if scalar_sqrt_ms > 0:
|
||||
printf(" speedup=%.1fx\n", t.CDouble(scalar_sqrt_ms) / t.CDouble(simd_sqrt_ms))
|
||||
else:
|
||||
printf(" speedup=N/A\n")
|
||||
|
||||
# 验证结果正确性
|
||||
testcheck.check(out.data[0] > t.CDouble(0.0), "bench result[0] valid", "bench result[0] valid")
|
||||
|
||||
a.delete()
|
||||
b.delete()
|
||||
out.delete()
|
||||
|
||||
|
||||
# ============================================================
|
||||
# Main
|
||||
# ============================================================
|
||||
|
||||
def main() -> t.CInt:
|
||||
global arena, pool
|
||||
|
||||
arena = calloc(4096 * 1024, 1) # 4MB arena
|
||||
pool = memhub.MemPool(arena, 4096 * 1024) # bump allocator
|
||||
|
||||
testcheck.begin("ViperSIMD Test Suite")
|
||||
|
||||
test_avx2_add_sub_mul_div()
|
||||
test_avx2_neg_abs_sqrt()
|
||||
test_avx2_min_max()
|
||||
test_avx2_scalar_ops()
|
||||
test_avx2_hsum_dot()
|
||||
test_avx2_fma()
|
||||
test_batch_array_ops()
|
||||
test_llvmir_scalar()
|
||||
benchmark_simd_vs_scalar()
|
||||
|
||||
return testcheck.end()
|
||||
1
Test/SimdTest/output/2fcb6780db4d937f.deps.json
Normal file
1
Test/SimdTest/output/2fcb6780db4d937f.deps.json
Normal file
@@ -0,0 +1 @@
|
||||
{"atom": "271ea3decb810db2", "vipermath": "3f7c5e78d8652535", "stdio": "6f62fe05c5ea1ceb", "w32.win32base": "7e529fe7a078cfef", "win32base": "7e529fe7a078cfef", "stdlib": "90c53dd6db8d41cf", "string": "ab6e54ba9a669f76", "w32.win32console": "bbdf3bbd4c3bc28c", "win32console": "bbdf3bbd4c3bc28c", "vipersimd": "c24f25b14b4bbd0a", "numpy.__init__": "c3a6aed1f1fb8b1e", "__init__": "c3a6aed1f1fb8b1e", "numpy": "c3a6aed1f1fb8b1e", "viperio": "c9f4be41ca1cc2b4", "testcheck": "dd3002730623424b", "memhub": "ee084e9fc6ee413a", "stdint": "f5522571bcce7bcb"}
|
||||
29
Test/SimdTest/project.json
Normal file
29
Test/SimdTest/project.json
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"$schema": "https://raw.githubusercontent.com/TermiNexus/TransPyC/main/schemas/project-schema.json",
|
||||
"name": "SimdTest",
|
||||
"version": "1.0.0",
|
||||
"source_dir": "./App",
|
||||
"temp_dir": "./temp",
|
||||
"output_dir": "./output",
|
||||
"compiler": {
|
||||
"cmd": "llc",
|
||||
"flags": ["-filetype=obj"]
|
||||
},
|
||||
"linker": {
|
||||
"cmd": "clang++",
|
||||
"flags": ["-Wl,--allow-multiple-definition", "-Wl,--unresolved-symbols=ignore-in-object-files", "-lmsvcrt", "-lucrt", "-lpthread", "-lmingwex", "-lkernel32", "-luser32", "-latomic"],
|
||||
"output": "SimdTest.exe"
|
||||
},
|
||||
"includes": [
|
||||
"../../includes"
|
||||
],
|
||||
"target": {
|
||||
"triple": "x86_64-pc-windows-gnu",
|
||||
"datalayout": "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
|
||||
},
|
||||
"options": {
|
||||
"slice_level": 3,
|
||||
"target": "llvm",
|
||||
"strict_mode": true
|
||||
}
|
||||
}
|
||||
26
Test/SimdTest/temp/271ea3decb810db2.pyi
Normal file
26
Test/SimdTest/temp/271ea3decb810db2.pyi
Normal file
@@ -0,0 +1,26 @@
|
||||
"""
|
||||
Auto-generated Python stub file from atom.py
|
||||
Module: atom
|
||||
"""
|
||||
|
||||
|
||||
import t, c
|
||||
|
||||
ATOMIC_RELAXED: t.CDefine = 0
|
||||
ATOMIC_CONSUME: t.CDefine = 1
|
||||
ATOMIC_ACQUIRE: t.CDefine = 2
|
||||
ATOMIC_RELEASE: t.CDefine = 3
|
||||
ATOMIC_ACQ_REL: t.CDefine = 4
|
||||
ATOMIC_SEQ_CST: t.CDefine = 5
|
||||
|
||||
def __atomic_test_and_set(ptr: t.CUInt64T | t.CPtr, order: t.CInt) -> t.CBool: pass
|
||||
|
||||
def __atomic_clear(ptr: t.CUInt64T | t.CPtr, order: t.CInt) -> t.CVoid: pass
|
||||
|
||||
def __atomic_thread_fence(order: t.CInt) -> t.CVoid: pass
|
||||
|
||||
def __atomic_signal_fence(order: t.CInt) -> t.CVoid: pass
|
||||
|
||||
def __atomic_always_lock_free(size: t.CSizeT, ptr: t.CVoid | t.CPtr) -> t.CBool: pass
|
||||
|
||||
def __atomic_is_lock_free(size: t.CSizeT, ptr: t.CVoid | t.CPtr) -> t.CBool: pass
|
||||
1
Test/SimdTest/temp/2fcb6780db4d937f.doc.json
Normal file
1
Test/SimdTest/temp/2fcb6780db4d937f.doc.json
Normal file
@@ -0,0 +1 @@
|
||||
{}
|
||||
53
Test/SimdTest/temp/2fcb6780db4d937f.pyi
Normal file
53
Test/SimdTest/temp/2fcb6780db4d937f.pyi
Normal file
@@ -0,0 +1,53 @@
|
||||
"""
|
||||
Auto-generated Python stub file from main.py
|
||||
Module: main
|
||||
"""
|
||||
|
||||
|
||||
from stdint import *
|
||||
import vipersimd
|
||||
import numpy
|
||||
from stdio import printf
|
||||
import stdlib
|
||||
from stdlib import calloc
|
||||
import t, c
|
||||
import memhub
|
||||
import testcheck
|
||||
|
||||
arena: t.CExtern | t.CUInt8T | t.CPtr
|
||||
pool: t.CExtern | memhub.MemPool | t.CPtr
|
||||
|
||||
def clock() -> t.CLong | t.CExtern: pass
|
||||
|
||||
|
||||
CLOCK_PER_SEC: t.CDefine = 1000
|
||||
|
||||
def test_avx2_add_sub_mul_div() -> t.CInt: pass
|
||||
|
||||
def test_avx2_neg_abs_sqrt() -> t.CInt: pass
|
||||
|
||||
def test_avx2_min_max() -> t.CInt: pass
|
||||
|
||||
def test_avx2_scalar_ops() -> t.CInt: pass
|
||||
|
||||
def test_avx2_hsum_dot() -> t.CInt: pass
|
||||
|
||||
def test_avx2_fma() -> t.CInt: pass
|
||||
|
||||
def test_batch_array_ops() -> t.CInt: pass
|
||||
|
||||
def test_llvmir_scalar() -> t.CInt: pass
|
||||
|
||||
|
||||
N_ELEM: t.CDefine = 40000
|
||||
N_ITER: t.CDefine = 50000
|
||||
|
||||
def scalar_add_array(a: t.CPtr, b: t.CPtr, out: t.CPtr, n: t.CSizeT) -> t.CInt: pass
|
||||
|
||||
def scalar_mul_array(a: t.CPtr, b: t.CPtr, out: t.CPtr, n: t.CSizeT) -> t.CInt: pass
|
||||
|
||||
def scalar_sqrt_array(a: t.CPtr, out: t.CPtr, n: t.CSizeT) -> t.CInt: pass
|
||||
|
||||
def benchmark_simd_vs_scalar() -> t.CInt: pass
|
||||
|
||||
def main() -> t.CInt: pass
|
||||
128
Test/SimdTest/temp/3f7c5e78d8652535.pyi
Normal file
128
Test/SimdTest/temp/3f7c5e78d8652535.pyi
Normal file
@@ -0,0 +1,128 @@
|
||||
"""
|
||||
Auto-generated Python stub file from vipermath.py
|
||||
Module: vipermath
|
||||
"""
|
||||
|
||||
|
||||
import t, c
|
||||
|
||||
U_M_PI: t.CDefine = 3.14159265358979323846
|
||||
U_M_E: t.CDefine = 2.71828182845904523536
|
||||
U_M_PI_2: t.CDefine = 1.57079632679489661923
|
||||
U_M_PI_4: t.CDefine = 0.78539816339744830962
|
||||
U_M_1_PI: t.CDefine = 0.31830988618379067154
|
||||
U_M_2_PI: t.CDefine = 0.63661977236758134308
|
||||
U_M_LN2: t.CDefine = 0.69314718055994530942
|
||||
U_M_LN10: t.CDefine = 2.30258509299404568402
|
||||
U_M_2_SQRT_PI: t.CDefine = 1.77245385090551602730
|
||||
|
||||
def radians(degrees: t.CDouble) -> t.CDouble: pass
|
||||
|
||||
def degrees(radians: t.CDouble) -> t.CDouble: pass
|
||||
|
||||
def sin(x: t.CDouble) -> t.CDouble: pass
|
||||
|
||||
def cos(x: t.CDouble) -> t.CDouble: pass
|
||||
|
||||
def tan(x: t.CDouble) -> t.CDouble: pass
|
||||
|
||||
def asin(x: t.CDouble) -> t.CDouble: pass
|
||||
|
||||
def acos(x: t.CDouble) -> t.CDouble: pass
|
||||
|
||||
def _atan_core(x: t.CDouble) -> t.CDouble: pass
|
||||
|
||||
def atan(x: t.CDouble) -> t.CDouble: pass
|
||||
|
||||
def atan2(y: t.CDouble, x: t.CDouble) -> t.CDouble: pass
|
||||
|
||||
def sinh(x: t.CDouble) -> t.CDouble: pass
|
||||
|
||||
def cosh(x: t.CDouble) -> t.CDouble: pass
|
||||
|
||||
def tanh(x: t.CDouble) -> t.CDouble: pass
|
||||
|
||||
def exp(x: t.CDouble) -> t.CDouble: pass
|
||||
|
||||
def log(x: t.CDouble) -> t.CDouble: pass
|
||||
|
||||
def sqrt(x: t.CDouble) -> t.CDouble: pass
|
||||
|
||||
def abs(x: t.CInt) -> t.CInt: pass
|
||||
|
||||
def fabs(x: t.CDouble) -> t.CDouble: pass
|
||||
|
||||
def labs(x: t.CLong) -> t.CLong: pass
|
||||
|
||||
def factorial(n: t.CInt) -> t.CDouble: pass
|
||||
|
||||
def combination(n: t.CInt, k: t.CInt) -> t.CDouble: pass
|
||||
|
||||
def permutation(n: t.CInt, k: t.CInt) -> t.CDouble: pass
|
||||
|
||||
def pow(x: t.CDouble, y: t.CDouble) -> t.CDouble: pass
|
||||
|
||||
def powf(x: t.CDouble, y: t.CDouble) -> t.CDouble: pass
|
||||
|
||||
def cbrt(x: t.CDouble) -> t.CDouble: pass
|
||||
|
||||
def hypot(x: t.CDouble, y: t.CDouble) -> t.CDouble: pass
|
||||
|
||||
def floor(x: t.CDouble) -> t.CDouble: pass
|
||||
|
||||
def ceil(x: t.CDouble) -> t.CDouble: pass
|
||||
|
||||
def round(x: t.CDouble) -> t.CDouble: pass
|
||||
|
||||
def trunc(x: t.CDouble) -> t.CDouble: pass
|
||||
|
||||
def fmod(x: t.CDouble, y: t.CDouble) -> t.CDouble: pass
|
||||
|
||||
def fmodf(x: float, y: float) -> float: pass
|
||||
|
||||
def modf(x: t.CDouble, iptr: t.CDouble | t.CPtr) -> t.CDouble: pass
|
||||
|
||||
def log10(x: t.CDouble) -> t.CDouble: pass
|
||||
|
||||
def log2(x: t.CDouble) -> t.CDouble: pass
|
||||
|
||||
def exp2(x: t.CDouble) -> t.CDouble: pass
|
||||
|
||||
def expm1(x: t.CDouble) -> t.CDouble: pass
|
||||
|
||||
def log1p(x: t.CDouble) -> t.CDouble: pass
|
||||
|
||||
def asinh(x: t.CDouble) -> t.CDouble: pass
|
||||
|
||||
def acosh(x: t.CDouble) -> t.CDouble: pass
|
||||
|
||||
def atanh(x: t.CDouble) -> t.CDouble: pass
|
||||
|
||||
def gamma(x: t.CDouble) -> t.CDouble: pass
|
||||
|
||||
def erf(x: t.CDouble) -> t.CDouble: pass
|
||||
|
||||
def erfc(x: t.CDouble) -> t.CDouble: pass
|
||||
|
||||
def sqrtf(x: t.CFloat) -> t.CFloat: pass
|
||||
|
||||
def sinf(x: t.CFloat) -> t.CFloat: pass
|
||||
|
||||
def cosf(x: t.CFloat) -> t.CFloat: pass
|
||||
|
||||
def tanf(x: t.CFloat) -> t.CFloat: pass
|
||||
|
||||
def fabsf(x: t.CFloat) -> t.CFloat: pass
|
||||
|
||||
def floorf(x: t.CFloat) -> t.CFloat: pass
|
||||
|
||||
def ceilf(x: t.CFloat) -> t.CFloat: pass
|
||||
|
||||
|
||||
class _U(t.CUnion):
|
||||
d: t.CDouble
|
||||
u: t.CUInt64T
|
||||
|
||||
def isnan(x: t.CDouble) -> t.CStatic | t.CInt: pass
|
||||
|
||||
def isinf(x: t.CDouble) -> t.CStatic | t.CInt: pass
|
||||
28
Test/SimdTest/temp/6f62fe05c5ea1ceb.pyi
Normal file
28
Test/SimdTest/temp/6f62fe05c5ea1ceb.pyi
Normal file
@@ -0,0 +1,28 @@
|
||||
"""
|
||||
Auto-generated Python stub file from stdio.py
|
||||
Module: stdio
|
||||
"""
|
||||
|
||||
|
||||
import t, c
|
||||
|
||||
def printf(fmt: t.CConst | str, *args) -> t.CInt | t.State: pass
|
||||
|
||||
def fprintf(stream: bytes, fmt: t.CConst | str, *args) -> t.CInt | t.State: pass
|
||||
|
||||
def sprintf(buf: bytes, fmt: t.CConst | str, *args) -> t.CInt | t.State: pass
|
||||
|
||||
def snprintf(buf: bytes, size: t.CSizeT, fmt: t.CConst | str, *args) -> t.CInt | t.State: pass
|
||||
|
||||
def puts(s: t.CConst | str) -> t.CInt | t.State: pass
|
||||
|
||||
def fputs(s: t.CConst | str, stream: bytes) -> t.CInt | t.State: pass
|
||||
|
||||
def fgets(buf: bytes, size: t.CInt, stream: bytes) -> bytes | t.State: pass
|
||||
|
||||
def fflush(stream: bytes) -> t.CInt | t.State: pass
|
||||
|
||||
|
||||
stdin: t.CExtern | bytes
|
||||
stdout: t.CExtern | bytes
|
||||
stderr: t.CExtern | bytes
|
||||
100
Test/SimdTest/temp/7e529fe7a078cfef.pyi
Normal file
100
Test/SimdTest/temp/7e529fe7a078cfef.pyi
Normal file
@@ -0,0 +1,100 @@
|
||||
"""
|
||||
Auto-generated Python stub file from w32.win32base.py
|
||||
Module: w32.win32base
|
||||
"""
|
||||
|
||||
import c
|
||||
|
||||
|
||||
import t
|
||||
from stdint import *
|
||||
|
||||
HANDLE: t.CTypedef = VOIDPTR
|
||||
LPCSTR: t.CTypedef = t.CConst | t.CChar | t.CPtr
|
||||
LPCWSTR: t.CTypedef = t.CConst | t.CUnsignedShort | t.CPtr
|
||||
INVALID_HANDLE_VALUE: t.CDefine = t.CVoid(-1)
|
||||
NULL: t.CDefine = 0
|
||||
TRUE: t.CDefine = 1
|
||||
FALSE: t.CDefine = 0
|
||||
INFINITE: t.CDefine = 0xFFFFFFFF
|
||||
WAIT_FAILED: t.CDefine = 0xFFFFFFFF
|
||||
WAIT_OBJECT_0: t.CDefine = 0
|
||||
WAIT_TIMEOUT: t.CDefine = 258
|
||||
WAIT_ABANDONED: t.CDefine = 0x80
|
||||
MAX_PATH: t.CDefine = 260
|
||||
ERROR_SUCCESS: t.CDefine = 0
|
||||
ERROR_FILE_NOT_FOUND: t.CDefine = 2
|
||||
ERROR_ACCESS_DENIED: t.CDefine = 5
|
||||
ERROR_INSUFFICIENT_BUFFER: t.CDefine = 122
|
||||
|
||||
class SECURITY_ATTRIBUTES:
|
||||
nLength: ULONG
|
||||
lpSecurityDescriptor: VOIDPTR
|
||||
bInheritHandle: BOOL
|
||||
class OVERLAPPED:
|
||||
Internal: ULONGLONG
|
||||
InternalHigh: ULONGLONG
|
||||
Offset: ULONG
|
||||
OffsetHigh: ULONG
|
||||
hEvent: HANDLE
|
||||
class FILETIME:
|
||||
dwLowDateTime: DWORD
|
||||
dwHighDateTime: DWORD
|
||||
class SYSTEMTIME:
|
||||
wYear: WORD
|
||||
wMonth: WORD
|
||||
wDayOfWeek: WORD
|
||||
wDay: WORD
|
||||
wHour: WORD
|
||||
wMinute: WORD
|
||||
wSecond: WORD
|
||||
wMilliseconds: WORD
|
||||
class GUID:
|
||||
Data1: DWORD
|
||||
Data2: WORD
|
||||
Data3: WORD
|
||||
Data4: BYTEPTR
|
||||
class LARGE_INTEGER:
|
||||
QuadPart: LONGLONG
|
||||
class ULARGE_INTEGER:
|
||||
QuadPart: ULONGLONG
|
||||
|
||||
def GetLastError() -> ULONG | t.State: pass
|
||||
|
||||
def SetLastError(dwErrCode: ULONG) -> t.State: pass
|
||||
|
||||
def CloseHandle(hObject: HANDLE) -> BOOL | t.State: pass
|
||||
|
||||
def GetProcAddress(hModule: HANDLE, lpProcName: LPCSTR) -> VOIDPTR | t.State: pass
|
||||
|
||||
def GetModuleHandleA(lpModuleName: LPCSTR) -> HANDLE | t.State: pass
|
||||
|
||||
def GetModuleHandleW(lpModuleName: LPCWSTR) -> HANDLE | t.State: pass
|
||||
|
||||
def LoadLibraryA(lpLibFileName: LPCSTR) -> HANDLE | t.State: pass
|
||||
|
||||
def LoadLibraryW(lpLibFileName: LPCWSTR) -> HANDLE | t.State: pass
|
||||
|
||||
def FreeLibrary(hLibModule: HANDLE) -> BOOL | t.State: pass
|
||||
|
||||
def GetSystemTime(lpSystemTime: SYSTEMTIME | t.CPtr) -> t.State: pass
|
||||
|
||||
def GetLocalTime(lpSystemTime: SYSTEMTIME | t.CPtr) -> t.State: pass
|
||||
|
||||
def FileTimeToSystemTime(lpFileTime: FILETIME | t.CPtr, lpSystemTime: SYSTEMTIME | t.CPtr) -> BOOL | t.State: pass
|
||||
|
||||
def SystemTimeToFileTime(lpSystemTime: SYSTEMTIME | t.CPtr, lpFileTime: FILETIME | t.CPtr) -> BOOL | t.State: pass
|
||||
|
||||
def QueryPerformanceCounter(lpPerformanceCount: LARGE_INTEGER | t.CPtr) -> BOOL | t.State: pass
|
||||
|
||||
def QueryPerformanceFrequency(lpFrequency: LARGE_INTEGER | t.CPtr) -> BOOL | t.State: pass
|
||||
|
||||
def Sleep(dwMilliseconds: ULONG) -> t.State: pass
|
||||
|
||||
def SleepEx(dwMilliseconds: ULONG, bAlertable: BOOL) -> ULONG | t.State: pass
|
||||
|
||||
def GetTickCount() -> ULONG | t.State: pass
|
||||
|
||||
def GetTickCount64() -> ULONGLONG | t.State: pass
|
||||
|
||||
def GetCommandLineA() -> CHARPTR | t.State: pass
|
||||
20
Test/SimdTest/temp/90c53dd6db8d41cf.pyi
Normal file
20
Test/SimdTest/temp/90c53dd6db8d41cf.pyi
Normal file
@@ -0,0 +1,20 @@
|
||||
"""
|
||||
Auto-generated Python stub file from stdlib.py
|
||||
Module: stdlib
|
||||
"""
|
||||
|
||||
import c
|
||||
|
||||
|
||||
from stdint import *
|
||||
import t
|
||||
|
||||
def malloc(size: t.CSizeT) -> t.CVoid | t.CPtr | t.State: pass
|
||||
|
||||
def calloc(nmemb: t.CSizeT, size: t.CSizeT) -> t.CVoid | t.CPtr | t.State: pass
|
||||
|
||||
def realloc(p: t.CVoid | t.CPtr, size: t.CSizeT) -> t.CVoid | t.CPtr | t.State: pass
|
||||
|
||||
def free(p: t.CVoid | t.CPtr) -> t.State: pass
|
||||
|
||||
def system(cmd: t.CConst | t.CChar | t.CPtr) -> INT | t.State: pass
|
||||
1
Test/SimdTest/temp/_phase1_manifest.json
Normal file
1
Test/SimdTest/temp/_phase1_manifest.json
Normal file
@@ -0,0 +1 @@
|
||||
{"D:\\Users\\TermiNexus\\Desktop\\TransPyC\\Test\\SimdTest\\App\\main.py": {"sha1": "2fcb6780db4d937f", "mtime": 1782828206.5357063, "size": 17078}, "D:\\Users\\TermiNexus\\Desktop\\TransPyC\\includes\\atom.py": {"sha1": "271ea3decb810db2", "mtime": 1782226548.693161, "size": 1290}, "D:\\Users\\TermiNexus\\Desktop\\TransPyC\\includes\\memhub.py": {"sha1": "ee084e9fc6ee413a", "mtime": 1784214242.4485993, "size": 17765}, "D:\\Users\\TermiNexus\\Desktop\\TransPyC\\includes\\numpy\\__init__.py": {"sha1": "c3a6aed1f1fb8b1e", "mtime": 1782949786.0890937, "size": 39111}, "D:\\Users\\TermiNexus\\Desktop\\TransPyC\\includes\\stdint.py": {"sha1": "f5522571bcce7bcb", "mtime": 1782383975.8824987, "size": 4356}, "D:\\Users\\TermiNexus\\Desktop\\TransPyC\\includes\\stdio.py": {"sha1": "6f62fe05c5ea1ceb", "mtime": 1783239556.0959673, "size": 714}, "D:\\Users\\TermiNexus\\Desktop\\TransPyC\\includes\\stdlib.py": {"sha1": "90c53dd6db8d41cf", "mtime": 1783874975.3597875, "size": 375}, "D:\\Users\\TermiNexus\\Desktop\\TransPyC\\includes\\string.py": {"sha1": "ab6e54ba9a669f76", "mtime": 1783933178.7264287, "size": 9922}, "D:\\Users\\TermiNexus\\Desktop\\TransPyC\\includes\\testcheck.py": {"sha1": "dd3002730623424b", "mtime": 1783927513.1159866, "size": 1818}, "D:\\Users\\TermiNexus\\Desktop\\TransPyC\\includes\\viperio.py": {"sha1": "c9f4be41ca1cc2b4", "mtime": 1782812279.506002, "size": 1556}, "D:\\Users\\TermiNexus\\Desktop\\TransPyC\\includes\\vipermath.py": {"sha1": "3f7c5e78d8652535", "mtime": 1781532528.2518907, "size": 15412}, "D:\\Users\\TermiNexus\\Desktop\\TransPyC\\includes\\vipersimd.py": {"sha1": "c24f25b14b4bbd0a", "mtime": 1782891155.5031893, "size": 15522}, "D:\\Users\\TermiNexus\\Desktop\\TransPyC\\includes\\w32\\win32base.py": {"sha1": "7e529fe7a078cfef", "mtime": 1782488356.7736557, "size": 2662}, "D:\\Users\\TermiNexus\\Desktop\\TransPyC\\includes\\w32\\win32console.py": {"sha1": "bbdf3bbd4c3bc28c", "mtime": 1781200703.5338137, "size": 5604}}
|
||||
14
Test/SimdTest/temp/_sha1_map.txt
Normal file
14
Test/SimdTest/temp/_sha1_map.txt
Normal file
@@ -0,0 +1,14 @@
|
||||
271ea3decb810db2:includes/atom.py
|
||||
2fcb6780db4d937f:main.py
|
||||
3f7c5e78d8652535:includes/vipermath.py
|
||||
6f62fe05c5ea1ceb:includes/stdio.py
|
||||
7e529fe7a078cfef:includes/w32\win32base.py
|
||||
90c53dd6db8d41cf:includes/stdlib.py
|
||||
ab6e54ba9a669f76:includes/string.py
|
||||
bbdf3bbd4c3bc28c:includes/w32\win32console.py
|
||||
c24f25b14b4bbd0a:includes/vipersimd.py
|
||||
c3a6aed1f1fb8b1e:includes/numpy\__init__.py
|
||||
c9f4be41ca1cc2b4:includes/viperio.py
|
||||
dd3002730623424b:includes/testcheck.py
|
||||
ee084e9fc6ee413a:includes/memhub.py
|
||||
f5522571bcce7bcb:includes/stdint.py
|
||||
48
Test/SimdTest/temp/ab6e54ba9a669f76.pyi
Normal file
48
Test/SimdTest/temp/ab6e54ba9a669f76.pyi
Normal file
@@ -0,0 +1,48 @@
|
||||
"""
|
||||
Auto-generated Python stub file from string.py
|
||||
Module: string
|
||||
"""
|
||||
|
||||
|
||||
from stdint import *
|
||||
import t, c
|
||||
|
||||
def strcpy(dest: str, src: str) -> str: pass
|
||||
|
||||
def strcat(dest: str, src: str) -> str: pass
|
||||
|
||||
def strncpy(dest: str, src: str, n: t.CSizeT) -> str: pass
|
||||
|
||||
def strlen(src: str) -> t.CSizeT | t.CExport: pass
|
||||
|
||||
def strcmp(str1: str, str2: str) -> t.CInt: pass
|
||||
|
||||
def samestr(str1: str, str2: str) -> bool: pass
|
||||
|
||||
def strncmp(str1: str, str2: str, n: t.CSizeT) -> t.CInt: pass
|
||||
|
||||
def memcmp(ptr1: t.CVoid | t.CPtr, ptr2: t.CVoid | t.CPtr, n: t.CSizeT) -> t.CInt: pass
|
||||
|
||||
def strchr(s: str, cr: t.CInt) -> str: pass
|
||||
|
||||
def strrchr(s: str, cr: t.CInt) -> str: pass
|
||||
|
||||
def strstr(s: str, needle: str) -> str: pass
|
||||
|
||||
def strspn(s: str, skip: str) -> int: pass
|
||||
|
||||
def memset(ptr: t.CVoid | t.CPtr, value: t.CInt, num: t.CSizeT) -> t.CVoid | t.CPtr | t.CExport: pass
|
||||
|
||||
def memset32(ptr: t.CVoid | t.CPtr, value: t.CUInt32T, count: t.CSizeT) -> t.CVoid | t.CPtr: pass
|
||||
|
||||
def memcpy(dest: t.CVoid | t.CPtr, src: t.CVoid | t.CPtr, num: t.CSizeT) -> t.CVoid | t.CPtr | t.CExport: pass
|
||||
|
||||
def memmove(dest: t.CVoid | t.CPtr, src: t.CVoid | t.CPtr, num: t.CSizeT) -> t.CVoid | t.CPtr: pass
|
||||
|
||||
def atoi(src: str) -> t.CInt: pass
|
||||
|
||||
def atoll(src: str) -> t.CInt64T: pass
|
||||
|
||||
def atof(src: str) -> t.CDouble: pass
|
||||
|
||||
def split(s: str, delim: str, result: t.CArray[str]) -> int: pass
|
||||
138
Test/SimdTest/temp/bbdf3bbd4c3bc28c.pyi
Normal file
138
Test/SimdTest/temp/bbdf3bbd4c3bc28c.pyi
Normal file
@@ -0,0 +1,138 @@
|
||||
"""
|
||||
Auto-generated Python stub file from w32.win32console.py
|
||||
Module: w32.win32console
|
||||
"""
|
||||
|
||||
import c
|
||||
|
||||
|
||||
import t
|
||||
from stdint import *
|
||||
from w32.win32base import *
|
||||
|
||||
ENABLE_PROCESSED_INPUT: t.CDefine = 0x0001
|
||||
ENABLE_LINE_INPUT: t.CDefine = 0x0002
|
||||
ENABLE_ECHO_INPUT: t.CDefine = 0x0004
|
||||
ENABLE_WINDOW_INPUT: t.CDefine = 0x0008
|
||||
ENABLE_MOUSE_INPUT: t.CDefine = 0x0010
|
||||
ENABLE_INSERT_MODE: t.CDefine = 0x0020
|
||||
ENABLE_QUICK_EDIT_MODE: t.CDefine = 0x0040
|
||||
ENABLE_EXTENDED_FLAGS: t.CDefine = 0x0080
|
||||
ENABLE_PROCESSED_OUTPUT: t.CDefine = 0x0001
|
||||
ENABLE_WRAP_AT_EOL_OUTPUT: t.CDefine = 0x0002
|
||||
ENABLE_VIRTUAL_TERMINAL_PROCESSING: t.CDefine = 0x0004
|
||||
DISABLE_NEWLINE_AUTO_RETURN: t.CDefine = 0x0008
|
||||
ENABLE_LVB_GRID_WORLDWIDE: t.CDefine = 0x0010
|
||||
FOREGROUND_BLUE: t.CDefine = 0x0001
|
||||
FOREGROUND_GREEN: t.CDefine = 0x0002
|
||||
FOREGROUND_RED: t.CDefine = 0x0004
|
||||
FOREGROUND_INTENSITY: t.CDefine = 0x0008
|
||||
BACKGROUND_BLUE: t.CDefine = 0x0010
|
||||
BACKGROUND_GREEN: t.CDefine = 0x0020
|
||||
BACKGROUND_RED: t.CDefine = 0x0040
|
||||
BACKGROUND_INTENSITY: t.CDefine = 0x0080
|
||||
KEY_EVENT: t.CDefine = 0x0001
|
||||
MOUSE_EVENT: t.CDefine = 0x0002
|
||||
WINDOW_BUFFER_SIZE_EVENT: t.CDefine = 0x0004
|
||||
MENU_EVENT: t.CDefine = 0x0008
|
||||
FOCUS_EVENT: t.CDefine = 0x0010
|
||||
|
||||
class COORD:
|
||||
X: SHORT
|
||||
Y: SHORT
|
||||
class SMALL_RECT:
|
||||
Left: SHORT
|
||||
Top: SHORT
|
||||
Right: SHORT
|
||||
Bottom: SHORT
|
||||
class CONSOLE_SCREEN_BUFFER_INFO:
|
||||
dwSize: COORD
|
||||
dwCursorPosition: COORD
|
||||
wAttributes: WORD
|
||||
srWindow: SMALL_RECT
|
||||
dwMaximumWindowSize: COORD
|
||||
class CONSOLE_CURSOR_INFO:
|
||||
dwSize: ULONG
|
||||
bVisible: BOOL
|
||||
class CHAR_INFO:
|
||||
UnicodeChar: WCHAR
|
||||
Attributes: WORD
|
||||
class KEY_EVENT_RECORD:
|
||||
bKeyDown: BOOL
|
||||
wRepeatCount: WORD
|
||||
wVirtualKeyCode: WORD
|
||||
wVirtualScanCode: WORD
|
||||
uChar: WCHAR
|
||||
dwControlKeyState: ULONG
|
||||
class MOUSE_EVENT_RECORD:
|
||||
dwMousePosition: COORD
|
||||
dwButtonState: ULONG
|
||||
dwControlKeyState: ULONG
|
||||
dwEventFlags: ULONG
|
||||
class WINDOW_BUFFER_SIZE_RECORD:
|
||||
dwSize: COORD
|
||||
class INPUT_RECORD:
|
||||
EventType: WORD
|
||||
Event: KEY_EVENT_RECORD
|
||||
|
||||
def SetConsoleOutputCP(codepage: UINT) -> BOOL | t.State: pass
|
||||
|
||||
def SetConsoleCP(codepage: UINT) -> BOOL | t.State: pass
|
||||
|
||||
def GetConsoleCP() -> UINT | t.State: pass
|
||||
|
||||
def GetConsoleOutputCP() -> UINT | t.State: pass
|
||||
|
||||
def GetConsoleScreenBufferInfo(hConsoleOutput: HANDLE, lpConsoleScreenBufferInfo: CONSOLE_SCREEN_BUFFER_INFO | t.CPtr) -> BOOL | t.State: pass
|
||||
|
||||
def SetConsoleScreenBufferSize(hConsoleOutput: HANDLE, dwSize: COORD) -> BOOL | t.State: pass
|
||||
|
||||
def SetConsoleCursorPosition(hConsoleOutput: HANDLE, dwCursorPosition: COORD) -> BOOL | t.State: pass
|
||||
|
||||
def GetConsoleCursorInfo(hConsoleOutput: HANDLE, lpConsoleCursorInfo: CONSOLE_CURSOR_INFO | t.CPtr) -> BOOL | t.State: pass
|
||||
|
||||
def SetConsoleCursorInfo(hConsoleOutput: HANDLE, lpConsoleCursorInfo: CONSOLE_CURSOR_INFO | t.CPtr) -> BOOL | t.State: pass
|
||||
|
||||
def SetConsoleTextAttribute(hConsoleOutput: HANDLE, wAttributes: WORD) -> BOOL | t.State: pass
|
||||
|
||||
def FillConsoleOutputCharacterA(hConsoleOutput: HANDLE, cCharacter: t.CChar, nLength: ULONG, dwWriteCoord: COORD, lpNumberOfCharsWritten: ULONG | t.CPtr) -> BOOL | t.State: pass
|
||||
|
||||
def FillConsoleOutputCharacterW(hConsoleOutput: HANDLE, cCharacter: WCHAR, nLength: ULONG, dwWriteCoord: COORD, lpNumberOfCharsWritten: ULONG | t.CPtr) -> BOOL | t.State: pass
|
||||
|
||||
def FillConsoleOutputAttribute(hConsoleOutput: HANDLE, wAttribute: WORD, nLength: ULONG, dwWriteCoord: COORD, lpNumberOfAttrsWritten: ULONG | t.CPtr) -> BOOL | t.State: pass
|
||||
|
||||
def WriteConsoleA(hConsoleOutput: HANDLE, lpBuffer: t.CConst | VOIDPTR, nNumberOfCharsToWrite: ULONG, lpNumberOfCharsWritten: ULONG | t.CPtr, lpReserved: VOIDPTR) -> BOOL | t.State: pass
|
||||
|
||||
def WriteConsoleW(hConsoleOutput: HANDLE, lpBuffer: t.CConst | VOIDPTR, nNumberOfCharsToWrite: ULONG, lpNumberOfCharsWritten: ULONG | t.CPtr, lpReserved: VOIDPTR) -> BOOL | t.State: pass
|
||||
|
||||
def ReadConsoleA(hConsoleInput: HANDLE, lpBuffer: VOIDPTR, nNumberOfCharsToRead: ULONG, lpNumberOfCharsRead: ULONG | t.CPtr, pInputControl: VOIDPTR) -> BOOL | t.State: pass
|
||||
|
||||
def ReadConsoleW(hConsoleInput: HANDLE, lpBuffer: VOIDPTR, nNumberOfCharsToRead: ULONG, lpNumberOfCharsRead: ULONG | t.CPtr, pInputControl: VOIDPTR) -> BOOL | t.State: pass
|
||||
|
||||
def GetConsoleMode(hConsoleHandle: HANDLE, lpMode: ULONG | t.CPtr) -> BOOL | t.State: pass
|
||||
|
||||
def SetConsoleMode(hConsoleHandle: HANDLE, dwMode: ULONG) -> BOOL | t.State: pass
|
||||
|
||||
def ReadConsoleInputA(hConsoleInput: HANDLE, lpBuffer: INPUT_RECORD | t.CPtr, nLength: ULONG, lpNumberOfEventsRead: ULONG | t.CPtr) -> BOOL | t.State: pass
|
||||
|
||||
def ReadConsoleInputW(hConsoleInput: HANDLE, lpBuffer: INPUT_RECORD | t.CPtr, nLength: ULONG, lpNumberOfEventsRead: ULONG | t.CPtr) -> BOOL | t.State: pass
|
||||
|
||||
def GetNumberOfConsoleInputEvents(hConsoleInput: HANDLE, lpNumberOfEvents: ULONG | t.CPtr) -> BOOL | t.State: pass
|
||||
|
||||
def FlushConsoleInputBuffer(hConsoleInput: HANDLE) -> BOOL | t.State: pass
|
||||
|
||||
def SetConsoleTitleA(lpConsoleTitle: LPCSTR) -> BOOL | t.State: pass
|
||||
|
||||
def SetConsoleTitleW(lpConsoleTitle: LPCWSTR) -> BOOL | t.State: pass
|
||||
|
||||
def GetConsoleTitleA(lpConsoleTitle: CHARPTR, nSize: ULONG) -> ULONG | t.State: pass
|
||||
|
||||
def GetConsoleTitleW(lpConsoleTitle: WCHARPTR, nSize: ULONG) -> ULONG | t.State: pass
|
||||
|
||||
def AllocConsole() -> BOOL | t.State: pass
|
||||
|
||||
def FreeConsole() -> BOOL | t.State: pass
|
||||
|
||||
def SetConsoleWindowInfo(hConsoleOutput: HANDLE, bAbsolute: BOOL, lpConsoleWindow: SMALL_RECT | t.CPtr) -> BOOL | t.State: pass
|
||||
|
||||
def ScrollConsoleScreenBufferA(hConsoleOutput: HANDLE, lpScrollRectangle: SMALL_RECT | t.CPtr, lpClipRectangle: SMALL_RECT | t.CPtr, dwDestinationOrigin: COORD, lpFill: CHAR_INFO | t.CPtr) -> BOOL | t.State: pass
|
||||
91
Test/SimdTest/temp/c24f25b14b4bbd0a.pyi
Normal file
91
Test/SimdTest/temp/c24f25b14b4bbd0a.pyi
Normal file
@@ -0,0 +1,91 @@
|
||||
"""
|
||||
Auto-generated Python stub file from vipersimd.py
|
||||
Module: vipersimd
|
||||
"""
|
||||
|
||||
|
||||
import t, c
|
||||
|
||||
def simd_add4d(a: t.CPtr, b: t.CPtr, out: t.CPtr) -> t.CVoid: pass
|
||||
|
||||
def simd_sub4d(a: t.CPtr, b: t.CPtr, out: t.CPtr) -> t.CVoid: pass
|
||||
|
||||
def simd_mul4d(a: t.CPtr, b: t.CPtr, out: t.CPtr) -> t.CVoid: pass
|
||||
|
||||
def simd_div4d(a: t.CPtr, b: t.CPtr, out: t.CPtr) -> t.CVoid: pass
|
||||
|
||||
def simd_sqrt4d(a: t.CPtr, out: t.CPtr) -> t.CVoid: pass
|
||||
|
||||
def simd_neg4d(a: t.CPtr, out: t.CPtr) -> t.CVoid: pass
|
||||
|
||||
def simd_abs4d(a: t.CPtr, out: t.CPtr) -> t.CVoid: pass
|
||||
|
||||
def simd_max4d(a: t.CPtr, b: t.CPtr, out: t.CPtr) -> t.CVoid: pass
|
||||
|
||||
def simd_min4d(a: t.CPtr, b: t.CPtr, out: t.CPtr) -> t.CVoid: pass
|
||||
|
||||
def simd_mul_scalar4d(a: t.CPtr, scalar: t.CPtr, out: t.CPtr) -> t.CVoid: pass
|
||||
|
||||
def simd_add_scalar4d(a: t.CPtr, scalar: t.CPtr, out: t.CPtr) -> t.CVoid: pass
|
||||
|
||||
def simd_hsum4d(a: t.CPtr, out: t.CPtr) -> t.CVoid: pass
|
||||
|
||||
def simd_dot4d(a: t.CPtr, b: t.CPtr, out: t.CPtr) -> t.CVoid: pass
|
||||
|
||||
def simd_fma4d(a: t.CPtr, b: t.CPtr, c_val: t.CPtr, out: t.CPtr) -> t.CVoid: pass
|
||||
|
||||
def simd_add4f(a: t.CPtr, b: t.CPtr, out: t.CPtr) -> t.CVoid: pass
|
||||
|
||||
def simd_sub4f(a: t.CPtr, b: t.CPtr, out: t.CPtr) -> t.CVoid: pass
|
||||
|
||||
def simd_mul4f(a: t.CPtr, b: t.CPtr, out: t.CPtr) -> t.CVoid: pass
|
||||
|
||||
def simd_div4f(a: t.CPtr, b: t.CPtr, out: t.CPtr) -> t.CVoid: pass
|
||||
|
||||
def simd_add_array(a: t.CPtr, b: t.CPtr, out: t.CPtr, n: t.CSizeT) -> t.CVoid: pass
|
||||
|
||||
def simd_sub_array(a: t.CPtr, b: t.CPtr, out: t.CPtr, n: t.CSizeT) -> t.CVoid: pass
|
||||
|
||||
def simd_mul_array(a: t.CPtr, b: t.CPtr, out: t.CPtr, n: t.CSizeT) -> t.CVoid: pass
|
||||
|
||||
def simd_div_array(a: t.CPtr, b: t.CPtr, out: t.CPtr, n: t.CSizeT) -> t.CVoid: pass
|
||||
|
||||
def simd_sqrt_array(a: t.CPtr, out: t.CPtr, n: t.CSizeT) -> t.CVoid: pass
|
||||
|
||||
def simd_abs_array(a: t.CPtr, out: t.CPtr, n: t.CSizeT) -> t.CVoid: pass
|
||||
|
||||
def simd_neg_array(a: t.CPtr, out: t.CPtr, n: t.CSizeT) -> t.CVoid: pass
|
||||
|
||||
def simd_dot_array(a: t.CPtr, b: t.CPtr, n: t.CSizeT, out: t.CPtr) -> t.CVoid: pass
|
||||
|
||||
def simd_sqrt(x: t.CDouble) -> t.CDouble: pass
|
||||
|
||||
def simd_fabs(x: t.CDouble) -> t.CDouble: pass
|
||||
|
||||
def simd_floor(x: t.CDouble) -> t.CDouble: pass
|
||||
|
||||
def simd_ceil(x: t.CDouble) -> t.CDouble: pass
|
||||
|
||||
def simd_round(x: t.CDouble) -> t.CDouble: pass
|
||||
|
||||
def simd_trunc(x: t.CDouble) -> t.CDouble: pass
|
||||
|
||||
def simd_fma(a: t.CDouble, b: t.CDouble, c_val: t.CDouble) -> t.CDouble: pass
|
||||
|
||||
def simd_copysign(mag: t.CDouble, sign: t.CDouble) -> t.CDouble: pass
|
||||
|
||||
def simd_neg(x: t.CDouble) -> t.CDouble: pass
|
||||
|
||||
def simd_minnum(a: t.CDouble, b: t.CDouble) -> t.CDouble: pass
|
||||
|
||||
def simd_maxnum(a: t.CDouble, b: t.CDouble) -> t.CDouble: pass
|
||||
|
||||
def simd_exp(x: t.CDouble) -> t.CDouble: pass
|
||||
|
||||
def simd_log(x: t.CDouble) -> t.CDouble: pass
|
||||
|
||||
def simd_sin(x: t.CDouble) -> t.CDouble: pass
|
||||
|
||||
def simd_cos(x: t.CDouble) -> t.CDouble: pass
|
||||
|
||||
def simd_pow(x: t.CDouble, y: t.CDouble) -> t.CDouble: pass
|
||||
240
Test/SimdTest/temp/c3a6aed1f1fb8b1e.pyi
Normal file
240
Test/SimdTest/temp/c3a6aed1f1fb8b1e.pyi
Normal file
@@ -0,0 +1,240 @@
|
||||
"""
|
||||
Auto-generated Python stub file from numpy.__init__.py
|
||||
Module: numpy.__init__
|
||||
"""
|
||||
|
||||
|
||||
from stdint import *
|
||||
import stdlib
|
||||
import string
|
||||
import vipermath
|
||||
import stdio
|
||||
import t, c
|
||||
import memhub
|
||||
|
||||
MAX_NDIM: t.CDefine = 4
|
||||
float64: t.CTypedef = t.CDouble
|
||||
float32: t.CTypedef = t.CFloat
|
||||
int64: t.CTypedef = t.CLong
|
||||
int32: t.CTypedef = t.CInt
|
||||
uint8: t.CTypedef = t.CUnsignedChar
|
||||
pi: t.CDefine = 3.14159265358979323846
|
||||
e: t.CDefine = 2.71828182845904523536
|
||||
|
||||
@t.Object
|
||||
class ndarray[T]:
|
||||
data: T | t.CPtr
|
||||
shape: t.CArray[t.CSizeT, MAX_NDIM]
|
||||
strides: t.CArray[t.CSizeT, MAX_NDIM]
|
||||
ndim: t.CInt
|
||||
size: t.CSizeT
|
||||
owns_data: t.CInt
|
||||
pool: memhub.MemManager | t.CPtr
|
||||
def __new__(self: ndarray, pool: memhub.MemManager | t.CPtr, n: t.CSizeT) -> t.CInt: pass
|
||||
def __add__(self: ndarray, other: ndarray[T] | t.CPtr) -> ndarray[T] | t.CPtr: pass
|
||||
def __sub__(self: ndarray, other: ndarray[T] | t.CPtr) -> ndarray[T] | t.CPtr: pass
|
||||
def __mul__(self: ndarray, other: ndarray[T] | t.CPtr) -> ndarray[T] | t.CPtr: pass
|
||||
def __truediv__(self: ndarray, other: ndarray[T] | t.CPtr) -> ndarray[T] | t.CPtr: pass
|
||||
def __floordiv__(self: ndarray, other: ndarray[T] | t.CPtr) -> ndarray[T] | t.CPtr: pass
|
||||
def __mod__(self: ndarray, other: ndarray[T] | t.CPtr) -> ndarray[T] | t.CPtr: pass
|
||||
def __neg__(self: ndarray) -> ndarray[T] | t.CPtr: pass
|
||||
def __len__(self: ndarray) -> t.CInt: pass
|
||||
def at2d(self: ndarray, row: t.CSizeT, col: t.CSizeT) -> T: pass
|
||||
def set2d(self: ndarray, row: t.CSizeT, col: t.CSizeT, val: T) -> t.CInt: pass
|
||||
def delete(self: ndarray) -> t.CInt: pass
|
||||
def fill(self: ndarray, val: T) -> t.CInt: pass
|
||||
def copy(self: ndarray) -> ndarray[T] | t.CPtr: pass
|
||||
def reshape(self: ndarray, new_shape: INTPTR, new_ndim: t.CInt) -> ndarray[T] | t.CPtr: pass
|
||||
def sum(self: ndarray) -> T: pass
|
||||
def mean(self: ndarray) -> T: pass
|
||||
def min(self: ndarray) -> T: pass
|
||||
def max(self: ndarray) -> T: pass
|
||||
def argmax(self: ndarray) -> t.CInt: pass
|
||||
def argmin(self: ndarray) -> t.CInt: pass
|
||||
def dot(self: ndarray, other: ndarray[T] | t.CPtr) -> T: pass
|
||||
def T(self: ndarray) -> ndarray[T] | t.CPtr: pass
|
||||
def print_arr(self: ndarray) -> t.CInt: pass
|
||||
|
||||
Float64Array: t.CTypedef = ndarray[t.CDouble]
|
||||
Float32Array: t.CTypedef = ndarray[t.CFloat]
|
||||
Int64Array: t.CTypedef = ndarray[t.CLong]
|
||||
Int32Array: t.CTypedef = ndarray[t.CInt]
|
||||
Uint8Array: t.CTypedef = ndarray[t.CUnsignedChar]
|
||||
|
||||
def _alloc_ndarray(pool: memhub.MemManager | t.CPtr) -> ndarray[t.CDouble] | t.CPtr: pass
|
||||
|
||||
def _compute_strides(a: ndarray[t.CDouble] | t.CPtr) -> t.CInt: pass
|
||||
|
||||
def _empty_like(a: ndarray[t.CDouble] | t.CPtr) -> ndarray[t.CDouble] | t.CPtr: pass
|
||||
|
||||
def array(pool: memhub.MemManager | t.CPtr, data: t.CDouble | t.CPtr, n: t.CSizeT) -> ndarray[t.CDouble] | t.CPtr: pass
|
||||
|
||||
def zeros(pool: memhub.MemManager | t.CPtr, n: t.CSizeT) -> ndarray[t.CDouble] | t.CPtr: pass
|
||||
|
||||
def ones(pool: memhub.MemManager | t.CPtr, n: t.CSizeT) -> ndarray[t.CDouble] | t.CPtr: pass
|
||||
|
||||
def full(pool: memhub.MemManager | t.CPtr, n: t.CSizeT, val: t.CDouble) -> ndarray[t.CDouble] | t.CPtr: pass
|
||||
|
||||
def arange(pool: memhub.MemManager | t.CPtr, start: t.CDouble, stop: t.CDouble, step: t.CDouble) -> ndarray[t.CDouble] | t.CPtr: pass
|
||||
|
||||
def linspace(pool: memhub.MemManager | t.CPtr, start: t.CDouble, stop: t.CDouble, num: t.CSizeT) -> ndarray[t.CDouble] | t.CPtr: pass
|
||||
|
||||
def empty2d(pool: memhub.MemManager | t.CPtr, rows: t.CSizeT, cols: t.CSizeT) -> ndarray[t.CDouble] | t.CPtr: pass
|
||||
|
||||
def zeros2d(pool: memhub.MemManager | t.CPtr, rows: t.CSizeT, cols: t.CSizeT) -> ndarray[t.CDouble] | t.CPtr: pass
|
||||
|
||||
def ones2d(pool: memhub.MemManager | t.CPtr, rows: t.CSizeT, cols: t.CSizeT) -> ndarray[t.CDouble] | t.CPtr: pass
|
||||
|
||||
def eye(pool: memhub.MemManager | t.CPtr, n: t.CSizeT) -> ndarray[t.CDouble] | t.CPtr: pass
|
||||
|
||||
def diag(pool: memhub.MemManager | t.CPtr, vals: ndarray[t.CDouble] | t.CPtr) -> ndarray[t.CDouble] | t.CPtr: pass
|
||||
|
||||
def np_abs(a: ndarray[t.CDouble] | t.CPtr) -> ndarray[t.CDouble] | t.CPtr: pass
|
||||
|
||||
def np_sqrt(a: ndarray[t.CDouble] | t.CPtr) -> ndarray[t.CDouble] | t.CPtr: pass
|
||||
|
||||
def np_exp(a: ndarray[t.CDouble] | t.CPtr) -> ndarray[t.CDouble] | t.CPtr: pass
|
||||
|
||||
def np_log(a: ndarray[t.CDouble] | t.CPtr) -> ndarray[t.CDouble] | t.CPtr: pass
|
||||
|
||||
def np_sin(a: ndarray[t.CDouble] | t.CPtr) -> ndarray[t.CDouble] | t.CPtr: pass
|
||||
|
||||
def np_cos(a: ndarray[t.CDouble] | t.CPtr) -> ndarray[t.CDouble] | t.CPtr: pass
|
||||
|
||||
def np_tan(a: ndarray[t.CDouble] | t.CPtr) -> ndarray[t.CDouble] | t.CPtr: pass
|
||||
|
||||
def np_pow(a: ndarray[t.CDouble] | t.CPtr, p: t.CDouble) -> ndarray[t.CDouble] | t.CPtr: pass
|
||||
|
||||
def add_scalar(a: ndarray[t.CDouble] | t.CPtr, s: t.CDouble) -> ndarray[t.CDouble] | t.CPtr: pass
|
||||
|
||||
def mul_scalar(a: ndarray[t.CDouble] | t.CPtr, s: t.CDouble) -> ndarray[t.CDouble] | t.CPtr: pass
|
||||
|
||||
def sub_scalar(a: ndarray[t.CDouble] | t.CPtr, s: t.CDouble) -> ndarray[t.CDouble] | t.CPtr: pass
|
||||
|
||||
def div_scalar(a: ndarray[t.CDouble] | t.CPtr, s: t.CDouble) -> ndarray[t.CDouble] | t.CPtr: pass
|
||||
|
||||
def matmul(a: ndarray[t.CDouble] | t.CPtr, b: ndarray[t.CDouble] | t.CPtr) -> ndarray[t.CDouble] | t.CPtr: pass
|
||||
|
||||
def dot_product(a: ndarray[t.CDouble] | t.CPtr, b: ndarray[t.CDouble] | t.CPtr) -> t.CDouble: pass
|
||||
|
||||
def np_sum(a: ndarray[t.CDouble] | t.CPtr) -> t.CDouble: pass
|
||||
|
||||
def np_mean(a: ndarray[t.CDouble] | t.CPtr) -> t.CDouble: pass
|
||||
|
||||
def np_min(a: ndarray[t.CDouble] | t.CPtr) -> t.CDouble: pass
|
||||
|
||||
def np_max(a: ndarray[t.CDouble] | t.CPtr) -> t.CDouble: pass
|
||||
|
||||
def np_argmax(a: ndarray[t.CDouble] | t.CPtr) -> t.CInt: pass
|
||||
|
||||
def np_argmin(a: ndarray[t.CDouble] | t.CPtr) -> t.CInt: pass
|
||||
|
||||
def var(a: ndarray[t.CDouble] | t.CPtr) -> t.CDouble: pass
|
||||
|
||||
def std(a: ndarray[t.CDouble] | t.CPtr) -> t.CDouble: pass
|
||||
|
||||
def norm(a: ndarray[t.CDouble] | t.CPtr) -> t.CDouble: pass
|
||||
|
||||
def clip(a: ndarray[t.CDouble] | t.CPtr, lo: t.CDouble, hi: t.CDouble) -> ndarray[t.CDouble] | t.CPtr: pass
|
||||
|
||||
def concatenate(a: ndarray[t.CDouble] | t.CPtr, b: ndarray[t.CDouble] | t.CPtr) -> ndarray[t.CDouble] | t.CPtr: pass
|
||||
|
||||
def sort_arr(a: ndarray[t.CDouble] | t.CPtr) -> ndarray[t.CDouble] | t.CPtr: pass
|
||||
|
||||
def reverse(a: ndarray[t.CDouble] | t.CPtr) -> ndarray[t.CDouble] | t.CPtr: pass
|
||||
|
||||
def np_log10(a: ndarray[t.CDouble] | t.CPtr) -> ndarray[t.CDouble] | t.CPtr: pass
|
||||
|
||||
def np_log2(a: ndarray[t.CDouble] | t.CPtr) -> ndarray[t.CDouble] | t.CPtr: pass
|
||||
|
||||
def np_floor(a: ndarray[t.CDouble] | t.CPtr) -> ndarray[t.CDouble] | t.CPtr: pass
|
||||
|
||||
def np_ceil(a: ndarray[t.CDouble] | t.CPtr) -> ndarray[t.CDouble] | t.CPtr: pass
|
||||
|
||||
def np_round(a: ndarray[t.CDouble] | t.CPtr) -> ndarray[t.CDouble] | t.CPtr: pass
|
||||
|
||||
def np_sign(a: ndarray[t.CDouble] | t.CPtr) -> ndarray[t.CDouble] | t.CPtr: pass
|
||||
|
||||
def np_tanh(a: ndarray[t.CDouble] | t.CPtr) -> ndarray[t.CDouble] | t.CPtr: pass
|
||||
|
||||
def np_sinh(a: ndarray[t.CDouble] | t.CPtr) -> ndarray[t.CDouble] | t.CPtr: pass
|
||||
|
||||
def np_cosh(a: ndarray[t.CDouble] | t.CPtr) -> ndarray[t.CDouble] | t.CPtr: pass
|
||||
|
||||
def np_arcsin(a: ndarray[t.CDouble] | t.CPtr) -> ndarray[t.CDouble] | t.CPtr: pass
|
||||
|
||||
def np_arccos(a: ndarray[t.CDouble] | t.CPtr) -> ndarray[t.CDouble] | t.CPtr: pass
|
||||
|
||||
def np_arctan(a: ndarray[t.CDouble] | t.CPtr) -> ndarray[t.CDouble] | t.CPtr: pass
|
||||
|
||||
def np_arctan2(y: ndarray[t.CDouble] | t.CPtr, x: ndarray[t.CDouble] | t.CPtr) -> ndarray[t.CDouble] | t.CPtr: pass
|
||||
|
||||
def np_degrees(a: ndarray[t.CDouble] | t.CPtr) -> ndarray[t.CDouble] | t.CPtr: pass
|
||||
|
||||
def np_radians(a: ndarray[t.CDouble] | t.CPtr) -> ndarray[t.CDouble] | t.CPtr: pass
|
||||
|
||||
def np_isnan(a: ndarray[t.CDouble] | t.CPtr) -> ndarray[t.CDouble] | t.CPtr: pass
|
||||
|
||||
def np_isinf(a: ndarray[t.CDouble] | t.CPtr) -> ndarray[t.CDouble] | t.CPtr: pass
|
||||
|
||||
def np_maximum(a: ndarray[t.CDouble] | t.CPtr, b: ndarray[t.CDouble] | t.CPtr) -> ndarray[t.CDouble] | t.CPtr: pass
|
||||
|
||||
def np_minimum(a: ndarray[t.CDouble] | t.CPtr, b: ndarray[t.CDouble] | t.CPtr) -> ndarray[t.CDouble] | t.CPtr: pass
|
||||
|
||||
def cumsum(a: ndarray[t.CDouble] | t.CPtr) -> ndarray[t.CDouble] | t.CPtr: pass
|
||||
|
||||
def diff(a: ndarray[t.CDouble] | t.CPtr) -> ndarray[t.CDouble] | t.CPtr: pass
|
||||
|
||||
def flatten(a: ndarray[t.CDouble] | t.CPtr) -> ndarray[t.CDouble] | t.CPtr: pass
|
||||
|
||||
def trace(a: ndarray[t.CDouble] | t.CPtr) -> t.CDouble: pass
|
||||
|
||||
def outer(a: ndarray[t.CDouble] | t.CPtr, b: ndarray[t.CDouble] | t.CPtr) -> ndarray[t.CDouble] | t.CPtr: pass
|
||||
|
||||
def np_where(condition: ndarray[t.CDouble] | t.CPtr, x: ndarray[t.CDouble] | t.CPtr, y: ndarray[t.CDouble] | t.CPtr) -> ndarray[t.CDouble] | t.CPtr: pass
|
||||
|
||||
def np_count_nonzero(a: ndarray[t.CDouble] | t.CPtr) -> t.CInt: pass
|
||||
|
||||
def np_all(a: ndarray[t.CDouble] | t.CPtr) -> t.CInt: pass
|
||||
|
||||
def np_any(a: ndarray[t.CDouble] | t.CPtr) -> t.CInt: pass
|
||||
|
||||
def np_equal(a: ndarray[t.CDouble] | t.CPtr, b: ndarray[t.CDouble] | t.CPtr) -> ndarray[t.CDouble] | t.CPtr: pass
|
||||
|
||||
def np_not_equal(a: ndarray[t.CDouble] | t.CPtr, b: ndarray[t.CDouble] | t.CPtr) -> ndarray[t.CDouble] | t.CPtr: pass
|
||||
|
||||
def np_less(a: ndarray[t.CDouble] | t.CPtr, b: ndarray[t.CDouble] | t.CPtr) -> ndarray[t.CDouble] | t.CPtr: pass
|
||||
|
||||
def np_greater(a: ndarray[t.CDouble] | t.CPtr, b: ndarray[t.CDouble] | t.CPtr) -> ndarray[t.CDouble] | t.CPtr: pass
|
||||
|
||||
def np_less_equal(a: ndarray[t.CDouble] | t.CPtr, b: ndarray[t.CDouble] | t.CPtr) -> ndarray[t.CDouble] | t.CPtr: pass
|
||||
|
||||
def np_greater_equal(a: ndarray[t.CDouble] | t.CPtr, b: ndarray[t.CDouble] | t.CPtr) -> ndarray[t.CDouble] | t.CPtr: pass
|
||||
|
||||
def empty(pool: memhub.MemManager | t.CPtr, n: t.CSizeT) -> ndarray[t.CDouble] | t.CPtr: pass
|
||||
|
||||
def full2d(pool: memhub.MemManager | t.CPtr, rows: t.CSizeT, cols: t.CSizeT, val: t.CDouble) -> ndarray[t.CDouble] | t.CPtr: pass
|
||||
|
||||
def zeros_like(a: ndarray[t.CDouble] | t.CPtr) -> ndarray[t.CDouble] | t.CPtr: pass
|
||||
|
||||
def ones_like(a: ndarray[t.CDouble] | t.CPtr) -> ndarray[t.CDouble] | t.CPtr: pass
|
||||
|
||||
def arange1(pool: memhub.MemManager | t.CPtr, stop: t.CDouble) -> ndarray[t.CDouble] | t.CPtr: pass
|
||||
|
||||
def linspace2(pool: memhub.MemManager | t.CPtr, start: t.CDouble, stop: t.CDouble) -> ndarray[t.CDouble] | t.CPtr: pass
|
||||
|
||||
def meshgrid(x: ndarray[t.CDouble] | t.CPtr, y: ndarray[t.CDouble] | t.CPtr) -> ndarray[t.CDouble] | t.CPtr: pass
|
||||
|
||||
def det2x2(a: ndarray[t.CDouble] | t.CPtr) -> t.CDouble: pass
|
||||
|
||||
def inv2x2(a: ndarray[t.CDouble] | t.CPtr) -> ndarray[t.CDouble] | t.CPtr: pass
|
||||
|
||||
def cross3(a: ndarray[t.CDouble] | t.CPtr, b: ndarray[t.CDouble] | t.CPtr) -> ndarray[t.CDouble] | t.CPtr: pass
|
||||
|
||||
def np_interp(x: t.CDouble, xp: ndarray[t.CDouble] | t.CPtr, fp: ndarray[t.CDouble] | t.CPtr) -> t.CDouble: pass
|
||||
|
||||
def prod(a: ndarray[t.CDouble] | t.CPtr) -> t.CDouble: pass
|
||||
|
||||
def median(a: ndarray[t.CDouble] | t.CPtr) -> t.CDouble: pass
|
||||
|
||||
def percentile(a: ndarray[t.CDouble] | t.CPtr, q: t.CDouble) -> t.CDouble: pass
|
||||
22
Test/SimdTest/temp/c9f4be41ca1cc2b4.pyi
Normal file
22
Test/SimdTest/temp/c9f4be41ca1cc2b4.pyi
Normal file
@@ -0,0 +1,22 @@
|
||||
"""
|
||||
Auto-generated Python stub file from viperio.py
|
||||
Module: viperio
|
||||
"""
|
||||
|
||||
|
||||
import t, c
|
||||
from stdint import *
|
||||
|
||||
class Buf:
|
||||
data: t.CChar | t.CPtr
|
||||
length: t.CSizeT
|
||||
capacity: t.CSizeT
|
||||
owned: bool
|
||||
def __init__(self: Buf, data: t.CChar | t.CPtr, capacity: t.CSizeT, length: t.CSizeT, owned: bool) -> t.CInt: pass
|
||||
def clear(self: Buf) -> t.CInt: pass
|
||||
def write(self: Buf, src: t.CChar | t.CPtr, count: t.CSizeT) -> t.CSizeT: pass
|
||||
def cstr(self: Buf) -> t.CChar | t.CPtr: pass
|
||||
def reset(self: Buf) -> t.CInt: pass
|
||||
def __enter__(self: Buf) -> 'Buf' | t.CPtr: pass
|
||||
def __exit__(self: Buf) -> t.CInt: pass
|
||||
def free(self: Buf) -> t.CInt: pass
|
||||
31
Test/SimdTest/temp/dd3002730623424b.pyi
Normal file
31
Test/SimdTest/temp/dd3002730623424b.pyi
Normal file
@@ -0,0 +1,31 @@
|
||||
"""
|
||||
Auto-generated Python stub file from testcheck.py
|
||||
Module: testcheck
|
||||
"""
|
||||
|
||||
|
||||
import t, c
|
||||
import stdio
|
||||
from w32.win32console import SetConsoleOutputCP, SetConsoleCP
|
||||
|
||||
CP_UTF8: t.CDefine = 65001
|
||||
_pass_count: t.CExtern | t.CInt
|
||||
_fail_count: t.CExtern | t.CInt
|
||||
_total_pass: t.CExtern | t.CInt
|
||||
_total_fail: t.CExtern | t.CInt
|
||||
|
||||
def begin(name: str) -> t.CInt: pass
|
||||
|
||||
def section(name: str) -> t.CInt: pass
|
||||
|
||||
def ok(msg: str) -> t.CInt: pass
|
||||
|
||||
def fail(msg: str) -> t.CInt: pass
|
||||
|
||||
def check(cond: t.CInt, ok_msg: str, fail_msg: str) -> t.CInt: pass
|
||||
|
||||
def info(msg: str) -> t.CInt: pass
|
||||
|
||||
def end() -> t.CInt: pass
|
||||
|
||||
def summary() -> t.CInt: pass
|
||||
81
Test/SimdTest/temp/ee084e9fc6ee413a.pyi
Normal file
81
Test/SimdTest/temp/ee084e9fc6ee413a.pyi
Normal file
@@ -0,0 +1,81 @@
|
||||
"""
|
||||
Auto-generated Python stub file from memhub.py
|
||||
Module: memhub
|
||||
"""
|
||||
|
||||
|
||||
import t, c
|
||||
from stdint import *
|
||||
import string
|
||||
import atom
|
||||
import viperio
|
||||
|
||||
MEMHUB_ALIGN: t.CDefine = 8
|
||||
MEMSLAB_MIN_BLOCK: t.CDefine = 16
|
||||
MEMSLAB_BITMAP_BYTES: t.CDefine = 256
|
||||
MEMBUDDY_MIN_BLOCK: t.CDefine = 32
|
||||
MEMBUDDY_MAX_ORDERS: t.CDefine = 32
|
||||
MEMBUDDY_HEADER_SIZE: t.CDefine = 8
|
||||
|
||||
def _align_up(val: t.CSizeT, align: t.CSizeT) -> t.CSizeT: pass
|
||||
|
||||
def _largest_pow2_le(val: t.CSizeT) -> t.CSizeT: pass
|
||||
|
||||
def _block_size_at_order(order: t.CInt) -> t.CSizeT: pass
|
||||
|
||||
|
||||
@t.CVTable
|
||||
class MemManager:
|
||||
__provides__: list[str] = ['__memmgr__']
|
||||
base: t.CVoid | t.CPtr
|
||||
size: t.CSizeT
|
||||
def __init__(self: MemManager, base: t.CVoid | t.CPtr, size: t.CSizeT) -> t.CInt: pass
|
||||
def alloc(self: MemManager, size: t.CSizeT) -> t.CVoid | t.CPtr: pass
|
||||
def free(self: MemManager, ptr: t.CVoid | t.CPtr) -> t.CInt: pass
|
||||
def reset(self: MemManager) -> t.CInt: pass
|
||||
def calloc(self: MemManager, count: t.CSizeT, size: t.CSizeT) -> t.CVoid | t.CPtr: pass
|
||||
def realloc(self: MemManager, ptr: t.CVoid | t.CPtr, old_size: t.CSizeT, new_size: t.CSizeT) -> t.CVoid | t.CPtr: pass
|
||||
def __enter__(self: MemManager) -> 'MemManager' | t.CPtr: pass
|
||||
def __exit__(self: MemManager) -> t.CInt: pass
|
||||
def alloc_buf(self: MemManager, capacity: t.CSizeT) -> viperio.Buf | t.CPtr: pass
|
||||
class MemPool(MemManager):
|
||||
offset: t.CSizeT
|
||||
high_water: t.CSizeT
|
||||
def __init__(self: MemPool, base: t.CVoid | t.CPtr, size: t.CSizeT) -> t.CInt: pass
|
||||
def alloc(self: MemPool, size: t.CSizeT) -> t.CVoid | t.CPtr: pass
|
||||
def free(self: MemPool, ptr: t.CVoid | t.CPtr) -> t.CInt: pass
|
||||
def reset(self: MemPool) -> t.CInt: pass
|
||||
class MemSlab(MemManager):
|
||||
block_size: t.CSizeT
|
||||
block_count: t.CSizeT
|
||||
used_count: t.CSizeT
|
||||
free_list: t.CVoid | t.CPtr
|
||||
alloc_map: t.CUInt8T | t.CPtr
|
||||
alloc_map_size: t.CSizeT
|
||||
usable: t.CVoid | t.CPtr
|
||||
usable_size: t.CSizeT
|
||||
def __init__(self: MemSlab, base: t.CVoid | t.CPtr, size: t.CSizeT, block_size: t.CSizeT) -> t.CInt: pass
|
||||
def alloc(self: MemSlab, size: t.CSizeT) -> t.CVoid | t.CPtr: pass
|
||||
def free(self: MemSlab, ptr: t.CVoid | t.CPtr) -> t.CInt: pass
|
||||
def reset(self: MemSlab) -> t.CInt: pass
|
||||
class MemBuddy(MemManager):
|
||||
max_order: t.CInt
|
||||
free_lists: t.CUInt64T | t.CPtr
|
||||
lock_val: t.CVolatile | t.CInt
|
||||
usable: t.CVoid | t.CPtr
|
||||
usable_size: t.CSizeT
|
||||
def __init__(self: MemBuddy, base: t.CVoid | t.CPtr, size: t.CSizeT) -> t.CInt: pass
|
||||
def _fl_push(self: MemBuddy, order: t.CInt, block: t.CVoid | t.CPtr) -> t.CInt: pass
|
||||
def _fl_pop(self: MemBuddy, order: t.CInt) -> t.CVoid | t.CPtr: pass
|
||||
def _fl_find_and_remove(self: MemBuddy, order: t.CInt, target: t.CVoid | t.CPtr) -> t.CInt: pass
|
||||
def _buddy_of(self: MemBuddy, block: t.CVoid | t.CPtr, order: t.CInt) -> t.CVoid | t.CPtr: pass
|
||||
def _order_for_size(self: MemBuddy, size: t.CSizeT) -> t.CInt: pass
|
||||
def _split_to_order(self: MemBuddy, to_order: t.CInt) -> t.CVoid | t.CPtr: pass
|
||||
def _coalesce(self: MemBuddy, block: t.CVoid | t.CPtr, order: t.CInt) -> t.CInt: pass
|
||||
def _is_valid_ptr(self: MemBuddy, ptr: t.CVoid | t.CPtr) -> t.CInt: pass
|
||||
def _lock(self: MemBuddy) -> t.CInt: pass
|
||||
def _unlock(self: MemBuddy) -> t.CInt: pass
|
||||
def alloc(self: MemBuddy, size: t.CSizeT) -> t.CVoid | t.CPtr: pass
|
||||
def free(self: MemBuddy, ptr: t.CVoid | t.CPtr) -> t.CInt: pass
|
||||
def reset(self: MemBuddy) -> t.CInt: pass
|
||||
def realloc(self: MemBuddy, ptr: t.CVoid | t.CPtr, old_size: t.CSizeT, new_size: t.CSizeT) -> t.CVoid | t.CPtr: pass
|
||||
100
Test/SimdTest/temp/f5522571bcce7bcb.pyi
Normal file
100
Test/SimdTest/temp/f5522571bcce7bcb.pyi
Normal file
@@ -0,0 +1,100 @@
|
||||
"""
|
||||
Auto-generated Python stub file from stdint.py
|
||||
Module: stdint
|
||||
"""
|
||||
|
||||
import c
|
||||
|
||||
|
||||
import t
|
||||
|
||||
INT: t.CTypedef = t.CInt
|
||||
INTPTR: t.CTypedef = t.CInt | t.CPtr
|
||||
BOOL: t.CTypedef = t.CInt
|
||||
UINT: t.CTypedef = t.CUnsignedInt
|
||||
UINTPTR: t.CTypedef = UINT | t.CPtr
|
||||
BYTE: t.CTypedef = t.CUnsignedChar
|
||||
BYTEPTR: t.CTypedef = BYTE | t.CPtr
|
||||
WORD: t.CTypedef = t.CUInt16T
|
||||
DWORD: t.CTypedef = t.CUInt32T
|
||||
QWORD: t.CTypedef = t.CUInt64T
|
||||
TCHAR: t.CTypedef = t.CChar
|
||||
CHARLIST: t.CTypedef = str | t.CPtr
|
||||
VOID: t.CTypedef = t.CVoid
|
||||
SHORT: t.CTypedef = t.CShort
|
||||
SHORTPTR: t.CTypedef = t.CShort | t.CPtr
|
||||
USHORT: t.CTypedef = t.CUnsignedShort
|
||||
USHORTPTR: t.CTypedef = t.CUnsignedShort | t.CPtr
|
||||
LONGLONG: t.CTypedef = t.CLongLong
|
||||
ULONGLONG: t.CTypedef = t.CUnsignedLongLong
|
||||
LONG: t.CTypedef = t.CLong
|
||||
ULONG: t.CTypedef = t.CUnsignedLong
|
||||
WCHAR: t.CTypedef = WORD
|
||||
WCHARPTR: t.CTypedef = WORD | t.CPtr
|
||||
CHARPTR: t.CTypedef = t.CChar | t.CPtr
|
||||
FSIZE_t: t.CTypedef = DWORD
|
||||
LBA_t: t.CTypedef = DWORD
|
||||
VOIDPTR: t.CTypedef = t.CVoid | t.CPtr
|
||||
FLOAT: t.CTypedef = t.CFloat
|
||||
DOUBLE: t.CTypedef = t.CDouble
|
||||
FLOAT8: t.CTypedef = t.CFloat8T
|
||||
FLOAT16: t.CTypedef = t.CFloat16T
|
||||
FLOAT32: t.CTypedef = t.CFloat32T
|
||||
FLOAT64: t.CTypedef = t.CFloat64T
|
||||
FLOAT128: t.CTypedef = t.CFloat128T
|
||||
INT8: t.CTypedef = t.CInt8T
|
||||
INT16: t.CTypedef = t.CInt16T
|
||||
INT32: t.CTypedef = t.CInt32T
|
||||
INT64: t.CTypedef = t.CInt64T
|
||||
UINT8: t.CTypedef = t.CUInt8T
|
||||
UINT16: t.CTypedef = t.CUInt16T
|
||||
UINT32: t.CTypedef = t.CUInt32T
|
||||
UINT64: t.CTypedef = t.CUInt64T
|
||||
INT8PTR: t.CTypedef = t.CInt8T | t.CPtr
|
||||
INT16PTR: t.CTypedef = t.CInt16T | t.CPtr
|
||||
INT32PTR: t.CTypedef = t.CInt32T | t.CPtr
|
||||
INT64PTR: t.CTypedef = t.CInt64T | t.CPtr
|
||||
UINT8PTR: t.CTypedef = t.CUInt8T | t.CPtr
|
||||
UINT16PTR: t.CTypedef = t.CUInt16T | t.CPtr
|
||||
UINT32PTR: t.CTypedef = t.CUInt32T | t.CPtr
|
||||
UINT64PTR: t.CTypedef = t.CUInt64T | t.CPtr
|
||||
CHAR8: t.CTypedef = t.CChar8T
|
||||
CHAR16: t.CTypedef = t.CChar16T
|
||||
CHAR32: t.CTypedef = t.CChar32T
|
||||
CHAR8PTR: t.CTypedef = t.CChar8T | t.CPtr
|
||||
CHAR16PTR: t.CTypedef = t.CChar16T | t.CPtr
|
||||
CHAR32PTR: t.CTypedef = t.CChar32T | t.CPtr
|
||||
i8: t.CTypedef = t.CInt8T
|
||||
i16: t.CTypedef = t.CInt16T
|
||||
i32: t.CTypedef = t.CInt32T
|
||||
i64: t.CTypedef = t.CInt64T
|
||||
u8: t.CTypedef = t.CUInt8T
|
||||
u16: t.CTypedef = t.CUInt16T
|
||||
u32: t.CTypedef = t.CUInt32T
|
||||
u64: t.CTypedef = t.CUInt64T
|
||||
SIZE_T: t.CTypedef = t.CSizeT
|
||||
SSIZE_T: t.CTypedef = t.CPtrDiffT
|
||||
PTRDIFF_T: t.CTypedef = t.CPtrDiffT
|
||||
int8_t: t.CTypedef = t.CInt8T
|
||||
int16_t: t.CTypedef = t.CInt16T
|
||||
int32_t: t.CTypedef = t.CInt32T
|
||||
int64_t: t.CTypedef = t.CInt64T
|
||||
uint8_t: t.CTypedef = t.CUInt8T
|
||||
uint16_t: t.CTypedef = t.CUInt16T
|
||||
uint32_t: t.CTypedef = t.CUInt32T
|
||||
uint64_t: t.CTypedef = t.CUInt64T
|
||||
size_t: t.CTypedef = t.CSizeT
|
||||
ssize_t: t.CTypedef = t.CPtrDiffT
|
||||
ptrdiff_t: t.CTypedef = t.CPtrDiffT
|
||||
intptr_t: t.CTypedef = t.CIntPtrT
|
||||
uintptr_t: t.CTypedef = t.CUIntPtrT
|
||||
wchar_t: t.CTypedef = t.CWCharT
|
||||
char8_t: t.CTypedef = t.CChar8T
|
||||
char16_t: t.CTypedef = t.CChar16T
|
||||
char32_t: t.CTypedef = t.CChar32T
|
||||
float8_t: t.CTypedef = t.CFloat8T
|
||||
float16_t: t.CTypedef = t.CFloat16T
|
||||
float32_t: t.CTypedef = t.CFloat32T
|
||||
float64_t: t.CTypedef = t.CFloat64T
|
||||
float128_t: t.CTypedef = t.CFloat128T
|
||||
_Bool: t.CTypedef = t.CBool
|
||||
Reference in New Issue
Block a user