text
stringlengths
24
1.04M
metadata
stringlengths
233
497
### File: taichi/program/program.cpp // Program, context for Taichi program execution #include "program.h" #include "taichi/ir/statements.h" #include "taichi/program/extension.h" #include "taichi/backends/metal/api.h" #include "taichi/backends/opengl/opengl_api.h" #if defined(TI_WITH_CUDA) #include "taichi/backends/c...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/program/program.cpp", "license": "mit", "size": 29314}
### File: taichi/program/program.h // Program - Taichi program execution context #pragma once #include <functional> #include <optional> #include <atomic> #define TI_RUNTIME_HOST #include "taichi/ir/ir.h" #include "taichi/ir/type_factory.h" #include "taichi/ir/snode.h" #include "taichi/lang_util.h" #include "taichi/...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/program/program.h", "license": "mit", "size": 8211}
### File: taichi/program/py_print_buffer.cpp #include "taichi/program/py_print_buffer.h" namespace taichi { PythonPrintBuffer py_cout; } // namespace taichi
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/program/py_print_buffer.cpp", "license": "mit", "size": 116}
### File: taichi/program/py_print_buffer.h #pragma once #include <sstream> #include <iostream> namespace taichi { // PythonPrintBuffer holds the logs printed from kernel before sending them back // to python. The name could be a bit misleading, as it is really just a string // buffer, and can be used without Python....
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/program/py_print_buffer.h", "license": "mit", "size": 675}
### File: taichi/program/snode_expr_utils.cpp #include "taichi/program/snode_expr_utils.h" namespace taichi { namespace lang { namespace { class GradInfoImpl final : public SNode::GradInfoProvider { public: explicit GradInfoImpl(GlobalVariableExpression *glb_var) : glb_var_(glb_var) { } bool is_primal() cons...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/program/snode_expr_utils.cpp", "license": "mit", "size": 3602}
### File: taichi/program/snode_expr_utils.h #pragma once #include <memory> #include <unordered_map> #include "taichi/ir/snode.h" #include "taichi/ir/frontend_ir.h" // This file groups the set of helpers that need the Expr associated with a // given SNode. Expr is part of the frontend, which somehow depends on the //...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/program/snode_expr_utils.h", "license": "mit", "size": 888}
### File: taichi/program/snode_rw_accessors_bank.cpp #include "taichi/program/snode_rw_accessors_bank.h" #include "taichi/program/program.h" namespace taichi { namespace lang { namespace { void set_kernel_args(const std::vector<int> &I, int num_active_indices, Kernel::Launch...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/program/snode_rw_accessors_bank.cpp", "license": "mit", "size": 2790}
### File: taichi/program/snode_rw_accessors_bank.h #pragma once #include <unordered_map> #include "taichi/program/kernel.h" #include "taichi/ir/snode.h" namespace taichi { namespace lang { class Program; /** A mapping from an SNode to its read/write access kernels. * * The main purpose of this class is to decoup...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/program/snode_rw_accessors_bank.h", "license": "mit", "size": 1383}
### File: taichi/program/state_flow_graph.cpp #include "taichi/program/state_flow_graph.h" #include <algorithm> #include <limits> #include <set> #include <sstream> #include <unordered_set> #include "taichi/ir/analysis.h" #include "taichi/ir/statements.h" #include "taichi/ir/transforms.h" #include "taichi/program/asyn...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/program/state_flow_graph.cpp", "license": "mit", "size": 53182}
### File: taichi/program/state_flow_graph.h #pragma once #include <iterator> #include <optional> #include <string> #include <unordered_map> #include <unordered_set> #include "llvm/ADT/SmallSet.h" #include "llvm/ADT/SmallVector.h" #include "taichi/ir/ir.h" #include "taichi/lang_util.h" #include "taichi/program/async_u...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/program/state_flow_graph.h", "license": "mit", "size": 9888}
### File: taichi/python/exception.cpp /******************************************************************************* Copyright (c) The Taichi Authors (2016- ). All Rights Reserved. The use of this software is governed by the LICENSE file. ***********************************************************************...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/python/exception.cpp", "license": "mit", "size": 610}
### File: taichi/python/exception.h /******************************************************************************* Copyright (c) The Taichi Authors (2016- ). All Rights Reserved. The use of this software is governed by the LICENSE file. *************************************************************************...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/python/exception.h", "license": "mit", "size": 685}
### File: taichi/python/export.cpp /******************************************************************************* Copyright (c) The Taichi Authors (2016- ). All Rights Reserved. The use of this software is governed by the LICENSE file. **************************************************************************...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/python/export.cpp", "license": "mit", "size": 655}
### File: taichi/python/export.h /******************************************************************************* Copyright (c) The Taichi Authors (2016- ). All Rights Reserved. The use of this software is governed by the LICENSE file. ****************************************************************************...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/python/export.h", "license": "mit", "size": 798}
### File: taichi/python/export_lang.cpp // Bindings for the python frontend #include <optional> #include <string> #include "llvm/Config/llvm-config.h" #include "pybind11/functional.h" #include "pybind11/pybind11.h" #include "taichi/ir/frontend.h" #include "taichi/ir/frontend_ir.h" #include "taichi/ir/statements.h" ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/python/export_lang.cpp", "license": "mit", "size": 32874}
### File: taichi/python/export_math.cpp /******************************************************************************* Copyright (c) The Taichi Authors (2016- ). All Rights Reserved. The use of this software is governed by the LICENSE file. *********************************************************************...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/python/export_math.cpp", "license": "mit", "size": 3672}
### File: taichi/python/export_misc.cpp /******************************************************************************* Copyright (c) The Taichi Authors (2016- ). All Rights Reserved. The use of this software is governed by the LICENSE file. *********************************************************************...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/python/export_misc.cpp", "license": "mit", "size": 5989}
### File: taichi/python/export_visual.cpp /******************************************************************************* Copyright (c) The Taichi Authors (2016- ). All Rights Reserved. The use of this software is governed by the LICENSE file. *******************************************************************...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/python/export_visual.cpp", "license": "mit", "size": 5222}
### File: taichi/python/interfaces_registry.cpp #include <functional> #include "pybind11/pybind11.h" #include "taichi/common/interface.h" #include "taichi/common/task.h" #include "taichi/system/benchmark.h" namespace taichi { #define TI_INTERFACE_DEF_WITH_PYBIND11(class_name, base_alias) \ ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/python/interfaces_registry.cpp", "license": "mit", "size": 2146}
### File: taichi/python/memory_usage_monitor.cpp #include "taichi/python/memory_usage_monitor.h" #include "pybind11/embed.h" #include "pybind11/pybind11.h" #include "taichi/common/core.h" #include "taichi/common/task.h" #include "taichi/math/scalar.h" #include "taichi/system/threading.h" #include "taichi/system/timer....
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/python/memory_usage_monitor.cpp", "license": "mit", "size": 2987}
### File: taichi/python/memory_usage_monitor.h #pragma once #include "taichi/system/virtual_memory.h" TI_NAMESPACE_BEGIN class MemoryMonitor { // avoid including py::dict // py::dict locals; void *locals; std::ofstream log; public: MemoryMonitor(int pid, std::string output_fn); ~MemoryMonitor(); uint...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/python/memory_usage_monitor.h", "license": "mit", "size": 485}
### File: taichi/python/py_exception_translator.cpp #include <csignal> #include "pybind11/pybind11.h" namespace taichi { namespace { // Translates and propagates a CPP exception to Python. // TODO(#2198): How can we glob all these global variables used as initializaers // into a single function? class ExceptionTran...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/python/py_exception_translator.cpp", "license": "mit", "size": 750}
### File: taichi/runtime/llvm/atomic.h #pragma once // These instructions should be replaced by CUDA intrinsics on GPUs #define DEFINE_ATOMIC_EXCHANGE(T) \ T atomic_exchange_##T(volatile T *dest, T val) { \ T ret; \ ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/runtime/llvm/atomic.h", "license": "mit", "size": 3112}
### File: taichi/runtime/llvm/internal_functions.h // Note that TI_ASSERT provided by runtime doesn't check fail immediately. As // a hack, we just check the last error code whenever we call TI_ASSERT. #define TI_TEST_CHECK(cond, r) \ do { ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/runtime/llvm/internal_functions.h", "license": "mit", "size": 4843}
### File: taichi/runtime/llvm/locked_task.h #pragma once template <typename T, typename G> class lock_guard { public: lock_guard(Ptr lock, const T &func, const G &test) { #if ARCH_x64 || ARCH_arm64 mutex_lock_i32(lock); if (test()) func(); mutex_unlock_i32(lock); #else // CUDA auto body =...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/runtime/llvm/locked_task.h", "license": "mit", "size": 2087}
### File: taichi/runtime/llvm/mem_request.h #pragma once // Use relative path here for runtime compilation #include "taichi/inc/constants.h" #if defined(TI_RUNTIME_HOST) namespace taichi { namespace lang { #endif struct MemRequest { std::size_t size; std::size_t alignment; uint8 *ptr; std::size_t __padding; ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/runtime/llvm/mem_request.h", "license": "mit", "size": 540}
### File: taichi/runtime/llvm/node_bitmasked.h #pragma once // Specialized Attributes and functions struct BitmaskedMeta : public StructMeta { bool _; }; STRUCT_FIELD(BitmaskedMeta, _); i32 Bitmasked_get_num_elements(Ptr meta, Ptr node) { return ((StructMeta *)meta)->max_num_elements; } void Bitmasked_activate(...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/Taichi", "path": "taichi/runtime/llvm/node_bitmasked.h", "license": "mit", "size": 1490}
### File: taichi/runtime/llvm/node_dense.h #pragma once // Specialized Attributes and functions struct DenseMeta : public StructMeta { int morton_dim; }; STRUCT_FIELD(DenseMeta, morton_dim) i32 Dense_get_num_elements(Ptr meta, Ptr node) { return ((StructMeta *)meta)->max_num_elements; } void Dense_activate(Ptr ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/Taichi", "path": "taichi/runtime/llvm/node_dense.h", "license": "mit", "size": 519}
### File: taichi/runtime/llvm/node_dynamic.h #pragma once struct DynamicNode { i32 lock; i32 n; Ptr ptr; }; // Specialized Attributes and functions struct DynamicMeta : public StructMeta { int chunk_size; }; STRUCT_FIELD(DynamicMeta, chunk_size); void Dynamic_activate(Ptr meta_, Ptr node_, int i) { auto m...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/Taichi", "path": "taichi/runtime/llvm/node_dynamic.h", "license": "mit", "size": 3210}
### File: taichi/runtime/llvm/node_pointer.h #pragma once // Specialized Attributes and functions struct PointerMeta : public StructMeta { bool _; }; STRUCT_FIELD(PointerMeta, _); i32 Pointer_get_num_elements(Ptr meta, Ptr node) { return ((StructMeta *)meta)->max_num_elements; } bool is_representative(uint32 ma...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/Taichi", "path": "taichi/runtime/llvm/node_pointer.h", "license": "mit", "size": 3198}
### File: taichi/runtime/llvm/node_root.h #pragma once struct RootMeta : public StructMeta { int tag; }; STRUCT_FIELD(RootMeta, tag); void Root_activate(Ptr meta, Ptr node, int i) { } i32 Root_is_active(Ptr meta, Ptr node, int i) { return 1; } Ptr Root_lookup_element(Ptr meta, Ptr node, int i) { // only one ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/Taichi", "path": "taichi/runtime/llvm/node_root.h", "license": "mit", "size": 366}
### File: taichi/runtime/llvm/runtime.cpp // This file will only be compiled into llvm bitcode by clang. // The generated bitcode will likely get inlined for performance. #if !defined(TI_INCLUDED) || !defined(_WIN32) #include <atomic> #include <cstdint> #include <cmath> #include <cstdarg> #include <cstdlib> #include ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/runtime/llvm/runtime.cpp", "license": "mit", "size": 49578}
### File: taichi/runtime/runtime.cpp #include "taichi/runtime/runtime.h" TLANG_NAMESPACE_BEGIN std::unique_ptr<Runtime> Runtime::create(Arch arch) { auto &factories = get_factories(); if (auto factory = factories.find(arch); factory != factories.end()) { return factory->second(); } else { return nullptr...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/runtime/runtime.cpp", "license": "mit", "size": 312}
### File: taichi/runtime/runtime.h #pragma once #include "taichi/common/core.h" #include "taichi/program/arch.h" #include "taichi/program/kernel_profiler.h" #include <map> #include <memory> #include <functional> TLANG_NAMESPACE_BEGIN class Runtime { protected: KernelProfilerBase *profiler; public: Runtime() ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/runtime/runtime.h", "license": "mit", "size": 1175}
### File: taichi/struct/struct.cpp // Codegen for the hierarchical data structure #include "taichi/ir/ir.h" #include "taichi/ir/expression.h" #include "taichi/program/snode_expr_utils.h" #include "taichi/program/program.h" #include "struct.h" TLANG_NAMESPACE_BEGIN StructCompiler::StructCompiler(Program *prog) : prog...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/struct/struct.cpp", "license": "mit", "size": 5530}
### File: taichi/struct/struct.h // Codegen for the hierarchical data structure #pragma once #include "taichi/ir/snode.h" #include "taichi/program/program.h" TLANG_NAMESPACE_BEGIN class StructCompiler { public: std::vector<SNode *> stack; std::vector<SNode *> snodes; std::vector<SNode *> ambient_snodes; std...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/struct/struct.h", "license": "mit", "size": 880}
### File: taichi/struct/struct_llvm.cpp // Codegen for the hierarchical data structure (LLVM) #include "llvm/IR/Verifier.h" #include "llvm/IR/IRBuilder.h" #include "taichi/ir/ir.h" #include "taichi/struct/struct.h" #include "taichi/struct/struct_llvm.h" #include "taichi/program/program.h" #include "taichi/util/file_s...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/struct/struct_llvm.cpp", "license": "mit", "size": 11280}
### File: taichi/struct/struct_llvm.h // Codegen for the hierarchical data structure (LLVM) #include "taichi/struct/struct.h" #include "taichi/llvm/llvm_codegen_utils.h" TLANG_NAMESPACE_BEGIN class StructCompilerLLVM : public StructCompiler, public LLVMModuleBuilder { public: StructCompilerLLVM(Program *prog, Arc...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/struct/struct_llvm.h", "license": "mit", "size": 1037}
### File: taichi/system/benchmark.h /******************************************************************************* Copyright (c) The Taichi Authors (2016- ). All Rights Reserved. The use of this software is governed by the LICENSE file. *************************************************************************...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/system/benchmark.h", "license": "mit", "size": 1576}
### File: taichi/system/demangling.cpp /******************************************************************************* Copyright (c) The Taichi Authors (2016- ). All Rights Reserved. The use of this software is governed by the LICENSE file. **********************************************************************...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/system/demangling.cpp", "license": "mit", "size": 1289}
### File: taichi/system/dynamic_loader.cpp #include "taichi/system/dynamic_loader.h" #ifdef WIN32 #include "taichi/platform/windows/windows.h" #else #include <dlfcn.h> #endif TI_NAMESPACE_BEGIN DynamicLoader::DynamicLoader(const std::string &dll_path) { load_dll(dll_path); } void DynamicLoader::load_dll(const std...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/system/dynamic_loader.cpp", "license": "mit", "size": 1184}
### File: taichi/system/dynamic_loader.h /******************************************************************************* Copyright (c) The Taichi Authors (2016- ). All Rights Reserved. The use of this software is governed by the LICENSE file. ********************************************************************...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/system/dynamic_loader.h", "license": "mit", "size": 803}
### File: taichi/system/hacked_signal_handler.cpp #include <csignal> #include "taichi/common/logging.h" #include "taichi/system/threading.h" #include "taichi/system/traceback.h" namespace taichi { namespace { std::string signal_name(int sig) { #if !defined(_WIN64) return strsignal(sig); #else if (sig == SIGABRT...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/system/hacked_signal_handler.cpp", "license": "mit", "size": 1850}
### File: taichi/system/interface_registry.cpp #include <functional> #include "pybind11/pybind11.h" #include "taichi/common/interface.h" #include "taichi/common/task.h" #include "taichi/system/benchmark.h" namespace taichi { TI_INTERFACE_DEF(Benchmark, "benchmark") TI_INTERFACE_DEF(Task, "task") } // namespace tai...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/system/interface_registry.cpp", "license": "mit", "size": 277}
### File: taichi/system/loader.cpp /******************************************************************************* Copyright (c) The Taichi Authors (2016- ). All Rights Reserved. The use of this software is governed by the LICENSE file. **************************************************************************...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/system/loader.cpp", "license": "mit", "size": 292}
### File: taichi/system/memory_pool.cpp #include "memory_pool.h" #include "taichi/system/timer.h" #include "taichi/program/program.h" #include "taichi/backends/cuda/cuda_driver.h" TLANG_NAMESPACE_BEGIN MemoryPool::MemoryPool(Program *prog) : prog(prog) { TI_TRACE("Memory pool created. Default buffer size per alloca...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/system/memory_pool.cpp", "license": "mit", "size": 4034}
### File: taichi/system/memory_pool.h #pragma once #include "taichi/common/core.h" #include "taichi/system/unified_allocator.h" #define TI_RUNTIME_HOST #include "taichi/runtime/llvm/mem_request.h" #include <mutex> #include <vector> #include <memory> #include <thread> TLANG_NAMESPACE_BEGIN class Program; // A memory...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/system/memory_pool.h", "license": "mit", "size": 1127}
### File: taichi/system/profiler.cpp #include "taichi/system/profiler.h" TI_NAMESPACE_BEGIN // A profiler's records form a tree structure struct ProfilerRecordNode { std::vector<std::unique_ptr<ProfilerRecordNode>> childs; ProfilerRecordNode *parent; std::string name; float64 total_time; // Time per element...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/system/profiler.cpp", "license": "mit", "size": 7875}
### File: taichi/system/profiler.h /******************************************************************************* Copyright (c) The Taichi Authors (2016- ). All Rights Reserved. The use of this software is governed by the LICENSE file. **************************************************************************...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/system/profiler.h", "license": "mit", "size": 1372}
### File: taichi/system/run_tests.cpp /******************************************************************************* Copyright (c) The Taichi Authors (2016- ). All Rights Reserved. The use of this software is governed by the LICENSE file. ***********************************************************************...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/system/run_tests.cpp", "license": "mit", "size": 633}
### File: taichi/system/threading.cpp /******************************************************************************* Copyright (c) The Taichi Authors (2016- ). All Rights Reserved. The use of this software is governed by the LICENSE file. ***********************************************************************...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/system/threading.cpp", "license": "mit", "size": 4126}
### File: taichi/system/threading.h /******************************************************************************* Copyright (c) The Taichi Authors (2016- ). All Rights Reserved. The use of this software is governed by the LICENSE file. *************************************************************************...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/system/threading.h", "license": "mit", "size": 1900}
### File: taichi/system/timeline.cpp #include "taichi/system/timeline.h" TI_NAMESPACE_BEGIN std::string TimelineEvent::to_json() { std::string json{"{"}; json += fmt::format("\"cat\":\"taichi\","); json += fmt::format("\"pid\":0,"); json += fmt::format("\"tid\":\"{}\",", tid); json += fmt::format("\"ph\":\"...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/system/timeline.cpp", "license": "mit", "size": 3286}
### File: taichi/system/timeline.h #pragma once #include <vector> #include <mutex> #include "taichi/common/core.h" #include "taichi/system/timer.h" TI_NAMESPACE_BEGIN struct TimelineEvent { std::string name; bool begin; float64 time; std::string tid; std::string to_json(); }; class Timeline { public: ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/system/timeline.h", "license": "mit", "size": 1557}
### File: taichi/system/timer.cpp /******************************************************************************* Copyright (c) The Taichi Authors (2016- ). All Rights Reserved. The use of this software is governed by the LICENSE file. ***************************************************************************...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/system/timer.cpp", "license": "mit", "size": 5579}
### File: taichi/system/timer.h /******************************************************************************* Copyright (c) The Taichi Authors (2016- ). All Rights Reserved. The use of this software is governed by the LICENSE file. *****************************************************************************...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/system/timer.h", "license": "mit", "size": 2560}
### File: taichi/system/traceback.cpp /******************************************************************************* Copyright (c) The Taichi Authors (2016- ). All Rights Reserved. The use of this software is governed by the LICENSE file. ***********************************************************************...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/system/traceback.cpp", "license": "mit", "size": 11066}
### File: taichi/system/traceback.h #include "taichi/common/core.h" namespace taichi { TI_EXPORT void print_traceback(); } // namespace taichi
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/system/traceback.h", "license": "mit", "size": 111}
### File: taichi/system/unified_allocator.cpp // Virtual memory allocator for CPU/GPU #if defined(TI_WITH_CUDA) #include "taichi/backends/cuda/cuda_driver.h" #endif #include "taichi/lang_util.h" #include "taichi/system/unified_allocator.h" #include "taichi/system/virtual_memory.h" #include "taichi/system/timer.h" #inc...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/system/unified_allocator.cpp", "license": "mit", "size": 2714}
### File: taichi/system/unified_allocator.h #pragma once #include <mutex> #include <vector> #include <memory> #include "taichi/program/arch.h" namespace taichi { class VirtualMemoryAllocator; } TLANG_NAMESPACE_BEGIN // This class can only have one instance class UnifiedAllocator { std::unique_ptr<VirtualMemoryAll...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/system/unified_allocator.h", "license": "mit", "size": 1194}
### File: taichi/system/virtual_memory.h #pragma once #include "taichi/common/core.h" #if defined(TI_PLATFORM_UNIX) #include <sys/mman.h> #else #include "taichi/platform/windows/windows.h" #endif TI_NAMESPACE_BEGIN // Cross-platform virtual memory allocator class VirtualMemoryAllocator { public: static constexpr...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/system/virtual_memory.h", "license": "mit", "size": 1926}
### File: taichi/transforms/alg_simp.cpp #include "taichi/ir/analysis.h" #include "taichi/ir/ir.h" #include "taichi/ir/statements.h" #include "taichi/ir/transforms.h" #include "taichi/ir/visitors.h" #include "taichi/program/program.h" TLANG_NAMESPACE_BEGIN // Algebraic Simplification and Strength Reduction class AlgS...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/transforms/alg_simp.cpp", "license": "mit", "size": 12200}
### File: taichi/transforms/auto_diff.cpp #include "taichi/ir/analysis.h" #include "taichi/ir/frontend.h" #include "taichi/ir/ir.h" #include "taichi/ir/statements.h" #include "taichi/ir/transforms.h" #include "taichi/ir/visitors.h" #include <typeinfo> TLANG_NAMESPACE_BEGIN // Do automatic differentiation pass in the...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/transforms/auto_diff.cpp", "license": "mit", "size": 26216}
### File: taichi/transforms/binary_op_simplify.cpp #include "taichi/ir/ir.h" #include "taichi/ir/statements.h" #include "taichi/ir/transforms.h" #include "taichi/ir/visitors.h" #include "taichi/program/program.h" TLANG_NAMESPACE_BEGIN class BinaryOpSimp : public BasicStmtVisitor { public: using BasicStmtVisitor::v...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/transforms/binary_op_simplify.cpp", "license": "mit", "size": 4195}
### File: taichi/transforms/bit_loop_vectorize.cpp // The bit-level loop vectorizer #include "taichi/program/program.h" #include "taichi/ir/ir.h" #include "taichi/ir/type_factory.h" #include "taichi/ir/statements.h" #include "taichi/ir/transforms.h" #include "taichi/ir/visitors.h" #include "taichi/ir/analysis.h" TLAN...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/transforms/bit_loop_vectorize.cpp", "license": "mit", "size": 14513}
### File: taichi/transforms/cfg_optimization.cpp #include "taichi/ir/ir.h" #include "taichi/ir/control_flow_graph.h" #include "taichi/ir/transforms.h" #include "taichi/ir/analysis.h" #include "taichi/system/profiler.h" TLANG_NAMESPACE_BEGIN namespace irpass { bool cfg_optimization( IRNode *root, bool after_lo...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/transforms/cfg_optimization.cpp", "license": "mit", "size": 954}
### File: taichi/transforms/check_out_of_bound.cpp #include "taichi/ir/ir.h" #include "taichi/ir/statements.h" #include "taichi/ir/transforms.h" #include "taichi/ir/visitors.h" #include "taichi/transforms/check_out_of_bound.h" #include <set> TLANG_NAMESPACE_BEGIN // TODO: also check RangeAssumptionStmt class CheckOu...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/transforms/check_out_of_bound.cpp", "license": "mit", "size": 4404}
### File: taichi/transforms/check_out_of_bound.h #pragma once #include "taichi/ir/pass.h" namespace taichi { namespace lang { class CheckOutOfBoundPass : public Pass { public: static const PassID id; struct Args { std::string kernel_name; }; }; } // namespace lang } // namespace taichi
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/transforms/check_out_of_bound.h", "license": "mit", "size": 256}
### File: taichi/transforms/compile_to_offloads.cpp #include "taichi/ir/ir.h" #include "taichi/ir/transforms.h" #include "taichi/ir/analysis.h" #include "taichi/ir/pass.h" #include "taichi/ir/visitors.h" #include "taichi/program/compile_config.h" #include "taichi/program/extension.h" #include "taichi/program/kernel.h" ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/transforms/compile_to_offloads.cpp", "license": "mit", "size": 7275}
### File: taichi/transforms/constant_fold.cpp #include <cmath> #include <deque> #include <set> #include <thread> #include "taichi/ir/ir.h" #include "taichi/ir/snode.h" #include "taichi/ir/statements.h" #include "taichi/ir/transforms.h" #include "taichi/ir/visitors.h" #include "taichi/transforms/constant_fold.h" TLANG...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/transforms/constant_fold.cpp", "license": "mit", "size": 7662}
### File: taichi/transforms/constant_fold.h #pragma once #include "taichi/ir/pass.h" #include "taichi/program/program.h" namespace taichi { namespace lang { class ConstantFoldPass : public Pass { public: static const PassID id; struct Args { Program *program; }; }; } // namespace lang } // namespace t...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/transforms/constant_fold.h", "license": "mit", "size": 282}
### File: taichi/transforms/demote_atomics.cpp #include "taichi/ir/analysis.h" #include "taichi/ir/ir.h" #include "taichi/ir/statements.h" #include "taichi/ir/transforms.h" #include "taichi/ir/visitors.h" #include "taichi/system/profiler.h" #include <deque> #include <set> TLANG_NAMESPACE_BEGIN class DemoteAtomics : ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/transforms/demote_atomics.cpp", "license": "mit", "size": 5032}
### File: taichi/transforms/demote_dense_struct_fors.cpp #include "taichi/ir/ir.h" #include "taichi/ir/statements.h" #include "taichi/ir/transforms.h" #include "taichi/ir/visitors.h" TLANG_NAMESPACE_BEGIN namespace { using TaskType = OffloadedStmt::TaskType; void convert_to_range_for(OffloadedStmt *offloaded) { T...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/transforms/demote_dense_struct_fors.cpp", "license": "mit", "size": 4768}
### File: taichi/transforms/demote_operations.cpp #include "taichi/ir/ir.h" #include "taichi/ir/statements.h" #include "taichi/ir/transforms.h" #include "taichi/ir/visitors.h" #include "taichi/program/program.h" TLANG_NAMESPACE_BEGIN // Demote Operations into pieces for backends to deal easier class DemoteOperations ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/transforms/demote_operations.cpp", "license": "mit", "size": 6022}
### File: taichi/transforms/detect_read_only.cpp #include "taichi/ir/ir.h" #include "taichi/ir/statements.h" #include "taichi/ir/analysis.h" #include "taichi/ir/visitors.h" #include <algorithm> TLANG_NAMESPACE_BEGIN namespace irpass { namespace { void detect_read_only_in_task(OffloadedStmt *offload) { auto acces...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/transforms/detect_read_only.cpp", "license": "mit", "size": 853}
### File: taichi/transforms/die.cpp // Dead Instruction Elimination #include "taichi/ir/ir.h" #include "taichi/ir/statements.h" #include "taichi/ir/transforms.h" #include "taichi/ir/visitors.h" #include "taichi/system/profiler.h" #include <unordered_set> TLANG_NAMESPACE_BEGIN // Dead Instruction Elimination class D...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/transforms/die.cpp", "license": "mit", "size": 2350}
### File: taichi/transforms/extract_constant.cpp #include "taichi/ir/ir.h" #include "taichi/ir/statements.h" #include "taichi/ir/transforms.h" #include "taichi/ir/visitors.h" #include "taichi/program/compile_config.h" TLANG_NAMESPACE_BEGIN class ExtractConstant : public BasicStmtVisitor { private: Block *top_level...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/transforms/extract_constant.cpp", "license": "mit", "size": 1527}
### File: taichi/transforms/flag_access.cpp #include "taichi/ir/ir.h" #include "taichi/ir/statements.h" #include "taichi/ir/transforms.h" #include "taichi/ir/visitors.h" #include "taichi/system/profiler.h" TLANG_NAMESPACE_BEGIN // Flag accesses to be either weak (non-activating) or strong (activating) class FlagAcces...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/transforms/flag_access.cpp", "license": "mit", "size": 4500}
### File: taichi/transforms/insert_scratch_pad.cpp #include "taichi/ir/ir.h" #include "taichi/ir/statements.h" #include "taichi/ir/transforms.h" #include "taichi/ir/analysis.h" #include "taichi/ir/visitors.h" #include "taichi/ir/scratch_pad.h" #include "taichi/system/profiler.h" TLANG_NAMESPACE_BEGIN // TODO: rename ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/transforms/insert_scratch_pad.cpp", "license": "mit", "size": 4505}
### File: taichi/transforms/ir_printer.cpp // The IRPrinter prints the IR in a human-readable format #include "taichi/ir/ir.h" #include "taichi/ir/statements.h" #include "taichi/ir/transforms.h" #include "taichi/ir/visitors.h" #include "taichi/ir/frontend_ir.h" #include "taichi/util/str.h" TLANG_NAMESPACE_BEGIN name...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/transforms/ir_printer.cpp", "license": "mit", "size": 20607}
### File: taichi/transforms/loop_vectorize.cpp // The loop vectorizer #include "taichi/program/program.h" #include "taichi/ir/ir.h" #include "taichi/ir/type_factory.h" #include "taichi/ir/statements.h" #include "taichi/ir/transforms.h" #include "taichi/ir/visitors.h" TLANG_NAMESPACE_BEGIN // Lower Expr tree to a bun...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/transforms/loop_vectorize.cpp", "license": "mit", "size": 4978}
### File: taichi/transforms/lower_access.cpp #include "taichi/ir/ir.h" #include "taichi/ir/statements.h" #include "taichi/ir/transforms.h" #include "taichi/ir/analysis.h" #include "taichi/ir/visitors.h" #include "taichi/program/kernel.h" #include "taichi/program/program.h" #include "taichi/transforms/lower_access.h" #...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/transforms/lower_access.cpp", "license": "mit", "size": 10048}
### File: taichi/transforms/lower_access.h #pragma once #include "taichi/ir/pass.h" namespace taichi { namespace lang { class LowerAccessPass : public Pass { public: static const PassID id; struct Args { std::vector<SNode *> kernel_forces_no_activate; bool lower_atomic; }; }; } // namespace lang } ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/transforms/lower_access.h", "license": "mit", "size": 298}
### File: taichi/transforms/lower_ast.cpp #include "taichi/ir/ir.h" #include "taichi/ir/statements.h" #include "taichi/ir/transforms.h" #include "taichi/ir/analysis.h" #include "taichi/ir/visitors.h" #include "taichi/ir/frontend_ir.h" #include "taichi/system/profiler.h" #include <unordered_set> TLANG_NAMESPACE_BEGIN ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/transforms/lower_ast.cpp", "license": "mit", "size": 16065}
### File: taichi/transforms/make_block_local.cpp #include "taichi/ir/ir.h" #include "taichi/ir/statements.h" #include "taichi/ir/transforms.h" #include "taichi/ir/analysis.h" #include "taichi/ir/scratch_pad.h" #include "taichi/transforms/make_block_local.h" TLANG_NAMESPACE_BEGIN namespace { void make_block_local_off...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/transforms/make_block_local.cpp", "license": "mit", "size": 12989}
### File: taichi/transforms/make_block_local.h #pragma once #include "taichi/ir/pass.h" namespace taichi { namespace lang { class MakeBlockLocalPass : public Pass { public: static const PassID id; struct Args { std::string kernel_name; }; }; } // namespace lang } // namespace taichi
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/transforms/make_block_local.h", "license": "mit", "size": 255}
### File: taichi/transforms/make_thread_local.cpp #include <algorithm> #include <functional> #include <iterator> #include <type_traits> #include "taichi/ir/analysis.h" #include "taichi/ir/ir.h" #include "taichi/ir/statements.h" #include "taichi/ir/transforms.h" #include "taichi/ir/visitors.h" #include "taichi/system/p...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/transforms/make_thread_local.cpp", "license": "mit", "size": 7243}
### File: taichi/transforms/offload.cpp #include "taichi/ir/ir.h" #include "taichi/ir/statements.h" #include "taichi/ir/transforms.h" #include "taichi/ir/analysis.h" #include "taichi/ir/visitors.h" #include "taichi/program/program.h" #include <set> #include <unordered_map> #include <utility> TLANG_NAMESPACE_BEGIN na...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/transforms/offload.cpp", "license": "mit", "size": 23033}
### File: taichi/transforms/optimize_bit_struct_stores.cpp #include "taichi/ir/analysis.h" #include "taichi/ir/ir.h" #include "taichi/ir/pass.h" #include "taichi/ir/statements.h" #include "taichi/ir/transforms.h" #include "taichi/ir/visitors.h" #include "taichi/program/compile_config.h" namespace { using namespace ta...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/transforms/optimize_bit_struct_stores.cpp", "license": "mit", "size": 6892}
### File: taichi/transforms/re_id.cpp #include "taichi/ir/ir.h" #include "taichi/ir/transforms.h" #include "taichi/ir/visitors.h" TLANG_NAMESPACE_BEGIN // This pass manipulates the id of statements so that they are successive values // starting from 0 class ReId : public BasicStmtVisitor { public: using BasicStmtV...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/transforms/re_id.cpp", "license": "mit", "size": 818}
### File: taichi/transforms/remove_assume_in_range.cpp #include "taichi/ir/ir.h" #include "taichi/ir/statements.h" #include "taichi/ir/transforms.h" #include "taichi/ir/visitors.h" #include "taichi/system/profiler.h" TLANG_NAMESPACE_BEGIN namespace { // Remove all the assume in range statements. // These statements ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/transforms/remove_assume_in_range.cpp", "license": "mit", "size": 925}
### File: taichi/transforms/remove_loop_unique.cpp #include "taichi/ir/ir.h" #include "taichi/ir/statements.h" #include "taichi/ir/transforms.h" #include "taichi/ir/visitors.h" #include "taichi/system/profiler.h" TLANG_NAMESPACE_BEGIN namespace { // Remove all the loop_unique statements. class RemoveLoopUnique : pu...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/transforms/remove_loop_unique.cpp", "license": "mit", "size": 790}
### File: taichi/transforms/reverse_segments.cpp #include "taichi/ir/ir.h" #include "taichi/ir/transforms.h" #include "taichi/ir/visitors.h" #include "taichi/ir/frontend_ir.h" #include "taichi/system/profiler.h" #include <set> TLANG_NAMESPACE_BEGIN namespace irpass { // TODO: gather Expr as well? class GatherStmts ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/transforms/reverse_segments.cpp", "license": "mit", "size": 2086}
### File: taichi/transforms/simplify.cpp #include "taichi/ir/ir.h" #include "taichi/ir/statements.h" #include "taichi/ir/transforms.h" #include "taichi/ir/analysis.h" #include "taichi/ir/visitors.h" #include "taichi/transforms/simplify.h" #include "taichi/program/kernel.h" #include "taichi/program/program.h" #include <...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/transforms/simplify.cpp", "license": "mit", "size": 22589}
### File: taichi/transforms/simplify.h #pragma once #include "taichi/ir/pass.h" namespace taichi { namespace lang { class SimplifyPass : public Pass { public: static const PassID id; struct Args { Kernel *kernel; }; }; class FullSimplifyPass : public Pass { public: static const PassID id; struct A...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/transforms/simplify.h", "license": "mit", "size": 389}
### File: taichi/transforms/statement_replace.cpp #include "taichi/ir/ir.h" #include "taichi/ir/statements.h" #include "taichi/ir/transforms.h" #include "taichi/ir/visitors.h" TLANG_NAMESPACE_BEGIN // Replace both usages and the statements themselves class StatementReplace : public IRVisitor { public: IRNode *node...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/transforms/statement_replace.cpp", "license": "mit", "size": 2114}
### File: taichi/transforms/statement_usage_replace.cpp #include "taichi/ir/ir.h" #include "taichi/ir/statements.h" #include "taichi/ir/transforms.h" #include "taichi/ir/visitors.h" #include "taichi/system/profiler.h" TLANG_NAMESPACE_BEGIN // Replace all usages statement A with a new statement B. // Note that the ori...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/transforms/statement_usage_replace.cpp", "license": "mit", "size": 2520}
### File: taichi/transforms/type_check.cpp // Type checking #include "taichi/ir/ir.h" #include "taichi/ir/statements.h" #include "taichi/ir/transforms.h" #include "taichi/ir/analysis.h" #include "taichi/ir/visitors.h" #include "taichi/ir/frontend.h" TLANG_NAMESPACE_BEGIN // "Type" here does not include vector width ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/transforms/type_check.cpp", "license": "mit", "size": 16758}
### File: taichi/transforms/unreachable_code_elimination.cpp #include "taichi/ir/ir.h" #include "taichi/ir/statements.h" #include "taichi/ir/transforms.h" #include "taichi/ir/visitors.h" #include "taichi/system/profiler.h" TLANG_NAMESPACE_BEGIN // Unconditionally eliminate ContinueStmt's at **ends** of loops class Us...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/transforms/unreachable_code_elimination.cpp", "license": "mit", "size": 4111}
### File: taichi/transforms/variable_optimization.cpp #include "taichi/ir/ir.h" #include "taichi/ir/analysis.h" #include "taichi/ir/statements.h" #include "taichi/ir/transforms.h" #include "taichi/ir/visitors.h" #include "taichi/ir/state_machine.h" #include "taichi/program/compile_config.h" #include <unordered_map> T...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/Taichi", "path": "taichi/transforms/variable_optimization.cpp", "license": "mit", "size": 18103}