Skip to content

Conversation

@steffenlarsen
Copy link
Contributor

The device_has property should have behavior similar to that of the sycl::device_has attribute. This commit makes the aspect propagation pass issue the same diagnostic as done for when an application uses aspects that are not in sycl::device_has, albeit with a small change to the diagnostics message to differentiate the origin of the device_has, be it property or attribute.

The device_has property should have behavior similar to that of the
sycl::device_has attribute. This commit makes the aspect propagation
pass issue the same diagnostic as done for when an application uses
aspects that are not in sycl::device_has, albeit with a small change to
the diagnostics message to differentiate the origin of the device_has,
be it property or attribute.

Signed-off-by: Larsen, Steffen <[email protected]>
@steffenlarsen steffenlarsen requested a review from a team November 7, 2022 12:00
@steffenlarsen steffenlarsen requested review from a team as code owners November 7, 2022 12:00
Signed-off-by: Larsen, Steffen <[email protected]>
Copy link
Contributor

@elizabethandrews elizabethandrews left a comment

Choose a reason for hiding this comment

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

FE changes LGTM

Copy link
Contributor

@smanna12 smanna12 left a comment

Choose a reason for hiding this comment

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

FE changes look good to me.

Copy link
Contributor

@aelovikov-intel aelovikov-intel left a comment

Choose a reason for hiding this comment

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

Some NITs inline, could be addressed post-commit.

using namespace sycl::ext::oneapi::experimental;

// expected-note-re@+1 4 {{propagated from call to function '{{.*}}Struct1::Struct1({{.*}})'}}
struct [[__sycl_detail__::__uses_aspects__(aspect::fp16)]] Struct1 {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: I'd suggest renaming structs/funcs to something like StructWithFP16, use_fp16, use_cpu, etc. Not sure how much help it would be though.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They have been renamed to something more informative. Is this along the lines of what you were thinking?

Comment on lines +19 to +22
struct KernelFunctorWithOnlyWGSizeHintAttr {
// expected-warning@+1 {{kernel has both attribute 'work_group_size_hint' and kernel properties; conflicting properties are ignored}}
void operator() [[sycl::work_group_size_hint(32)]] () const {}
};
Copy link
Contributor

Choose a reason for hiding this comment

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

Is that based on the place where the kernel is submitted?

Copy link
Contributor Author

@steffenlarsen steffenlarsen Nov 8, 2022

Choose a reason for hiding this comment

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

I agree, technically it would be better to do it at submission, but to my knowledge there's no good way to get back to the submission from the level where we can detect this mismatch. If I am wrong I think it's something we should investigate in a separate patch as this diagnostic isn't new to this patch but is just added for device_has and cases are added for work_group_size_hint because they were affected by a bug when the diagnostic was first introduced.

Copy link
Contributor

@premanandrao premanandrao left a comment

Choose a reason for hiding this comment

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

FE changes LGTM

Signed-off-by: Larsen, Steffen <[email protected]>
@pvchupin
Copy link
Contributor

pvchupin commented Nov 8, 2022

Opened #8798 for timeout issue with more details.

@steffenlarsen steffenlarsen merged commit c02e5a0 into intel:sycl Nov 9, 2022
@steffenlarsen
Copy link
Contributor Author

extensions/properties/properties_kernel_device_has_warning.cpp is failing in post-commit for Linux (no assert). I am investigating.

@steffenlarsen
Copy link
Contributor Author

Post-commit fix here: #7329

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