Skip to content
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

Use readelf on pi_level_zero library to find exact name of ze_loader #617

Merged
merged 1 commit into from
Oct 4, 2021

Conversation

oleksandr-pavlyk
Copy link
Collaborator

@oleksandr-pavlyk oleksandr-pavlyk commented Oct 3, 2021

Store that in include/Config/dpctl_config.h and use the define in
dpctl_sycl_program_interface.cpp

CMake is running the equivalent of the following

readelf -d $DPCPP_ROOT/lib/libpi_level_zero.so | grep libze_loader | grep -Po "libze_loader[^\]]*"
libze_loader.so.1

This change, together with #603 and #616 make project buildable with OS compiler.

@coveralls
Copy link
Collaborator

coveralls commented Oct 4, 2021

Coverage Status

Coverage increased (+0.4%) to 74.199% when pulling 55a532e on ze-loader-name into 1b713d2 on master.

dpctl-capi/CMakeLists.txt Outdated Show resolved Hide resolved
find_program(READELF_PROG readelf)
find_program(GREP_PROG grep)
execute_process(
COMMAND ${READELF_PROG} -d ${PI_LEVEL_ZERO_LIB}
Copy link
Contributor

Choose a reason for hiding this comment

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

indentation is off.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I fixed the indentation.

Copy link
Contributor

@diptorupd diptorupd left a comment

Choose a reason for hiding this comment

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

Thanks for getting this done. Except for the minor indentation issues that need to be addressed, the PR is good to go.

Store that in include/Config/dpctl_config.h and use the define in
dpctl_sycl_program_interface.cpp

CMake is running the equivalent of the following

```
readelf -d $DPCPP_ROOT/lib/libpi_level_zero.so | grep libze_loader | grep -Po "libze_loader[^\]]*"
libze_loader.so.1
```
Copy link
Contributor

@diptorupd diptorupd left a comment

Choose a reason for hiding this comment

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

LGTM!

@oleksandr-pavlyk oleksandr-pavlyk merged commit a8f4254 into master Oct 4, 2021
@oleksandr-pavlyk oleksandr-pavlyk deleted the ze-loader-name branch October 4, 2021 16:49
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.

3 participants