MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / CreateThread

Method CreateThread

tensorflow/core/lib/core/threadpool.cc:57–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55 : env_(env), thread_options_(thread_options), name_(name) {}
56
57 EnvThread* CreateThread(std::function<void()> f) {
58 return env_->StartThread(thread_options_, name_, [=]() {
59 // Set the processor flag to flush denormals to zero.
60 port::ScopedFlushDenormal flush;
61 // Set the processor rounding mode to ROUND TO NEAREST.
62 port::ScopedSetRound round(FE_TONEAREST);
63 if (thread_options_.numa_node != port::kNUMANoAffinity) {
64 port::NUMASetThreadNodeAffinity(thread_options_.numa_node);
65 }
66 f();
67 });
68 }
69
70 Task CreateTask(std::function<void()> f, int64 cost = 0) {
71 uint64 id = 0;

Callers

nothing calls this directly

Calls 3

fFunction · 0.50
StartThreadMethod · 0.45

Tested by

no test coverage detected