|
27 | 27 |
|
28 | 28 | #define ARK_DEBUG_KERNEL 0
|
29 | 29 |
|
30 |
| -using namespace std; |
31 |
| - |
32 | 30 | namespace ark {
|
33 | 31 |
|
34 | 32 | template <typename ItemType>
|
@@ -151,7 +149,7 @@ const std::string gpu_compile(const std::vector<std::string> &codes,
|
151 | 149 | items.reserve(codes.size());
|
152 | 150 | srand();
|
153 | 151 | for (auto &code : codes) {
|
154 |
| - string hash_str = fnv1a_hash(code); |
| 152 | + std::string hash_str = fnv1a_hash(code); |
155 | 153 | items.emplace_back(code, "/tmp/ark_" + hash_str);
|
156 | 154 | }
|
157 | 155 | assert(items.size() == 1);
|
@@ -187,25 +185,25 @@ const std::string gpu_compile(const std::vector<std::string> &codes,
|
187 | 185 | LOG(INFO, "Compiling: ", code_file_path);
|
188 | 186 | LOG(DEBUG, compile_cmd);
|
189 | 187 | // Run the command.
|
190 |
| - array<char, 4096> buffer; |
191 |
| - stringstream exec_print; |
192 |
| - unique_ptr<FILE, decltype(&pclose)> pipe( |
| 188 | + std::array<char, 4096> buffer; |
| 189 | + std::stringstream exec_print; |
| 190 | + std::unique_ptr<FILE, decltype(&pclose)> pipe( |
193 | 191 | popen(compile_cmd.c_str(), "r"), pclose);
|
194 | 192 | if (!pipe) {
|
195 | 193 | ERR(SystemError, "popen() failed");
|
196 | 194 | }
|
197 | 195 | while (fgets(buffer.data(), buffer.size(), pipe.get()) != nullptr) {
|
198 | 196 | exec_print << buffer.data();
|
199 | 197 | }
|
200 |
| - string exec_print_str = exec_print.str(); |
| 198 | + std::string exec_print_str = exec_print.str(); |
201 | 199 | if (exec_print_str.size() > 0) {
|
202 | 200 | ERR(ExecutorError, "\n", compile_cmd, "\n", exec_print_str,
|
203 | 201 | "\n");
|
204 | 202 | }
|
205 | 203 | LOG(INFO, "Compile succeed: ", code_file_path, " (",
|
206 | 204 | cpu_timer() - start, " seconds)");
|
207 | 205 | });
|
208 |
| - string gpubin_file_path = items[0].second + ".cubin"; |
| 206 | + std::string gpubin_file_path = items[0].second + ".cubin"; |
209 | 207 | return read_file(gpubin_file_path);
|
210 | 208 | }
|
211 | 209 |
|
|
0 commit comments