44 : readonlyData(nullptr), filename(fname)
52 uint8_t *file_data =
nullptr;
56 std::ifstream::binary);
58 assert(code_file.is_open());
59 assert(code_file.good());
61 file_length = code_file.tellg();
62 code_file.seekg(0, code_file.beg);
63 file_data =
new uint8_t[file_length];
64 code_file.read((
char*)file_data, file_length);
68 if ((hsaObj = tryFile(fname, file_length, file_data))) {
74 fatal(
"Unknown HSA object type for file: %s.\n", fname);
HsaObject(const std::string &fileName)
static HsaObject * createHsaObject(const std::string &fname)
static std::vector< std::function< HsaObject *(const std::string &, int, uint8_t *)> > tryFileFuncs