Skip to content

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

Merged
merged 9 commits into from
Jan 20, 2021

Conversation

diptorupd
Copy link
Contributor

Makes improvements to our Cmake scripts and moves all the CMake changes out of #241 to this PR.

Summary of changes:

  • Moves all logic to search for dpcpp into a module called FindDPCPP.
  • Adds a new option DPCTL_GENERATE_COVERAGE to enable coverage generation rules and dependencies.
  • Adds two rules (llvm-cov and lcov-genhtml) to generate code coverage for the C API when configured with -DDPCTL_GENERATE_COVERAGE.
    • Use make llvm-cov to generate the summary report for code coverage using llvm-cov. llvm-cov is part of standard LLVM tools and part of oneapi install.
    • Use make lcov-genhtml to generate a detailed html report for code coverage and missing segments of dpctl C API sources. Requires lcov 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 called dpctl-c-api-coverage.
  • Other changes are level zero related that have been moved out of Level zero codegen #241.
    • A new module FindLevelZero checks if the level zero loader and headers are found on the build system.
    • A new option DPCTL_ENABLE_L0_PROGRAM_CREATION to toggle level zero program creation support. (Note the flag does nothing for now, as the related code changes are in Level zero codegen #241)
  • A generated configure file to store what options were used to build dpctl-CAPI. The file dpctl_config.h gets auto-generated in the install directory.

Diptorup Deb added 2 commits January 18, 2021 19:36
    -- 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.
@diptorupd diptorupd mentioned this pull request Jan 19, 2021
@diptorupd
Copy link
Contributor Author

@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.

Copy link
Contributor

@PokhodenkoSA PokhodenkoSA left a 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"])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

V=1 - for verbose?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

@diptorupd diptorupd merged commit fdb5569 into IntelPython:master Jan 20, 2021
@diptorupd diptorupd deleted the cmake_improvements branch January 20, 2021 18:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants