示例#1
0
cuda = _ti_core.cuda
metal = _ti_core.metal
opengl = _ti_core.opengl
cc = _ti_core.cc
wasm = _ti_core.wasm
gpu = [cuda, metal, opengl]
cpu = _ti_core.host_arch()
kernel_profiler_print = lambda: impl.get_runtime().prog.kernel_profiler_print()
kernel_profiler_clear = lambda: impl.get_runtime().prog.kernel_profiler_clear()
kernel_profiler_total_time = lambda: impl.get_runtime(
).prog.kernel_profiler_total_time()
timeline_clear = lambda: impl.get_runtime().prog.timeline_clear()
timeline_save = lambda fn: impl.get_runtime().prog.timeline_save(fn)

# Legacy API
type_factory_ = _ti_core.get_type_factory_instance()


def memory_profiler_print():
    impl.get_runtime().materialize()
    impl.get_runtime().prog.print_memory_profiler_info()


extension = _ti_core.Extension
is_extension_supported = _ti_core.is_extension_supported


def reset():
    impl.reset()
    global runtime
    runtime = impl.get_runtime()
示例#2
0
 def __init__(self):
     self.core = _ti_core.get_type_factory_instance()