Skip to content

[SYCL] Tentative fix for properties_kernel_device_has_warning.cpp #19658

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

Open
wants to merge 1 commit into
base: sycl
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
// RUN: %clangxx -fsycl-device-only -Xclang -verify -Xclang -verify-ignore-unexpected=note %s
//
// XFAIL: *
// XFAIL-TRACKER: https://github.com/intel/llvm/issues/19409

// Tests for warnings when propagated aspects do not match the aspects available
// in a function, as specified through the 'sycl::device_has' property.
Expand Down Expand Up @@ -85,6 +82,7 @@ template <typename T> struct K_funcIndirectlyUsingFP16 {
template <typename T> struct K_funcIndirectlyUsingFP16_Warn16 {
T *Props;
K_funcIndirectlyUsingFP16_Warn16(T Props_param) { Props = &Props_param; };
// expected-warning-re@+2 {{function '{{.*}}' uses aspect 'fp16' not listed in its 'device_has' property}}
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the compiler producing the warning two times now?

Copy link
Contributor

Choose a reason for hiding this comment

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

Applies to all the changes.

// expected-warning-re@+1 {{function '{{.*}}' uses aspect 'fp16' not listed in its 'device_has' property}}
void operator()() const { int a = funcIndirectlyUsingFP16(1, 2); }
auto get(properties_tag) const { return *Props; }
Expand All @@ -100,6 +98,7 @@ template <typename T> struct K_funcUsingFP16AndFP64 {
template <typename T> struct K_funcUsingFP16AndFP64_Warn16 {
T *Props;
K_funcUsingFP16AndFP64_Warn16(T Props_param) { Props = &Props_param; };
// expected-warning-re@+2 {{function '{{.*}}' uses aspect 'fp16' not listed in its 'device_has' property}}
// expected-warning-re@+1 {{function '{{.*}}' uses aspect 'fp16' not listed in its 'device_has' property}}
void operator()() const { int a = funcUsingFP16AndFP64(1, 2); }
auto get(properties_tag) const { return *Props; }
Expand All @@ -108,6 +107,7 @@ template <typename T> struct K_funcUsingFP16AndFP64_Warn16 {
template <typename T> struct K_funcUsingFP16AndFP64_Warn64 {
T *Props;
K_funcUsingFP16AndFP64_Warn64(T Props_param) { Props = &Props_param; };
// expected-warning-re@+2 {{function '{{.*}}' uses aspect 'fp64' not listed in its 'device_has' property}}
// expected-warning-re@+1 {{function '{{.*}}' uses aspect 'fp64' not listed in its 'device_has' property}}
void operator()() const { int a = funcUsingFP16AndFP64(1, 2); }
auto get(properties_tag) const { return *Props; }
Expand All @@ -116,6 +116,8 @@ template <typename T> struct K_funcUsingFP16AndFP64_Warn64 {
template <typename T> struct K_funcUsingFP16AndFP64_Warn1664 {
T *Props;
K_funcUsingFP16AndFP64_Warn1664(T Props_param) { Props = &Props_param; };
// expected-warning-re@+4 {{function '{{.*}}' uses aspect 'fp16' not listed in its 'device_has' property}}
// expected-warning-re@+3 {{function '{{.*}}' uses aspect 'fp64' not listed in its 'device_has' property}}
// expected-warning-re@+2 {{function '{{.*}}' uses aspect 'fp16' not listed in its 'device_has' property}}
// expected-warning-re@+1 {{function '{{.*}}' uses aspect 'fp64' not listed in its 'device_has' property}}
void operator()() const { int a = funcUsingFP16AndFP64(1, 2); }
Expand Down Expand Up @@ -150,6 +152,7 @@ template <typename T> struct K_funcIndirectlyUsingCPU {
template <typename T> struct K_funcIndirectlyUsingCPU_WarnCPU {
T *Props;
K_funcIndirectlyUsingCPU_WarnCPU(T Props_param) { Props = &Props_param; };
// expected-warning-re@+2 {{function '{{.*}}' uses aspect 'cpu' not listed in its 'device_has' property}}
// expected-warning-re@+1 {{function '{{.*}}' uses aspect 'cpu' not listed in its 'device_has' property}}
void operator()() const { int a = funcIndirectlyUsingCPU(1, 2); }
auto get(properties_tag) const { return *Props; }
Expand All @@ -165,6 +168,7 @@ template <typename T> struct K_funcUsingCPUAndFP64 {
template <typename T> struct K_funcUsingCPUAndFP64_WarnCPU {
T *Props;
K_funcUsingCPUAndFP64_WarnCPU(T Props_param) { Props = &Props_param; };
// expected-warning-re@+2 {{function '{{.*}}' uses aspect 'cpu' not listed in its 'device_has' property}}
// expected-warning-re@+1 {{function '{{.*}}' uses aspect 'cpu' not listed in its 'device_has' property}}
void operator()() const { int a = funcUsingCPUAndFP64(1, 2); }
auto get(properties_tag) const { return *Props; }
Expand All @@ -173,6 +177,7 @@ template <typename T> struct K_funcUsingCPUAndFP64_WarnCPU {
template <typename T> struct K_funcUsingCPUAndFP64_Warn64 {
T *Props;
K_funcUsingCPUAndFP64_Warn64(T Props_param) { Props = &Props_param; };
// expected-warning-re@+2 {{function '{{.*}}' uses aspect 'fp64' not listed in its 'device_has' property}}
// expected-warning-re@+1 {{function '{{.*}}' uses aspect 'fp64' not listed in its 'device_has' property}}
void operator()() const { int a = funcUsingCPUAndFP64(1, 2); }
auto get(properties_tag) const { return *Props; }
Expand All @@ -181,6 +186,8 @@ template <typename T> struct K_funcUsingCPUAndFP64_Warn64 {
template <typename T> struct K_funcUsingCPUAndFP64_Warn64CPU {
T *Props;
K_funcUsingCPUAndFP64_Warn64CPU(T Props_param) { Props = &Props_param; };
// expected-warning-re@+4 {{function '{{.*}}' uses aspect 'cpu' not listed in its 'device_has' property}}
// expected-warning-re@+3 {{function '{{.*}}' uses aspect 'fp64' not listed in its 'device_has' property}}
// expected-warning-re@+2 {{function '{{.*}}' uses aspect 'cpu' not listed in its 'device_has' property}}
// expected-warning-re@+1 {{function '{{.*}}' uses aspect 'fp64' not listed in its 'device_has' property}}
void operator()() const { int a = funcUsingCPUAndFP64(1, 2); }
Expand Down