Skip to content

[SYCL] Avoid HasDefaultValues to be set as IsSet field of SpecConstDescT #3813

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 1 commit into from
May 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions sycl/source/detail/device_image_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,6 @@ class device_image_impl {
const pi::DeviceBinaryImage::PropertyRange &SCDefValRange =
MBinImage->getSpecConstantsDefaultValues();

bool HasDefaultValues = SCDefValRange.begin() != SCDefValRange.end();

// This variable is used to calculate spec constant value offset in a
// flat byte array.
unsigned BlobOffset = 0;
Expand Down Expand Up @@ -256,13 +254,15 @@ class device_image_impl {
// supposed to be called from c'tor.
MSpecConstSymMap[std::string{SCName}].push_back(
SpecConstDescT{/*ID*/ It[0], /*CompositeOffset*/ It[1],
/*Size*/ It[2], BlobOffset, HasDefaultValues});
/*Size*/ It[2], BlobOffset});
BlobOffset += /*Size*/ It[2];
It += NumElements;
}
}
MSpecConstsBlob.resize(BlobOffset);

bool HasDefaultValues = SCDefValRange.begin() != SCDefValRange.end();

if (HasDefaultValues) {
pi::ByteArray DefValDescriptors =
pi::DeviceBinaryProperty(*SCDefValRange.begin()).asByteArray();
Expand Down
4 changes: 2 additions & 2 deletions sycl/unittests/spec_constants/DefaultValues.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ static sycl::unittest::PiImage generateDefaultImage() {
sycl::unittest::PiImage Img = generateDefaultImage();
sycl::unittest::PiImageArray ImgArray{Img};

TEST(DefaultValues, DefaultValuesAreSet) {
TEST(DefaultValues, DISABLED_DefaultValuesAreSet) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Shall we submit some issue to re-enable those tests? Or someone is already working on a fix?

Copy link
Contributor

Choose a reason for hiding this comment

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

@alexbatashev or myself will fix it. Internal ticket was submitted.

sycl::platform Plt{sycl::default_selector()};
if (Plt.is_host()) {
std::cerr << "Test is not supported on host, skipping\n";
Expand Down Expand Up @@ -238,7 +238,7 @@ TEST(DefaultValues, DefaultValuesAreSet) {
EXPECT_EQ(SpecConstVal1, 8);
}

TEST(DefaultValues, DefaultValuesAreOverriden) {
TEST(DefaultValues, DISABLED_DefaultValuesAreOverriden) {
sycl::platform Plt{sycl::default_selector()};
if (Plt.is_host()) {
std::cerr << "Test is not supported on host, skipping\n";
Expand Down