-
Notifications
You must be signed in to change notification settings - Fork 30
Cmake improvements and Coverage for C API #242
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
-- Create cmake modules to store logic to search for dpcpp, level zero, llvm-cov, lcov. -- Add new Cmake options to control level zero program creation and code coverage reporting. -- Two new rules llvm-cov and lcov-genhtml to produce code coverage metrics.
@PokhodenkoSA @reazulhoque @oleksandr-pavlyk Can you guys try out this PR? I will like to merge soon as my L0 work depends on the CMake changes here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
"-DCMAKE_C_COMPILER:PATH=" + os.path.join(DPCPP_ROOT, "bin", "clang"), | ||
"-DCMAKE_CXX_COMPILER:PATH=" + os.path.join(DPCPP_ROOT, "bin", "clang++"), | ||
backends, | ||
] | ||
subprocess.check_call(cmake_args, stderr=subprocess.STDOUT, shell=False) | ||
subprocess.check_call(["make", "-j", "4"]) | ||
subprocess.check_call(["make", "V=1", "-j", "4"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
V=1 - for verbose?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes
Makes improvements to our Cmake scripts and moves all the CMake changes out of #241 to this PR.
Summary of changes:
FindDPCPP
.DPCTL_GENERATE_COVERAGE
to enable coverage generation rules and dependencies.llvm-cov
andlcov-genhtml
) to generate code coverage for the C API when configured with-DDPCTL_GENERATE_COVERAGE
.make llvm-cov
to generate the summary report for code coverage usingllvm-cov
. llvm-cov is part of standard LLVM tools and part of oneapi install.make lcov-genhtml
to generate a detailed html report for code coverage and missing segments of dpctl C API sources. Requireslcov
to be installed on the system. Note that the new option-DDPCTL_COVERAGE_REPORT_OUTPUT_DIR
can be used to configure where the html files are saved. If nothing is specified, the report is saved in the build directory in a subdirectory calleddpctl-c-api-coverage
.dpctl_config.h
gets auto-generated in the install directory.