Commit a8a68452 authored by Fenglei's avatar Fenglei Committed by Robert Kimball

fix bug the dir create after the first ops.txt store (#887)

parent 12e8b9b7
...@@ -122,7 +122,11 @@ static const string s_output_dir = "gpu_codegen"; ...@@ -122,7 +122,11 @@ static const string s_output_dir = "gpu_codegen";
class StaticInitializers class StaticInitializers
{ {
public: public:
StaticInitializers() { ngraph::file_util::remove_directory(s_output_dir); } StaticInitializers()
{
file_util::remove_directory(s_output_dir);
file_util::make_directory(s_output_dir);
}
}; };
static string emit_string_array(const vector<string>& s, size_t max_line_length) static string emit_string_array(const vector<string>& s, size_t max_line_length)
...@@ -740,7 +744,6 @@ using namespace std; ...@@ -740,7 +744,6 @@ using namespace std;
} }
// TODO: Cleanup and make this a utility function // TODO: Cleanup and make this a utility function
file_util::make_directory(s_output_dir);
string filename = file_util::path_join(s_output_dir, function_name + "_codegen.cpp"); string filename = file_util::path_join(s_output_dir, function_name + "_codegen.cpp");
ofstream out(filename); ofstream out(filename);
string code = writer.get_code(); string code = writer.get_code();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment