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

Method SetProgram

tensorflow/core/platform/posix/subprocess.cc:115–141  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

113}
114
115void SubProcess::SetProgram(const string& file,
116 const std::vector<string>& argv) {
117 mutex_lock procLock(proc_mu_);
118 mutex_lock dataLock(data_mu_);
119 if (running_) {
120 LOG(FATAL) << "SetProgram called after the process was started.";
121 return;
122 }
123
124 FreeArgs();
125 exec_path_ = strdup(file.c_str());
126 if (exec_path_ == nullptr) {
127 LOG(FATAL) << "SetProgram failed to allocate file string.";
128 return;
129 }
130
131 int argc = argv.size();
132 exec_argv_ = new char*[argc + 1];
133 for (int i = 0; i < argc; i++) {
134 exec_argv_[i] = strdup(argv[i].c_str());
135 if (exec_argv_[i] == nullptr) {
136 LOG(FATAL) << "SetProgram failed to allocate command argument.";
137 return;
138 }
139 }
140 exec_argv_[argc] = nullptr;
141}
142
143void SubProcess::SetChannelAction(Channel chan, ChannelAction action) {
144 mutex_lock procLock(proc_mu_);

Callers 9

WarnIfBadPtxasVersionFunction · 0.80
CompilePtxFunction · 0.80
UnArchiveMethod · 0.80
TESTFunction · 0.80
OpenUrlFunction · 0.80
GRPCClientTestBaseMethod · 0.80
TEST_FFunction · 0.80
CreateSubProcessFunction · 0.80

Calls 2

c_strMethod · 0.80
sizeMethod · 0.45

Tested by 5

UnArchiveMethod · 0.64
TESTFunction · 0.64
GRPCClientTestBaseMethod · 0.64
TEST_FFunction · 0.64