Skip to content
Snippets Groups Projects

Adding likwid markers

Merged Christoph Alt requested to merge likwid into master
Compare and Show latest version
1 file
+ 7
3
Preferences
Compare changes
@@ -23,7 +23,9 @@ def generate_benchmark(kernel_asts: Union[KernelFunction, List[KernelFunction]],
path: Path = None,
*,
compiler: Compiler = Compiler.GCC,
likwid: bool = False) -> None:
timing: bool = True,
likwid: bool = False
) -> None:
if path is None:
path = Path('.')
else:
@@ -48,7 +50,7 @@ def generate_benchmark(kernel_asts: Union[KernelFunction, List[KernelFunction]],
f.write(source)
with open(src_path / 'main.c', 'w+') as f:
f.write(kernel_main(kernel_asts, likwid=likwid))
f.write(kernel_main(kernel_asts, timing=timing, likwid=likwid))
copy_static_files(path)
compiler_toolchain(path, compiler, likwid)
@@ -95,6 +97,7 @@ def kernel_main(kernels_ast: List[KernelFunction], *,
Args:
kernels_ast: A list of the pystencils AST object as returned by create_kernel for benchmarking
timing: add timing output to the code, prints time per iteration to stdout
likwid: add likwid marker to the code
Returns:
C code as string
"""
@@ -134,7 +137,8 @@ def kernel_main(kernels_ast: List[KernelFunction], *,
size = dim1_size * padding_bytes + np.prod(field.shape) * size_data_type
assert align % np_dtype.itemsize == 0
offset = ((dim0_size + padding_elements + ghost_layers) % kernel.instruction_set['width']) * size_data_type
offset = ((dim0_size + padding_elements + ghost_layers) %
kernel.instruction_set['width']) * size_data_type
else:
size = elements * size_data_type
offset = 0