Skip to content

KernelFilter

Vivek Kale edited this page Jan 16, 2024 · 9 revisions

Tool Description

KernelFilter provides a way to restrict other tools to analyze only a subset of kernels.

The tool is located at: https://github.com/kokkos/kokkos-tools/tree/develop/common/kernel-filter

Compilation

Simply type "make" inside the source directory. When compiling for specific platforms modify the simple Makefile to use the correct compiler and compiler flags.

Usage

This is a tool which is used only with tool chaining. The list of kernels to restrict execution to is provided via a text file which contains C++11 regular expression patterns (in ECMAScript: http://ecma-international.org/ecma-262/5.1/#sec-15.10) which matches kernel names.

An example of such a file named kernels.lst would be:

AX(.*)
Dot

To use the KernelFilter, one now provides two tools for KOKKOS_TOOLS_LIBS with the kernel-filter going first. One also needs to set an environment variable pointing to the filter list. An example for this is to use it with the VTuneFocusedConnector:

export KOKKOSP_KERNEL_FILTER=kernels.lst
export KOKKOS_TOOLS_LIBS="{PATH_TO_TOOL_DIRECTORY}/kernel-filter/kp_kernel_filter.so;{PATH_TO_TOOL_DIRECTORY}/vtune-focused-connector/kp_vtune_focused_connector.so"
./application COMMANDS

You must put double quotes around the right-hand side of the export KOKKOS_TOOLS_LIBS=... expression. Otherwise, bash will interpret the semicolon as the end of the expression, and attempt to run the second .so file as an executable (likely resulting in a segmentation fault, as it's not a proper executable).

This tool does not use any additional resources.

Output

The output depends on the tool which is used in conjunction with KernelFilter. See for example: VTuneFocusedConnector.

Clone this wiki locally