Skip to content

Commit

Permalink
TI_MAKE_THREAD_LOCAL
Browse files Browse the repository at this point in the history
  • Loading branch information
archibate committed Jul 24, 2020
1 parent 1fba663 commit bff3087
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion taichi/backends/metal/codegen_metal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1232,7 +1232,7 @@ FunctionType CodeGen::compile() {
/*vectorize=*/false, kernel_->grad,
/*ad_use_stack=*/true, config.print_ir,
/*lower_global_access=*/true,
/*make_thread_local=*/true);
/*make_thread_local=*/config.make_thread_local);

KernelCodegen codegen(
taichi_kernel_name_, kernel_->program.snode_root->node_type_name, kernel_,
Expand Down
2 changes: 1 addition & 1 deletion taichi/backends/opengl/codegen_opengl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1007,7 +1007,7 @@ void OpenglCodeGen::lower() {
/*vectorize=*/false, kernel_->grad,
/*ad_use_stack=*/false, config.print_ir,
/*lower_global_access=*/true,
/*make_thread_local=*/true);
/*make_thread_local=*/config.make_thread_local);
#ifdef _GLSL_DEBUG
irpass::print(ir);
#endif
Expand Down
1 change: 1 addition & 0 deletions taichi/program/compile_config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ CompileConfig::CompileConfig() {
fast_math = true;
async_mode = false;
flatten_if = false;
make_thread_local = true;

#if defined(TI_PLATFORM_WINDOWS) or defined(TI_ARCH_ARM)
use_unified_memory = false;
Expand Down
1 change: 1 addition & 0 deletions taichi/program/compile_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ struct CompileConfig {
bool use_unified_memory;
bool async_mode;
bool flatten_if;
bool make_thread_local;
DataType default_fp;
DataType default_ip;
std::string extra_flags;
Expand Down
3 changes: 2 additions & 1 deletion taichi/python/export_lang.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ void export_lang(py::module &m) {
&CompileConfig::advanced_optimization)
.def_readwrite("ad_stack_size", &CompileConfig::ad_stack_size)
.def_readwrite("async_mode", &CompileConfig::async_mode)
.def_readwrite("flatten_if", &CompileConfig::flatten_if);
.def_readwrite("flatten_if", &CompileConfig::flatten_if)
.def_readwrite("make_thread_local", &CompileConfig::make_thread_local);

m.def("reset_default_compile_config",
[&]() { default_compile_config = CompileConfig(); });
Expand Down

0 comments on commit bff3087

Please sign in to comment.