|
@@ -34,7 +34,7 @@ def parse_args():
|
|
|
"""Parse command line arguments."""
|
|
|
parser = argparse.ArgumentParser()
|
|
|
parser.add_argument('filename', type=str, help='File name with the kernel template')
|
|
|
- parser.add_argument('burst', type=int,
|
|
|
+ parser.add_argument('burst', type=int, nargs='+',
|
|
|
help='Number of projections processed by one kernel invocation')
|
|
|
|
|
|
return parser.parse_args()
|
|
@@ -44,14 +44,17 @@ def main():
|
|
|
"""execute program."""
|
|
|
args = parse_args()
|
|
|
allowed_bursts = [2 ** i for i in range(5)]
|
|
|
- if args.burst not in allowed_bursts:
|
|
|
- raise ValueError('Specified burst mode `{}` must be one of `{}`'.format(args.burst,
|
|
|
- allowed_bursts))
|
|
|
in_tmpl = "read_only image2d_t projection_{},"
|
|
|
common_filename = os.path.join(os.path.dirname(args.filename), 'common.in')
|
|
|
kernel_outer = open(common_filename, 'r').read()
|
|
|
comp_tmpl, kernel_inner = open(args.filename, 'r').read().split('\n%nl\n')
|
|
|
- print fill_kernel_template(in_tmpl, comp_tmpl, kernel_outer, kernel_inner, args.burst)
|
|
|
+ kernels = ''
|
|
|
+ for burst in args.burst:
|
|
|
+ if burst not in allowed_bursts:
|
|
|
+ raise ValueError('Burst mode `{}` must be one of `{}`'.format(burst, allowed_bursts))
|
|
|
+ kernels += fill_kernel_template(in_tmpl, comp_tmpl, kernel_outer, kernel_inner, burst)
|
|
|
+
|
|
|
+ print kernels
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|