Decision tree training.

This commit is contained in:
Marcel Keller
2022-11-09 11:21:34 +11:00
parent 90336561f8
commit cd25c2e9f1
187 changed files with 2357 additions and 329 deletions

View File

@@ -67,6 +67,14 @@ void BaseMachine::load_schedule(const string& progname, bool load_bytecode)
string threadname;
for (int i=0; i<nprogs; i++)
{ inpf >> threadname;
size_t split = threadname.find(":");
long expected = -1;
if (split != string::npos)
{
expected = atoi(threadname.substr(split + 1).c_str());
threadname = threadname.substr(0, split);
}
string filename = "Programs/Bytecode/" + threadname + ".bc";
bc_filenames.push_back(filename);
if (load_bytecode)
@@ -74,8 +82,11 @@ void BaseMachine::load_schedule(const string& progname, bool load_bytecode)
#ifdef DEBUG_FILES
cerr << "Loading program " << i << " from " << filename << endl;
#endif
load_program(threadname, filename);
long size = load_program(threadname, filename);
if (expected >= 0 and expected != size)
throw runtime_error("broken bytecode file");
}
}
for (auto i : {1, 0, 0})
@@ -99,7 +110,8 @@ void BaseMachine::print_compiler()
cerr << "Compiler: " << compiler << endl;
}
void BaseMachine::load_program(const string& threadname, const string& filename)
size_t BaseMachine::load_program(const string& threadname,
const string& filename)
{
(void)threadname;
(void)filename;