Skip to content

Conversation

@maximdimakov
Copy link
Contributor

@maximdimakov maximdimakov commented Jan 26, 2021

set_final_data() method had compilation error due to lack of the data() method for the std::vector. The fix is needed for support vector
Test: intel/llvm-test-suite#122

Signed-off-by: mdimakov [email protected]

@maximdimakov maximdimakov requested a review from a team as a code owner January 26, 2021 11:35
@maximdimakov maximdimakov requested a review from s-kanaev January 26, 2021 11:35
Signed-off-by: mdimakov <[email protected]>
Copy link
Contributor

@s-kanaev s-kanaev left a comment

Choose a reason for hiding this comment

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

The change looks good in general.
@maximdimakov , could you, please, update description of this patch with link to PR with test at intel/llvm-test-suite?

Copy link
Contributor

@vladimirlaz vladimirlaz left a comment

Choose a reason for hiding this comment

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

Please add test for this case

Copy link
Contributor

@s-kanaev s-kanaev left a comment

Choose a reason for hiding this comment

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

Looks good overall.

using EnableIfOutputIteratorT = enable_if_t<
/*is_output_iterator<T>::value &&*/ !std::is_pointer<T>::value>;
/*is_output_iterator<T>::value &&*/ !std::is_pointer<T>::value &&
!std::is_same<typename T::value_type, bool>::value>;
Copy link
Contributor

Choose a reason for hiding this comment

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

@alexbatashev, @sergey-semenov, could you, please, help reviewing this change?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm afraid this is going to break some use cases: https://godbolt.org/z/nznfq1

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is the test SYCL/buffer/buffer.cpp . There are a lot of checks, including pointer (for ex int*, void*). The only compilation error was the error with void*, because there was an iterator_value_type_t and void type was trying to convert to void&. With typename T::value_type all the checks were passed

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok, sounds good to me

@s-kanaev s-kanaev requested a review from vladimirlaz January 29, 2021 08:46
@romanovvlad
Copy link
Contributor

@maximdimakov Could you please provide more details on the root cause of the problem to include it into the final commit message?

@maximdimakov
Copy link
Contributor Author

@romanovvlad I updated the description. Does it look good?

@romanovvlad
Copy link
Contributor

ated the description. Does it look good?

Yes, thanks.

@keryell
Copy link
Contributor

keryell commented Jan 29, 2021

It is not clear what you are trying to fix here and how you are fixing it since this is uncommented code...
I first thought it was a joke by reading std::vector<bool> in the subject. :-)

@maximdimakov maximdimakov changed the title [SYCL] Fix set_final_data(..) for vector<bool> [SYCL] Fix set_final_data(..) for vector<bool> iterator Feb 1, 2021
@maximdimakov
Copy link
Contributor Author

@keryell Is it necessary to add comments? This is just the check of vector iterator and then calling the new set_final_data() for it.
Changed the title for more clarity

@romanovvlad romanovvlad merged commit 084d83a into intel:sycl Feb 1, 2021
@keryell
Copy link
Contributor

keryell commented Feb 1, 2021

@keryell Is it necessary to add comments? This is just the check of vector iterator and then calling the new set_final_data() for it.
Changed the title for more clarity

Almost anything with vector of bool is a joke in C++.
So when I see such a code WITHOUT ANY COMMENT, I am just afraid... :-(
What is the problem? Why is it not working? This should be clear in the code...
But it might be also a way you have found to talk about this project on Twitter in the C++ Twitter-sphere, just because it uses a vector of bool... ;-)
@erichkeane can you investigate into this?

@erichkeane
Copy link
Contributor

Not sure what you want me to take a look at, but vector is not a "Container" as it doesn't meet the requirements. It appears to me that this attempts to disallow any std-container of bool (note, it isn't disallowing JUST vector, not sure when it is used otherwise).

It does add the constraint on the type-trait that it can only be used on those std-containers however, since of course it attempts to use the ::value_type of "T" (thus making the is_pointer redundant). I'm guessing this shouldn't have been merged based on that alone.

iclsrc pushed a commit that referenced this pull request Apr 21, 2025
The extension add translation from LLVM's bfloat type to OpTypeFloat
%width% 16 %fp encoding% BFloat16KHR

Mangling follows LLVM's rules for the type.

Spec PR: KhronosGroup/SPIRV-Registry#323

---------

Signed-off-by: Sidorov, Dmitry <[email protected]>
Co-authored-by: Aziz, Michael <[email protected]>

Original commit:
KhronosGroup/SPIRV-LLVM-Translator@d3b7a12ee9b8f2b
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.

7 participants