source: trunk/lib_ir/AgnerTestP/PMCTest/gen.py @ 4224

Last change on this file since 4224 was 4224, checked in by linmengl, 5 years ago

Makefile for IR inline compilation is ready, now working on the auto script.

File size: 889 bytes
Line 
1from jinja2 import Template, Environment, FileSystemLoader
2
3Template    = "PMCTestB.pytemplate.cpp"
4Output      = "PMCTestB.cpp"
5
6#configuring Jinja2
7env = Environment(loader=FileSystemLoader(['.']),
8                  trim_blocks=True,
9                  lstrip_blocks=True)
10
11def fillTemplate(template, output, params):
12    content = env.get_template(template).render(params)
13    with open(output, 'w') as f:
14        f.write(content)
15
16def genFile():
17    fillTemplate(template=Template, output=Output,
18                 params=dict(DeclaredIRFunc = "add_1",
19                             DataSize = 1000,
20                             UserDataInit = "simd<32>::constant<0>()",
21                             TestInstrCount = 500,
22                             TestInstr = "simd<1>::add(UserData[thread][i], one_constant)"
23                             ))
24
25if __name__ == '__main__':
26    genFile()
27
Note: See TracBrowser for help on using the repository browser.