forked from taichi-dev/taichi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_internal_func.py
61 lines (43 loc) · 1.05 KB
/
test_internal_func.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import taichi as ti
import time
# TODO: these are not really tests...
def all_archs_for_this(test):
# ti.call_internal() is not supported on CUDA, Metal, OpenGL yet
return ti.archs_excluding(ti.metal, ti.opengl, ti.cuda)(test)
@all_archs_for_this
def test_basic():
@ti.kernel
def test():
for i in range(10):
ti.call_internal("do_nothing")
test()
@all_archs_for_this
def test_host_polling():
return
@ti.kernel
def test():
ti.call_internal("refresh_counter")
for i in range(10):
print('updating tail to', i)
test()
time.sleep(0.1)
@all_archs_for_this
def test_list_manager():
@ti.kernel
def test():
ti.call_internal("test_list_manager")
test()
test()
@all_archs_for_this
def test_node_manager():
@ti.kernel
def test():
ti.call_internal("test_node_allocator")
test()
test()
@all_archs_for_this
def test_node_manager_gc():
@ti.kernel
def test_cpu():
ti.call_internal("test_node_allocator_gc_cpu")
test_cpu()