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

Method CreateTask

tensorflow/core/lib/core/threadpool.cc:70–84  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68 }
69
70 Task CreateTask(std::function<void()> f, int64 cost = 0) {
71 uint64 id = 0;
72 if (tracing::EventCollector::IsEnabled()) {
73 id = tracing::GetUniqueArg();
74 tracing::RecordEvent(tracing::EventCategory::kScheduleClosure, id);
75 }
76
77 return Task{
78 std::unique_ptr<TaskImpl>(new TaskImpl{
79 std::move(f),
80 Context(ContextKind::kThread),
81 id,
82 }), cost
83 };
84 }
85
86 void ExecuteTask(const Task& t) {
87 WithContext wc(t.f->context);

Callers

nothing calls this directly

Calls 4

IsEnabledFunction · 0.85
GetUniqueArgFunction · 0.85
RecordEventFunction · 0.85
ContextClass · 0.50

Tested by

no test coverage detected