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

Fix build of dpctl with sycl nightly from 2025-01-18 #1974

Merged
merged 1 commit into from
Jan 19, 2025

Conversation

oleksandr-pavlyk
Copy link
Collaborator

The failure was caused by TwoOffsets_FixedDimStridedIndexer not being device copyable, consequence of not being trivially copyable, consequence of using const class members contrary to C++ coding guidelines.

https://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines/avoid-const-or-ref-data-members.html

This change adheres to the guidelines by removing const qualifier in class members.

This change also avoids unnecessary copy in constructors of fixed-dim-strided-indexers that take container arguments by values.

  • Have you provided a meaningful PR description?
  • Have you added a test, reproducer or referred to an issue with a reproducer?
  • Have you tested your changes locally for CPU and GPU devices?
  • Have you made sure that new changes do not introduce compiler warnings?
  • Have you checked performance impact of proposed changes?
  • Have you added documentation for your changes, if necessary?
  • Have you added your changes to the changelog?
  • If this PR is a work in progress, are you opening the PR as a draft?

The failure was caused by TwoOffsets_FixedDimStridedIndexer
not being device copyable, consequence of not being trivially
copyable, consequence of using const class members contrary to
C++ coding guidelines.

https://clang.llvm.org/extra/clang-tidy/checks/cppcoreguidelines/avoid-const-or-ref-data-members.html

This change adheres to the guidelines by removing const qualifier
in class members.

This change also avoids unnecessary copy in constructors of
fixed-dim-strided-indexers that take container arguments by values.
@oleksandr-pavlyk
Copy link
Collaborator Author

BTW, the build of main branch using latest SYCL bundle failed for this reason: https://github.com/IntelPython/dpctl/actions/runs/12848222222/job/35825346490

/home/runner/work/sycl_bundle/dpcpp_compiler/bin/../include/sycl/detail/is_device_copyable.hpp:99:17: error: static assertion failed due to requirement 'is_device_copyable_v<const dpctl::tensor::offset_utils::TwoOffsets_FixedDimStridedIndexer<1>>': The specified type is not device copyable

Copy link

github-actions bot commented Jan 19, 2025

Deleted rendered PR docs from intelpython.github.com/dpctl, latest should be updated shortly. 🤞

Copy link

Array API standard conformance tests for dpctl=0.19.0dev0=py310h93fe807_484 ran successfully.
Passed: 894
Failed: 2
Skipped: 118

@coveralls
Copy link
Collaborator

Coverage Status

coverage: 88.18%. remained the same
when pulling f2f1221 on fix-os-llvm-build-failure
into f730de1 on master.

Copy link
Collaborator

@ndgrigorian ndgrigorian left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you @oleksandr-pavlyk

In a follow-up PR, I will look over our other structs and classes to eliminate const members.

@oleksandr-pavlyk oleksandr-pavlyk merged commit 14a0cf4 into master Jan 19, 2025
45 of 53 checks passed
@oleksandr-pavlyk oleksandr-pavlyk deleted the fix-os-llvm-build-failure branch January 19, 2025 13:56
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