text stringlengths 24 1.04M | metadata stringlengths 233 497 |
|---|---|
### File: taichi/analysis/detect_fors_with_break.cpp
#include "taichi/ir/ir.h"
#include "taichi/ir/analysis.h"
#include "taichi/ir/visitors.h"
#include "taichi/ir/frontend_ir.h"
#include <unordered_set>
TLANG_NAMESPACE_BEGIN
class DetectForsWithBreak : public BasicStmtVisitor {
public:
using BasicStmtVisitor::vis... | {"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/analysis/detect_fors_with_break.cpp", "license": "mit", "size": 1265} |
### File: taichi/analysis/gather_deactivations.cpp
#include "taichi/ir/ir.h"
#include "taichi/ir/analysis.h"
#include "taichi/ir/statements.h"
#include "taichi/ir/visitors.h"
TLANG_NAMESPACE_BEGIN
class GatherDeactivations : public BasicStmtVisitor {
public:
using BasicStmtVisitor::visit;
std::unordered_set<SNo... | {"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/analysis/gather_deactivations.cpp", "license": "mit", "size": 858} |
### File: taichi/analysis/gather_snode_read_writes.cpp
#include "taichi/ir/ir.h"
#include "taichi/ir/snode.h"
#include "taichi/ir/visitors.h"
#include "taichi/ir/analysis.h"
#include "taichi/ir/statements.h"
TLANG_NAMESPACE_BEGIN
namespace irpass::analysis {
// Returns the set of SNodes that are read or written
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/analysis/gather_snode_read_writes.cpp", "license": "mit", "size": 1326} |
### File: taichi/analysis/gather_statements.cpp
#include "taichi/ir/ir.h"
#include "taichi/ir/analysis.h"
#include "taichi/ir/visitors.h"
TLANG_NAMESPACE_BEGIN
class StmtSearcher : public BasicStmtVisitor {
private:
std::function<bool(Stmt *)> test;
std::vector<Stmt *> results;
public:
using BasicStmtVisitor... | {"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/analysis/gather_statements.cpp", "license": "mit", "size": 985} |
### File: taichi/analysis/gather_uniquely_accessed_pointers.cpp
#include "taichi/analysis/gather_uniquely_accessed_pointers.h"
#include "taichi/ir/ir.h"
#include "taichi/ir/analysis.h"
#include "taichi/ir/statements.h"
#include "taichi/ir/visitors.h"
#include <algorithm>
TLANG_NAMESPACE_BEGIN
class LoopUniqueStmtSear... | {"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/analysis/gather_uniquely_accessed_pointers.cpp", "license": "mit", "size": 8259} |
### File: taichi/analysis/gather_uniquely_accessed_pointers.h
#pragma once
#include "taichi/ir/pass.h"
namespace taichi {
namespace lang {
class GatherUniquelyAccessedBitStructsPass : public Pass {
public:
static const PassID id;
struct Result {
std::unordered_map<OffloadedStmt *,
st... | {"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/analysis/gather_uniquely_accessed_pointers.h", "license": "mit", "size": 400} |
### File: taichi/analysis/gather_used_atomics.cpp
#include "taichi/ir/ir.h"
#include "taichi/ir/analysis.h"
#include "taichi/ir/statements.h"
#include "taichi/ir/visitors.h"
#include <unordered_set>
TLANG_NAMESPACE_BEGIN
class UsedAtomicsSearcher : public BasicStmtVisitor {
private:
std::unique_ptr<std::unordered_... | {"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/analysis/gather_used_atomics.cpp", "license": "mit", "size": 1305} |
### File: taichi/analysis/has_store_or_atomic.cpp
#include "taichi/ir/ir.h"
#include "taichi/ir/analysis.h"
#include "taichi/ir/statements.h"
#include "taichi/ir/visitors.h"
TLANG_NAMESPACE_BEGIN
// Find if there is a store (or AtomicOpStmt).
class LocalStoreSearcher : public BasicStmtVisitor {
private:
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/analysis/has_store_or_atomic.cpp", "license": "mit", "size": 1299} |
### File: taichi/analysis/last_store_or_atomic.cpp
#include "taichi/ir/ir.h"
#include "taichi/ir/analysis.h"
#include "taichi/ir/statements.h"
#include "taichi/ir/visitors.h"
TLANG_NAMESPACE_BEGIN
// Find the **last** store, or return invalid if there is an AtomicOpStmt
// after the last store.
class LocalStoreForwar... | {"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/analysis/last_store_or_atomic.cpp", "license": "mit", "size": 3667} |
### File: taichi/analysis/same_statements.cpp
#include "taichi/ir/ir.h"
#include "taichi/ir/analysis.h"
#include "taichi/ir/statements.h"
#include "taichi/ir/visitors.h"
#include "taichi/program/async_utils.h"
#include "taichi/program/ir_bank.h"
#include <unordered_map>
#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/analysis/same_statements.cpp", "license": "mit", "size": 13267} |
### File: taichi/analysis/value_diff.cpp
// This pass analyzes compile-time known offsets for two values.
#include "taichi/ir/ir.h"
#include "taichi/ir/analysis.h"
#include "taichi/ir/statements.h"
#include "taichi/ir/visitors.h"
namespace taichi {
namespace lang {
DiffRange operator+(const DiffRange &a, const DiffR... | {"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/analysis/value_diff.cpp", "license": "mit", "size": 6262} |
### File: taichi/analysis/verify.cpp
#include <vector>
#include <unordered_set>
#include "taichi/ir/ir.h"
#include "taichi/ir/analysis.h"
#include "taichi/ir/statements.h"
#include "taichi/ir/visitors.h"
#include "taichi/ir/transforms.h"
#include "taichi/system/profiler.h"
TLANG_NAMESPACE_BEGIN
class IRVerifier : 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/analysis/verify.cpp", "license": "mit", "size": 4702} |
### File: taichi/backends/cc/cc_kernel.h
#pragma once
#include "taichi/lang_util.h"
#include <set>
TLANG_NAMESPACE_BEGIN
class Kernel;
namespace cccp {
class CCProgram;
class CCKernel {
public:
CCKernel(CCProgram *program,
Kernel *kernel,
std::string const &source,
std::string ... | {"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/backends/cc/cc_kernel.h", "license": "mit", "size": 657} |
### File: taichi/backends/cc/cc_layout.h
#pragma once
#include "taichi/lang_util.h"
TLANG_NAMESPACE_BEGIN
namespace cccp {
class CCProgram;
class CCLayout {
public:
CCLayout(CCProgram *program) : program(program) {
}
std::string get_object() {
return obj_path;
}
size_t compile();
std::string sou... | {"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/backends/cc/cc_layout.h", "license": "mit", "size": 411} |
### File: taichi/backends/cc/cc_program.cpp
#include "taichi/common/core.h"
#include "taichi/program/kernel.h"
#include "taichi/program/program.h"
#include "taichi/system/dynamic_loader.h"
#include "taichi/util/action_recorder.h"
#include "struct_cc.h"
#include "cc_program.h"
#include "cc_runtime.h"
#include "cc_kernel... | {"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/backends/cc/cc_program.cpp", "license": "mit", "size": 6593} |
### File: taichi/backends/cc/cc_program.h
#pragma once
#include "taichi/lang_util.h"
#include <vector>
#include <memory>
TI_NAMESPACE_BEGIN
class DynamicLoader;
TI_NAMESPACE_END
TLANG_NAMESPACE_BEGIN
class SNode;
struct Context;
namespace cccp {
class CCKernel;
class CCLayout;
class CCRuntime;
struct CCContext;
... | {"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/backends/cc/cc_program.h", "license": "mit", "size": 1272} |
### File: taichi/backends/cc/cc_runtime.h
#pragma once
#include "taichi/lang_util.h"
TLANG_NAMESPACE_BEGIN
namespace cccp {
class CCProgram;
class CCRuntime {
public:
CCRuntime(CCProgram *program,
std::string const &header,
std::string const &source)
: header(header), source(source)... | {"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/backends/cc/cc_runtime.h", "license": "mit", "size": 566} |
### File: taichi/backends/cc/cc_utils.h
#pragma once
#include "taichi/lang_util.h"
#include "taichi/common/core.h"
#include <fstream>
#include <sstream>
#include <cstdlib>
#include <iomanip>
TLANG_NAMESPACE_BEGIN
namespace cccp {
inline std::string cc_data_type_name(DataType dt) {
return "Ti_" + data_type_name(dt)... | {"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/backends/cc/cc_utils.h", "license": "mit", "size": 1915} |
### File: taichi/backends/cc/codegen_cc.cpp
#include "codegen_cc.h"
#include "cc_kernel.h"
#include "cc_layout.h"
#include "taichi/ir/ir.h"
#include "taichi/ir/statements.h"
#include "taichi/ir/transforms.h"
#include "taichi/util/line_appender.h"
#include "taichi/util/str.h"
#include "cc_utils.h"
#define C90_COMPAT 0
... | {"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/backends/cc/codegen_cc.cpp", "license": "mit", "size": 21439} |
### File: taichi/backends/cc/codegen_cc.h
#pragma once
#include "taichi/lang_util.h"
#include "taichi/codegen/codegen.h"
TLANG_NAMESPACE_BEGIN
namespace cccp {
class CCKernel;
class CCKernelGen {
// Generate corresponding C Source Code for a Taichi Kernel
public:
CCKernelGen(Kernel *kernel) : kernel(kernel) {
... | {"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/backends/cc/codegen_cc.h", "license": "mit", "size": 442} |
### File: taichi/backends/cc/context.h
#ifdef _CC_INSIDE_KERNEL
#include "taichi/util/macros.h"
// clang-format off
STR(
union Ti_BitCast {
Ti_i64 val_i64;
Ti_i32 val_i32;
Ti_i16 val_i16;
Ti_i8 val_i8;
Ti_u64 val_u64;
Ti_u32 val_u32;
Ti_u16 val_u16;
Ti_u8 val_u8;
Ti_f32 val_f32;
Ti_f64 val_f64;
Ti... | {"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/backends/cc/context.h", "license": "mit", "size": 965} |
### File: taichi/backends/cc/runtime/base.c
// vim: ft=c
// clang-format off
#include "taichi/util/macros.h"
STR(
)
| {"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/backends/cc/runtime/base.c", "license": "mit", "size": 72} |
### File: taichi/backends/cc/runtime/base.h
// vim: ft=c
// clang-format off
#include "taichi/util/macros.h"
"#include <stdio.h>\n"
"#include <stdlib.h>\n"
"#include <math.h>\n"
"\n" STR(
typedef char Ti_i8;
typedef short Ti_i16;
typedef int Ti_i32;
typedef long long Ti_i64;
typedef unsigned char Ti_u8;
typedef unsign... | {"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/backends/cc/runtime/base.h", "license": "mit", "size": 3349} |
### File: taichi/backends/cc/struct_cc.cpp
#include "struct_cc.h"
#include "cc_layout.h"
#include "cc_utils.h"
TLANG_NAMESPACE_BEGIN
namespace cccp {
void CCLayoutGen::generate_children(SNode *snode) {
ScopedIndent _s(line_appender);
for (auto const &ch : snode->ch) {
generate_types(ch.get());
}
}
void CCL... | {"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/backends/cc/struct_cc.cpp", "license": "mit", "size": 1273} |
### File: taichi/backends/cc/struct_cc.h
#pragma once
#include "taichi/lang_util.h"
#include "taichi/util/line_appender.h"
#include "taichi/ir/snode.h"
TLANG_NAMESPACE_BEGIN
namespace cccp {
class CCLayout;
class CCProgram;
class CCLayoutGen {
// Generate corresponding C Source Code for Taichi Structures
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/backends/cc/struct_cc.h", "license": "mit", "size": 778} |
### File: taichi/backends/cpu/codegen_cpu.cpp
#include "taichi/backends/cpu/codegen_cpu.h"
#include "taichi/codegen/codegen_llvm.h"
#include "taichi/common/core.h"
#include "taichi/util/io.h"
#include "taichi/lang_util.h"
#include "taichi/program/program.h"
#include "taichi/ir/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/backends/cpu/codegen_cpu.cpp", "license": "mit", "size": 4201} |
### File: taichi/backends/cpu/codegen_cpu.h
// x86 backend implementation
#pragma once
#include "taichi/codegen/codegen.h"
TLANG_NAMESPACE_BEGIN
class CodeGenCPU : public KernelCodeGen {
public:
CodeGenCPU(Kernel *kernel, IRNode *ir = nullptr) : KernelCodeGen(kernel, ir) {
}
virtual FunctionType codegen() o... | {"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/backends/cpu/codegen_cpu.h", "license": "mit", "size": 309} |
### File: taichi/backends/cpu/jit_cpu.cpp
// A LLVM JIT compiler for CPU archs wrapper
#include <memory>
#include "llvm/Analysis/TargetTransformInfo.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ExecutionEngine/ExecutionEngine.h"
#include "llvm/ExecutionEngine/JITSymbol.h"
#include "llvm/ExecutionEngine/Orc/Core.... | {"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/backends/cpu/jit_cpu.cpp", "license": "mit", "size": 9188} |
### File: taichi/backends/cuda/codegen_cuda.cpp
#include "codegen_cuda.h"
#include <vector>
#include <set>
#include "taichi/common/core.h"
#include "taichi/util/io.h"
#include "taichi/util/statistics.h"
#include "taichi/ir/ir.h"
#include "taichi/ir/statements.h"
#include "taichi/program/program.h"
#include "taichi/la... | {"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/backends/cuda/codegen_cuda.cpp", "license": "mit", "size": 20287} |
### File: taichi/backends/cuda/codegen_cuda.h
// The CUDA backend
#pragma once
#include "taichi/codegen/codegen.h"
TLANG_NAMESPACE_BEGIN
class CodeGenCUDA : public KernelCodeGen {
public:
CodeGenCUDA(Kernel *kernel, IRNode *ir = nullptr)
: KernelCodeGen(kernel, ir) {
}
virtual FunctionType codegen() o... | {"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/backends/cuda/codegen_cuda.h", "license": "mit", "size": 307} |
### File: taichi/backends/cuda/cuda_context.cpp
#define TI_RUNTIME_HOST
#include "cuda_context.h"
#include <unordered_map>
#include <mutex>
#include "taichi/lang_util.h"
#include "taichi/program/program.h"
#include "taichi/system/threading.h"
#include "taichi/backends/cuda/cuda_driver.h"
TLANG_NAMESPACE_BEGIN
CUDAC... | {"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/backends/cuda/cuda_context.cpp", "license": "mit", "size": 3617} |
### File: taichi/backends/cuda/cuda_context.h
#pragma once
#include <mutex>
#include <unordered_map>
#include <thread>
#include "taichi/program/kernel_profiler.h"
#include "taichi/backends/cuda/cuda_driver.h"
TLANG_NAMESPACE_BEGIN
// Note:
// It would be ideal to create a CUDA context per Taichi program, yet CUDA
/... | {"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/backends/cuda/cuda_context.h", "license": "mit", "size": 2020} |
### File: taichi/backends/cuda/cuda_driver.cpp
#include "taichi/backends/cuda/cuda_driver.h"
#include "taichi/system/dynamic_loader.h"
#include "taichi/backends/cuda/cuda_context.h"
#include "taichi/util/environ_config.h"
TLANG_NAMESPACE_BEGIN
std::string get_cuda_error_message(uint32 err) {
const char *err_name_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/backends/cuda/cuda_driver.cpp", "license": "mit", "size": 2181} |
### File: taichi/backends/cuda/cuda_driver.h
#pragma once
#include <mutex>
#include "taichi/system/dynamic_loader.h"
#if (0)
// Turn on to check for comptability
namespace taichi {
static_assert(sizeof(CUresult) == sizeof(uint32));
static_assert(sizeof(CUmem_advise) == sizeof(uint32));
static_assert(sizeof(CUdevice)... | {"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/backends/cuda/cuda_driver.h", "license": "mit", "size": 3114} |
### File: taichi/backends/cuda/cuda_driver_functions.inc.h
// clang-format off
// Driver
PER_CUDA_FUNCTION(init, cuInit, int);
PER_CUDA_FUNCTION(driver_get_version, cuDriverGetVersion, int*);
// Device management
PER_CUDA_FUNCTION(device_get_count, cuDeviceGetCount, int *);
PER_CUDA_FUNCTION(device_get, cuDeviceGet, ... | {"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/backends/cuda/cuda_driver_functions.inc.h", "license": "mit", "size": 2459} |
### File: taichi/backends/cuda/jit_cuda.cpp
#include <memory>
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/DynamicLibrary.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/LegacyPassManager.h"
#in... | {"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/backends/cuda/jit_cuda.cpp", "license": "mit", "size": 10881} |
### File: taichi/backends/cuda/runtime.cpp
#include "taichi/runtime/runtime.h"
#include "taichi/backends/cuda/cuda_context.h"
TLANG_NAMESPACE_BEGIN
#if !defined(TI_WITH_CUDA)
static_assert(
false,
"This file should not be compiled when TI_WITH_CUDA is undefined");
#endif
class RuntimeCUDA : 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/backends/cuda/runtime.cpp", "license": "mit", "size": 800} |
### File: taichi/backends/metal/api.cpp
#include "taichi/backends/metal/api.h"
#include "taichi/backends/metal/constants.h"
#include "taichi/util/environ_config.h"
TLANG_NAMESPACE_BEGIN
namespace metal {
#ifdef TI_PLATFORM_OSX
extern "C" {
id MTLCreateSystemDefaultDevice();
id MTLCopyAllDevices();
}
namespace {
... | {"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/backends/metal/api.cpp", "license": "mit", "size": 6018} |
### File: taichi/backends/metal/api.h
#pragma once
// Reference implementation:
// https://github.com/halide/Halide/blob/master/src/runtime/metal.cpp
#include <string>
#include "taichi/common/trait.h"
#include "taichi/lang_util.h"
#include "taichi/platform/mac/objc_api.h"
TLANG_NAMESPACE_BEGIN
namespace metal {
/... | {"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/backends/metal/api.h", "license": "mit", "size": 5637} |
### File: taichi/backends/metal/codegen_metal.cpp
#include "codegen_metal.h"
#include <functional>
#include <string>
#include "taichi/backends/metal/api.h"
#include "taichi/backends/metal/constants.h"
#include "taichi/backends/metal/env_config.h"
#include "taichi/backends/metal/features.h"
#include "taichi/ir/ir.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/backends/metal/codegen_metal.cpp", "license": "mit", "size": 55599} |
### File: taichi/backends/metal/codegen_metal.h
#pragma once
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include "taichi/inc/constants.h"
#include "taichi/lang_util.h"
#include "taichi/program/program.h"
#include "taichi/backends/metal/data_types.h"
#include "taichi/backends... | {"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/backends/metal/codegen_metal.h", "license": "mit", "size": 828} |
### File: taichi/backends/metal/constants.h
#pragma once
#include <string>
#include "taichi/lang_util.h"
TLANG_NAMESPACE_BEGIN
namespace metal {
inline constexpr int kMaxNumThreadsGridStrideLoop = 64 * 1024;
inline constexpr int kNumRandSeeds = 64 * 1024; // 256 KB is nothing
inline constexpr int kMslVersionNone =... | {"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/backends/metal/constants.h", "license": "mit", "size": 323} |
### File: taichi/backends/metal/data_types.cpp
#include "taichi/backends/metal/data_types.h"
TLANG_NAMESPACE_BEGIN
namespace metal {
MetalDataType to_metal_type(DataType dt) {
dt.set_is_pointer(false);
#define METAL_CASE(x) \
else if (dt->is_primitive(PrimitiveTypeID::x)) return MetalDataType::x
if (false) {
... | {"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/backends/metal/data_types.cpp", "license": "mit", "size": 3025} |
### File: taichi/backends/metal/data_types.h
#pragma once
#include <string>
#include "taichi/lang_util.h"
TLANG_NAMESPACE_BEGIN
namespace metal {
enum class MetalDataType : int {
f32,
f64,
i8,
i16,
i32,
i64,
u8,
u16,
u32,
u64,
// ptr,
// none, // "void"
unknown
};
MetalDataType to_metal_... | {"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/backends/metal/data_types.h", "license": "mit", "size": 924} |
### File: taichi/backends/metal/env_config.cpp
#include "taichi/backends/metal/env_config.h"
#include "taichi/lang_util.h"
#include "taichi/util/environ_config.h"
TLANG_NAMESPACE_BEGIN
namespace metal {
EnvConfig::EnvConfig() {
simdgroup_enabled_ =
get_environ_config("TI_USE_METAL_SIMDGROUP", /*default_value... | {"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/backends/metal/env_config.cpp", "license": "mit", "size": 410} |
### File: taichi/backends/metal/env_config.h
#pragma once
#include "taichi/lang_util.h"
TLANG_NAMESPACE_BEGIN
namespace metal {
// Metal specific config inferred from the environment.
class EnvConfig {
public:
// Set TI_USE_METAL_SIMDGROUP=0 to disable SIMD group.
// This is an ad-hoc thing. Apple claims that 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/backends/metal/env_config.h", "license": "mit", "size": 722} |
### File: taichi/backends/metal/features.h
#pragma once
#include <string>
#include "taichi/lang_util.h"
TLANG_NAMESPACE_BEGIN
namespace metal {
inline bool is_supported_sparse_type(SNodeType t) {
return t == SNodeType::bitmasked || t == SNodeType::dynamic;
}
} // namespace metal
TLANG_NAMESPACE_END
| {"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/backends/metal/features.h", "license": "mit", "size": 266} |
### File: taichi/backends/metal/kernel_manager.cpp
#include "taichi/backends/metal/kernel_manager.h"
#include <algorithm>
#include <chrono>
#include <cstring>
#include <limits>
#include <random>
#include <string_view>
#include "taichi/backends/metal/constants.h"
#include "taichi/inc/constants.h"
#include "taichi/math... | {"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/backends/metal/kernel_manager.cpp", "license": "mit", "size": 39909} |
### File: taichi/backends/metal/kernel_manager.h
#pragma once
#include <memory>
#include <string>
#include <unordered_map>
#include <vector>
#include "taichi/backends/metal/kernel_util.h"
#include "taichi/backends/metal/struct_metal.h"
#include "taichi/lang_util.h"
#include "taichi/program/compile_config.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/backends/metal/kernel_manager.h", "license": "mit", "size": 2429} |
### File: taichi/backends/metal/kernel_util.cpp
#include "taichi/backends/metal/kernel_util.h"
#include <unordered_map>
#include "taichi/program/kernel.h"
#define TI_RUNTIME_HOST
#include "taichi/program/context.h"
#undef TI_RUNTIME_HOST
TLANG_NAMESPACE_BEGIN
namespace metal {
int PrintStringTable::put(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/backends/metal/kernel_util.cpp", "license": "mit", "size": 3555} |
### File: taichi/backends/metal/kernel_util.h
#pragma once
#include <optional>
#include <string>
#include <vector>
#include "taichi/ir/offloaded_task_type.h"
#include "taichi/backends/metal/data_types.h"
// Data structures defined in this file may overlap with some of the Taichi data
// structures. However, they ser... | {"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/backends/metal/kernel_util.h", "license": "mit", "size": 5619} |
### File: taichi/backends/metal/shaders/ad_stack.metal.h
#include "taichi/backends/metal/shaders/prolog.h"
#ifdef TI_INSIDE_METAL_CODEGEN
#ifndef TI_METAL_NESTED_INCLUDE
#define METAL_BEGIN_AD_STACK_DEF constexpr auto kMetalAdStackSourceCode =
#define METAL_END_AD_STACK_DEF ;
#else
#define METAL_BEGIN_AD_STACK_DEF
#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/backends/metal/shaders/ad_stack.metal.h", "license": "mit", "size": 1982} |
### File: taichi/backends/metal/shaders/atomic_stubs.h
#pragma once
using atomic_int = int;
using atomic_uint = unsigned int;
template <typename T>
struct _atomic {};
namespace metal {
using memory_order = bool;
memory_order memory_order_relaxed = false;
} // namespace metal
template <typename T>
bool atomic_com... | {"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/backends/metal/shaders/atomic_stubs.h", "license": "mit", "size": 1962} |
### File: taichi/backends/metal/shaders/epilog.h
#undef device
#undef constant
#undef thread
#undef kernel
#undef byte
#undef STR2
#undef STR
| {"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/backends/metal/shaders/epilog.h", "license": "mit", "size": 95} |
### File: taichi/backends/metal/shaders/helpers.metal.h
#include "taichi/backends/metal/shaders/prolog.h"
#ifdef TI_INSIDE_METAL_CODEGEN
#ifndef TI_METAL_NESTED_INCLUDE
#define METAL_BEGIN_HELPERS_DEF constexpr auto kMetalHelpersSourceCode =
#define METAL_END_HELPERS_DEF ;
#else
#define METAL_BEGIN_HELPERS_DEF
#defin... | {"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/backends/metal/shaders/helpers.metal.h", "license": "mit", "size": 3936} |
### File: taichi/backends/metal/shaders/print.metal.h
#include "taichi/backends/metal/shaders/prolog.h"
#ifdef TI_INSIDE_METAL_CODEGEN
#ifndef TI_METAL_NESTED_INCLUDE
#define METAL_BEGIN_PRINT_DEF constexpr auto kMetalPrintSourceCode =
#define METAL_END_PRINT_DEF ;
#else
#define METAL_BEGIN_PRINT_DEF
#define METAL_EN... | {"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/backends/metal/shaders/print.metal.h", "license": "mit", "size": 7141} |
### File: taichi/backends/metal/shaders/prolog.h
#ifdef TI_INSIDE_METAL_CODEGEN
#ifndef TI_METAL_NESTED_INCLUDE
#define STR2(...) #__VA_ARGS__
#define STR(...) STR2(__VA_ARGS__)
#else
// If we are emitting to Metal source code, and the shader file is included by
// some other shader file, then skip emitting the code f... | {"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/backends/metal/shaders/prolog.h", "license": "mit", "size": 733} |
### File: taichi/backends/metal/shaders/runtime_kernels.metal.h
#ifndef TI_METAL_NESTED_INCLUDE
#define TI_METAL_NESTED_INCLUDE
#include "taichi/backends/metal/shaders/runtime_utils.metal.h"
#undef TI_METAL_NESTED_INCLUDE
#else
#include "taichi/backends/metal/shaders/runtime_utils.metal.h"
#endif // TI_METAL_NESTED_... | {"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/backends/metal/shaders/runtime_kernels.metal.h", "license": "mit", "size": 5167} |
### File: taichi/backends/metal/shaders/runtime_structs.metal.h
#include "taichi/backends/metal/shaders/prolog.h"
#ifdef TI_INSIDE_METAL_CODEGEN
#ifndef TI_METAL_NESTED_INCLUDE
#define METAL_BEGIN_RUNTIME_STRUCTS_DEF \
constexpr auto kMetalRuntimeStructsSourceCode =
#define METAL_END_RUNTIME_STRUCTS_DEF ;
#else
#de... | {"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/backends/metal/shaders/runtime_structs.metal.h", "license": "mit", "size": 4616} |
### File: taichi/backends/metal/shaders/runtime_utils.metal.h
#ifndef TI_METAL_NESTED_INCLUDE
#define TI_METAL_NESTED_INCLUDE
#include "taichi/backends/metal/shaders/runtime_structs.metal.h"
#undef TI_METAL_NESTED_INCLUDE
#else
#include "taichi/backends/metal/shaders/runtime_structs.metal.h"
#endif // TI_METAL_NESTE... | {"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/backends/metal/shaders/runtime_utils.metal.h", "license": "mit", "size": 14807} |
### File: taichi/backends/metal/shaders/snode_bit_pointer.metal.h
#include "taichi/backends/metal/shaders/prolog.h"
#ifdef TI_INSIDE_METAL_CODEGEN
#ifndef TI_METAL_NESTED_INCLUDE
#define METAL_BEGIN_SRC_DEF constexpr auto kMetalSNodeBitPointerSourceCode =
#define METAL_END_SRC_DEF ;
#else
#define METAL_BEGIN_SRC_DEF
... | {"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/backends/metal/shaders/snode_bit_pointer.metal.h", "license": "mit", "size": 5334} |
### File: taichi/backends/metal/struct_metal.cpp
#include "struct_metal.h"
#include <algorithm>
#include <functional>
#include <sstream>
#include <string>
#include <vector>
#include "taichi/backends/metal/constants.h"
#include "taichi/backends/metal/data_types.h"
#include "taichi/backends/metal/features.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/backends/metal/struct_metal.cpp", "license": "mit", "size": 14079} |
### File: taichi/backends/metal/struct_metal.h
// Codegen for the hierarchical data structure
#pragma once
#include <unordered_map>
#include "taichi/ir/snode.h"
TLANG_NAMESPACE_BEGIN
namespace metal {
struct SNodeDescriptor {
const SNode *snode = nullptr;
// Stride (bytes) of a single child element of this SNod... | {"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/backends/metal/struct_metal.h", "license": "mit", "size": 3181} |
### File: taichi/backends/opengl/codegen_opengl.cpp
//#define _GLSL_DEBUG 1
#include "codegen_opengl.h"
#include <string>
#include "taichi/backends/opengl/opengl_api.h"
#include "taichi/backends/opengl/opengl_data_types.h"
#include "taichi/backends/opengl/opengl_kernel_util.h"
#include "taichi/ir/ir.h"
#include "taic... | {"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/backends/opengl/codegen_opengl.cpp", "license": "mit", "size": 40983} |
### File: taichi/backends/opengl/codegen_opengl.h
#pragma once
#include "taichi/inc/constants.h"
#include "taichi/lang_util.h"
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include "taichi/codegen/codegen.h"
TLANG_NAMESPACE_BEGIN
namespace opengl {
class OpenglCodeGen {
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/backends/opengl/codegen_opengl.h", "license": "mit", "size": 876} |
### File: taichi/backends/opengl/opengl_api.cpp
//#define _GLSL_DEBUG 1
#include "opengl_api.h"
#include "taichi/backends/opengl/opengl_kernel_util.h"
#include "taichi/program/kernel.h"
#include "taichi/program/program.h"
#include "taichi/program/py_print_buffer.h"
#include "taichi/util/environ_config.h"
#include "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/backends/opengl/opengl_api.cpp", "license": "mit", "size": 21843} |
### File: taichi/backends/opengl/opengl_api.h
#pragma once
#include "taichi/common/core.h"
#include <string>
#include <vector>
#include <optional>
#include "taichi/backends/opengl/opengl_kernel_util.h"
#include "taichi/backends/opengl/opengl_kernel_launcher.h"
#define TI_RUNTIME_HOST
#include "taichi/program/context... | {"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/backends/opengl/opengl_api.h", "license": "mit", "size": 2302} |
### File: taichi/backends/opengl/opengl_data_types.h
#pragma once
#include "taichi/lang_util.h"
#include "taichi/ir/snode.h"
#include <string>
TLANG_NAMESPACE_BEGIN
namespace opengl {
inline std::string opengl_data_type_name(DataType dt) {
// https://www.khronos.org/opengl/wiki/Data_Type_(GLSL)
dt.set_is_pointe... | {"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/backends/opengl/opengl_data_types.h", "license": "mit", "size": 1957} |
### File: taichi/backends/opengl/opengl_kernel_launcher.h
#pragma once
#include "taichi/lang_util.h"
#include <vector>
TLANG_NAMESPACE_BEGIN
namespace opengl {
struct CompiledProgram;
struct GLSLLauncherImpl;
struct GLSLLauncher;
struct GLBuffer;
struct GLSLLauncher {
std::unique_ptr<GLSLLauncherImpl> impl;
G... | {"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/backends/opengl/opengl_kernel_launcher.h", "license": "mit", "size": 784} |
### File: taichi/backends/opengl/opengl_kernel_util.h
#pragma once
#include <string>
#include <vector>
#include <unordered_map>
#include "taichi/ir/snode.h"
TLANG_NAMESPACE_BEGIN
class SNode;
namespace opengl {
constexpr int taichi_opengl_earg_base = taichi_max_num_args * sizeof(uint64_t);
struct UsedFeature {
... | {"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/backends/opengl/opengl_kernel_util.h", "license": "mit", "size": 1011} |
### File: taichi/backends/opengl/shaders/atomics_data_f32.glsl.h
// vim: ft=glsl
// clang-format off
#include "taichi/util/macros.h"
STR(
float atomicAdd_data_f32(int addr, float rhs) {
int old, new, ret;
do {
old = _data_i32_[addr];
new = floatBitsToInt((intBitsToFloat(old) + rhs));
} while (old != atomi... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "GLSL", "repo_name": "minhanghuang/Taichi", "path": "taichi/backends/opengl/shaders/atomics_data_f32.glsl.h", "license": "mit", "size": 1095} |
### File: taichi/backends/opengl/shaders/atomics_data_f64.glsl.h
// vim: ft=glsl
// clang-format off
#include "taichi/util/macros.h"
STR(
double atomicAdd_data_f64(int addr, double rhs) {
int old, new, ret;
do {
old = _data_i64_[addr];
new = floatBitsToInt((intBitsToFloat(old) + rhs));
} while (old != ato... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "GLSL", "repo_name": "minhanghuang/Taichi", "path": "taichi/backends/opengl/shaders/atomics_data_f64.glsl.h", "license": "mit", "size": 1103} |
### File: taichi/backends/opengl/shaders/atomics_extr_f32.glsl.h
// vim: ft=glsl
// clang-format off
#include "taichi/util/macros.h"
STR(
float atomicAdd_extr_f32(int addr, float rhs) {
int old, new, ret;
do {
old = _extr_i32_[addr];
new = floatBitsToInt((intBitsToFloat(old) + rhs));
} while (old != atomi... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "GLSL", "repo_name": "minhanghuang/Taichi", "path": "taichi/backends/opengl/shaders/atomics_extr_f32.glsl.h", "license": "mit", "size": 1095} |
### File: taichi/backends/opengl/shaders/atomics_extr_f64.glsl.h
// vim: ft=glsl
// clang-format off
#include "taichi/util/macros.h"
STR(
double atomicAdd_extr_f64(int addr, double rhs) {
int old, new, ret;
do {
old = _extr_i64_[addr];
new = floatBitsToInt((intBitsToFloat(old) + rhs));
} while (old != ato... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "GLSL", "repo_name": "minhanghuang/Taichi", "path": "taichi/backends/opengl/shaders/atomics_extr_f64.glsl.h", "license": "mit", "size": 1103} |
### File: taichi/backends/opengl/shaders/atomics_gtmp_f32.glsl.h
// vim: ft=glsl
// clang-format off
#include "taichi/util/macros.h"
STR(
float atomicAdd_gtmp_f32(int addr, float rhs) {
int old, new, ret;
do {
old = _gtmp_i32_[addr];
new = floatBitsToInt((intBitsToFloat(old) + rhs));
} while (old != atomi... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "GLSL", "repo_name": "minhanghuang/Taichi", "path": "taichi/backends/opengl/shaders/atomics_gtmp_f32.glsl.h", "license": "mit", "size": 1095} |
### File: taichi/backends/opengl/shaders/atomics_gtmp_f64.glsl.h
// vim: ft=glsl
// clang-format off
#include "taichi/util/macros.h"
STR(
double atomicAdd_gtmp_f64(int addr, double rhs) {
int old, new, ret;
do {
old = _gtmp_i64_[addr];
new = floatBitsToInt((intBitsToFloat(old) + rhs));
} while (old != ato... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "GLSL", "repo_name": "minhanghuang/Taichi", "path": "taichi/backends/opengl/shaders/atomics_gtmp_f64.glsl.h", "license": "mit", "size": 1103} |
### File: taichi/backends/opengl/shaders/fast_pow.glsl.h
// vim: ft=glsl
// clang-format off
#include "taichi/util/macros.h"
STR(
int fast_pow_i32(int x, int y)
{
if (y > 512)
return int(pow(x, y));
bool neg = y < 0;
y = abs(y);
int ret = 1;
while (y != 0) {
if ((y & 1) != 0)
ret *= x;
x *=... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "GLSL", "repo_name": "minhanghuang/Taichi", "path": "taichi/backends/opengl/shaders/fast_pow.glsl.h", "license": "mit", "size": 567} |
### File: taichi/backends/opengl/shaders/indirect.glsl.h
// vim: ft=glsl
// clang-format off
#include "taichi/util/macros.h"
"#version 430 core\nprecision highp float;\n"
#define __GLSL__
#include "taichi/backends/opengl/shaders/runtime.h"
#undef __GLSL__
STR(
// taichi uses gtmp for storing dynamic range endpoints
lay... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "GLSL", "repo_name": "minhanghuang/Taichi", "path": "taichi/backends/opengl/shaders/indirect.glsl.h", "license": "mit", "size": 1023} |
### File: taichi/backends/opengl/shaders/listman.h
#define MAX_LIST (1024 * 256) // * 4 = 1 MB
#ifdef __GLSL__
// clang-format off
#include "taichi/util/macros.h"
STR(
layout(std430, binding = 7) buffer listman {
int _list_len_;
int _list_[];
};
)"\n"
// clang-format on
#else
TLANG_NAMESPACE_BEGIN
struct GLSL... | {"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/backends/opengl/shaders/listman.h", "license": "mit", "size": 349} |
### File: taichi/backends/opengl/shaders/print.glsl.h
// vim: ft=glsl
// clang-format off
#include "taichi/util/macros.h"
STR(
void _msg_set(int mid, int cid, int type, int val) {
_msg_buf_[mid].contents[cid] = val;
_msg_buf_[mid].type_bm_lo |= (type & 1) << cid;
_msg_buf_[mid].type_bm_hi |= (type >> 1) << cid;
}... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "GLSL", "repo_name": "minhanghuang/Taichi", "path": "taichi/backends/opengl/shaders/print.glsl.h", "license": "mit", "size": 611} |
### File: taichi/backends/opengl/shaders/random.glsl.h
// vim: ft=glsl
// clang-format off
#include "taichi/util/macros.h"
STR(
uvec4 _rand_; // per-thread local variable
void _init_rand() {
// ad-hoc: hope no kernel will use more than 1024 gtmp variables...
// here we just use gtmp buffer for yield different ran... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "GLSL", "repo_name": "minhanghuang/Taichi", "path": "taichi/backends/opengl/shaders/random.glsl.h", "license": "mit", "size": 1163} |
### File: taichi/backends/opengl/shaders/runtime.h
#define MAX_MESSAGES (1024 * 4) // * 4 * 32 = 512 KB
#define MSG_SIZE 32
// 2 left for the `type` bitmap, 1 left for the contents-count
#define MAX_CONTENTS_PER_MSG (MSG_SIZE - 3)
#ifdef __GLSL__
// clang-format off
#include "taichi/util/macros.h"
STR(
struct _msg_e... | {"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/backends/opengl/shaders/runtime.h", "license": "mit", "size": 962} |
### File: taichi/backends/opengl/struct_opengl.cpp
#include "struct_opengl.h"
#include "taichi/ir/snode.h"
TLANG_NAMESPACE_BEGIN
namespace opengl {
OpenglStructCompiler::CompiledResult OpenglStructCompiler::run(SNode &node) {
TI_ASSERT(node.type == SNodeType::root);
collect_snodes(node);
// The host side has r... | {"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/backends/opengl/struct_opengl.cpp", "license": "mit", "size": 3501} |
### File: taichi/backends/opengl/struct_opengl.h
// Codegen for the hierarchical data structure
#pragma once
#include "taichi/backends/opengl/opengl_kernel_launcher.h"
#include "taichi/backends/opengl/opengl_data_types.h"
#include "taichi/ir/snode.h"
#include <algorithm>
#include <functional>
#include <string>
#inclu... | {"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/backends/opengl/struct_opengl.h", "license": "mit", "size": 750} |
### File: taichi/codegen/codegen.cpp
// Driver class for kernel codegen
#include "codegen.h"
#include "taichi/util/statistics.h"
#include "taichi/backends/cpu/codegen_cpu.h"
#if defined(TI_WITH_CUDA)
#include "taichi/backends/cuda/codegen_cuda.h"
#endif
#include "taichi/system/timer.h"
#include "taichi/ir/analysis.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/codegen/codegen.cpp", "license": "mit", "size": 1397} |
### File: taichi/codegen/codegen_llvm.cpp
#include "taichi/codegen/codegen_llvm.h"
#include "taichi/ir/statements.h"
#include "taichi/struct/struct_llvm.h"
#include "taichi/util/file_sequence_writer.h"
TLANG_NAMESPACE_BEGIN
// TODO: sort function definitions to match declaration order in header
// OffloadedTask
Of... | {"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/codegen/codegen_llvm.cpp", "license": "mit", "size": 73501} |
### File: taichi/codegen/codegen_llvm.h
// The LLVM backend for CPUs/NVPTX/AMDGPU
#pragma once
#include <set>
#include <unordered_map>
#include "taichi/ir/ir.h"
#include "taichi/program/program.h"
#include "taichi/llvm/llvm_codegen_utils.h"
TLANG_NAMESPACE_BEGIN
class CodeGenLLVM;
class OffloadedTask {
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/codegen/codegen_llvm.h", "license": "mit", "size": 10158} |
### File: taichi/codegen/codegen_llvm_quant.cpp
#include "taichi/codegen/codegen_llvm.h"
#include "taichi/ir/statements.h"
#include "taichi/struct/struct_llvm.h"
TLANG_NAMESPACE_BEGIN
namespace {
inline void update_mask(uint64 &mask, uint32 num_bits, uint32 offset) {
uint64 new_mask =
(((~(uint64)0) << (64 ... | {"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/codegen/codegen_llvm_quant.cpp", "license": "mit", "size": 27263} |
### File: taichi/common/core.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/common/core.cpp", "license": "mit", "size": 2135} |
### File: taichi/common/core.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/common/core.h", "license": "mit", "size": 9125} |
### File: taichi/common/dict.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/common/dict.h", "license": "mit", "size": 9063} |
### File: taichi/common/interface.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/common/interface.h", "license": "mit", "size": 19937} |
### File: taichi/common/logging.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/common/logging.cpp", "license": "mit", "size": 3750} |
### File: taichi/common/logging.h
#pragma once
#include <functional>
#include <cstring>
// This is necessary for TI_UNREACHABLE
#include "taichi/common/platform_macros.h"
// Must include "spdlog/common.h" to define SPDLOG_HEADER_ONLY
// before including "spdlog/fmt/fmt.h"
#include "spdlog/common.h"
#include "spdlog/... | {"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/common/logging.h", "license": "mit", "size": 4560} |
### File: taichi/common/platform_macros.h
#pragma once
// TO KEEP THE INCLUDE DEPENDENCY CLEAN, PLEASE DO NOT INCLUDE ANY OTHER
// TAICHI HEADERS INTO THIS ONE.
//
// TODO(#2196): Once we can slim down "taichi/common/core.h", consider moving
// the contents back to core.h and delete this file.
#ifndef _CRT_SECURE_NO_W... | {"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/common/platform_macros.h", "license": "mit", "size": 727} |
### File: taichi/common/serialization.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/common/serialization.h", "license": "mit", "size": 21673} |
### File: taichi/common/task.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/common/task.h", "license": "mit", "size": 2430} |
### File: taichi/common/trait.h
#pragma once
#include <type_traits>
namespace taichi {
// This allows us to static_assert(always_false_v<T>) when using if constexpr.
// See https://stackoverflow.com/a/53945549/12003165
template <typename T>
struct always_false : std::false_type {};
template <typename T>
inline 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/common/trait.h", "license": "mit", "size": 364} |
### File: taichi/gui/cocoa.cpp
#include "taichi/common/task.h"
#include "taichi/gui/gui.h"
#include "taichi/util/bit.h"
#if defined(TI_GUI_COCOA)
#include <algorithm>
#include <optional>
#include <string>
#include <unordered_map>
#include "taichi/platform/mac/objc_api.h"
// https://stackoverflow.com/questions/43564... | {"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/gui/cocoa.cpp", "license": "mit", "size": 15340} |
### File: taichi/gui/gui.cpp
#include "taichi/gui/gui.h"
TI_NAMESPACE_BEGIN
Vector2 Canvas::Line::vertices[128];
void Canvas::triangles_batched(int n,
std::size_t a_,
std::size_t b_,
std::size_t 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/gui/gui.cpp", "license": "mit", "size": 4208} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.