Skip to content

Remove use of DPC++ features deprecated in 2021.4 and open source intel/llvm compiler #603

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 4 commits into from
Oct 4, 2021

Conversation

oleksandr-pavlyk
Copy link
Contributor

Also replaced sycl::ONEAPI::filter_selector with sycl::ext::oneapi::filter_selector

The packages compiles using open source SYCL compiler after these changes, specifically I used

(py39) [13:20:15 ansatnuc04 dpctl]$ clang++ --version
clang version 14.0.0 (https://github.com/intel/llvm 7c17ad9a2bfbf6ff2757f8c7fbd2939841f35fa5)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /localdisk/work/opavlyk/sycl_workspace/llvm/build/bin

Only one meaningful failure in the so compiled package:

>       dpctl_prog.create_program_from_spirv(q, spirv)

dpctl/tests/test_sycl_program.py:93:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
dpctl/program/_program.pyx:178: in dpctl.program._program.create_program_from_spirv
    cpdef create_program_from_spirv(SyclQueue q, const unsigned char[:] IL,
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

>   raise SyclProgramCompilationError()
E   dpctl.program._program.SyclProgramCompilationError

dpctl/program/_program.pyx:209: SyclProgramCompilationError
--------------------------------------------------------------------------- Captured stderr call ----------------------------------------------------------------------------
The level zero loader dynamic library could not be opened.
ZeModuleCreateFn is invalid.
========================================================================== short test summary info ==========================================================================
FAILED dpctl/tests/test_sycl_program.py::test_create_program_from_spirv_l0 - dpctl.program._program.SyclProgramCompilationError

but not sure of the cause.

This change closes #602, although I think changes here will need adjustments to ensure the package can be built by using both newer and older compiler versions.

@oleksandr-pavlyk
Copy link
Contributor Author

This change works well with oneAPI 2021.4. I just rebased the branch on top of the master.

Unless we want to maintain backward compatibility with 2021.3, we could just merge this.

If maintaining compatibility is an option, we need a type for vector_class and for the namespace of filter_selector which changed between versions.

@oleksandr-pavlyk
Copy link
Contributor Author

@diptorupd ping

@oleksandr-pavlyk oleksandr-pavlyk force-pushed the cleanup/vector_class-new-compiler branch from 60f589c to 43b1f76 Compare October 1, 2021 19:49
@oleksandr-pavlyk oleksandr-pavlyk marked this pull request as ready for review October 1, 2021 19:49
@coveralls
Copy link
Collaborator

coveralls commented Oct 1, 2021

Coverage Status

Coverage decreased (-0.4%) to 73.804% when pulling ab07506 on cleanup/vector_class-new-compiler into a8f4254 on master.

@oleksandr-pavlyk
Copy link
Contributor Author

oleksandr-pavlyk commented Oct 1, 2021

Coverage drop is entirely in Python API and is due to change in #606, additional tests should be added in a separate PR.

In fact the coverage of dpctl-capi increased.

@oleksandr-pavlyk oleksandr-pavlyk changed the title Replaced uses of sycl::vector_class with std::vector Remove use of DPC++ features deprecated in 2021.4 and open source intel/llvm compiler Oct 4, 2021
sycl::vector_class is deprecated in 2021.4, and completly
removed in open source compiler.

The packages compiles using open source SYCL compiler after these
changes.
In oneAPI 2021.3 the namespace of filter_selector class is different
Remove all uses of type conversions of Vector and underlyng C++ classes

Used DPCTLDevice_CreateSubDevicesEqually instead of building the vector
explicitly and casting it to DPCTLDeviceVectorRef.
@oleksandr-pavlyk oleksandr-pavlyk force-pushed the cleanup/vector_class-new-compiler branch from 50285f7 to ab07506 Compare October 4, 2021 19:18
@@ -82,8 +82,13 @@ __dpctl_give DPCTLSyclDeviceSelectorRef DPCTLCPUSelector_Create()
__dpctl_give DPCTLSyclDeviceSelectorRef
DPCTLFilterSelector_Create(__dpctl_keep const char *filter_str)
{
#if __SYCL_COMPILER_VERSION < 20210925
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need this if-def or should just supporting 2021.3 and up be enough?

Copy link
Contributor Author

@oleksandr-pavlyk oleksandr-pavlyk Oct 4, 2021

Choose a reason for hiding this comment

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

We need it. The change happened between 2021.3 and 2021.4. We need both, since coverage does not work in 2021.4

Copy link
Contributor

Choose a reason for hiding this comment

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

aha right. OK

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!

@oleksandr-pavlyk oleksandr-pavlyk merged commit 59d4d65 into master Oct 4, 2021
@oleksandr-pavlyk oleksandr-pavlyk deleted the cleanup/vector_class-new-compiler branch October 4, 2021 19:44
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.

dpctl-capi can no longer be built with Open-source LLVM/SYCL compiler
3 participants