tool xml input

This commit is contained in:
Evgeny committed 2019-01-17 22:39:53 -06:00
1 parent 7cac3c4231
commit a530e509fe
7 files changed
+178 -18

No files matched your search

+12
View File
@@ -307,6 +307,7 @@ class API_DescrParser:
self.add_section('API callback functions', '', self.gen_callbacks)
self.add_section('API intercepting code', '', self.gen_intercept)
self.add_section('API get_name function', ' ', self.gen_get_name)
self.add_section('API get_code function', ' ', self.gen_get_code)
self.content += '\n};};\n'
self.content += '#endif // PROF_API_IMPL\n'
@@ -418,6 +419,17 @@ class API_DescrParser:
self.content += ' return "unknown";\n'
self.content += '}\n'
# generate API code function
def gen_get_code(self, n, name, call, struct):
if n == -1:
self.content += 'static uint32_t GetApiCode(const char* str) {\n'
return
if call != '-':
self.content += ' if (strcmp("' + call + '", str) == 0) return ' + self.api_id[call] + ';\n'
else:
self.content += ' return HSA_API_ID_NUMBER;\n'
self.content += '}\n'
# generate stream operator
def gen_out_stream(self, n, name, call, struct):
if n == -1: