Skip to content

[SYCL][NFC] Update tests for use_stall_enable_clusters attribute #4060

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 2 commits into from
Jul 7, 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
13 changes: 0 additions & 13 deletions clang/test/CodeGenSYCL/stall_enable_device.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
// RUN: %clang_cc1 -fsycl-is-device -internal-isystem %S/Inputs -triple spir64-unknown-unknown-sycldevice -disable-llvm-passes -emit-llvm -o - %s | FileCheck %s

// Tests for IR of Intel FPGA [[intel::use_stall_enable_clusters]] function attribute on Device.
// The metadata to be attached to the functionDecl that the attribute is applied to.
// The attributes get propagated to the kernel metadata i.e. spir_kernel if directly applied
// through functors/lambda function.

#include "sycl.hpp"

Expand All @@ -26,11 +23,6 @@ class Foo {
[[intel::use_stall_enable_clusters]] void operator()() const {}
};

class Functor {
public:
[[intel::use_stall_enable_clusters]] void operator()() const {}
};

int main() {
q.submit([&](handler &h) {
// CHECK: define {{.*}}spir_kernel void @{{.*}}test_kernel1() {{.*}} !stall_enable ![[NUM4:[0-9]+]]
Expand Down Expand Up @@ -62,11 +54,6 @@ int main() {
// CHECK: define {{.*}}spir_kernel void @{{.*}}test_kernel5() {{.*}} !stall_enable ![[NUM4]]
h.single_task<class test_kernel5>(
[]() [[intel::use_stall_enable_clusters]]{});

// CHECK: define {{.*}}spir_kernel void @{{.*}}test_kernel6() {{.*}} !stall_enable ![[NUM4]]
// CHECK: define {{.*}}spir_func void @{{.*}}Functor{{.*}}(%class._ZTS7Functor.Functor addrspace(4)* align 1 dereferenceable_or_null(1) %this) #3 comdat align 2 !stall_enable ![[NUM4]]
Functor f1;
h.single_task<class test_kernel6>(f1);
});
return 0;
}
Expand Down
16 changes: 8 additions & 8 deletions clang/test/SemaSYCL/stall_enable_device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ queue q;
[[intel::use_stall_enable_clusters]] void func() {}
// CHECK: FunctionDecl{{.*}}used func 'void ()'
// CHECK-NEXT: CompoundStmt{{.*}}
// CHECK-NEXT-NEXT: SYCLIntelUseStallEnableClustersAttr{{.*}}
// CHECK-NEXT-NEXT: SYCLIntelUseStallEnableClustersAttr

// Tests for incorrect argument values for Intel FPGA use_stall_enable_clusters function attribute.
#ifdef TRIGGER_ERROR
Expand All @@ -25,7 +25,7 @@ struct FuncObj {
[[intel::use_stall_enable_clusters]] void operator()() const {}
// CHECK: CXXRecordDecl{{.*}}implicit struct FuncObj
// CHECK-NEXT: CXXMethodDecl{{.*}}used operator() 'void () const'
// CHECK-NEXT-NEXT:SYCLIntelUseStallEnableClustersAttr{{.*}}
// CHECK-NEXT-NEXT:SYCLIntelUseStallEnableClustersAttr
};

// Test attribute is presented on lambda function(applied to a function type for the lambda's call operator).
Expand All @@ -34,15 +34,15 @@ void test3() {
lambda();
// CHECK: FunctionDecl{{.*}}test3
// CHECK: LambdaExpr
// CHECK: SYCLIntelUseStallEnableClustersAttr{{.*}}
// CHECK: SYCLIntelUseStallEnableClustersAttr
}

// Test attribute is presented on functor.
// CHECK: CXXRecordDecl{{.*}}referenced class Functor definition
// CHECK: CXXRecordDecl{{.*}} implicit class Functor
// CHECK: AccessSpecDecl{{.*}} public
// CHECK-NEXT: CXXMethodDecl{{.*}}used operator() 'void () const'
// CHECK-NEXT-NEXT: SYCLIntelUseStallEnableClustersAttr{{.*}}
// CHECK-NEXT-NEXT: SYCLIntelUseStallEnableClustersAttr
class Functor {
public:
[[intel::use_stall_enable_clusters]] void operator()() const {
Expand All @@ -53,25 +53,25 @@ int main() {
q.submit([&](handler &h) {
// Test attribute is propagated to the kernel.
// CHECK-LABEL: FunctionDecl {{.*}}test_kernel1
// CHECK: SYCLIntelUseStallEnableClustersAttr {{.*}}
// CHECK: SYCLIntelUseStallEnableClustersAttr
h.single_task<class test_kernel1>(
FuncObj());

// Test attribute is presented on LambdaExpr called by kernel.
// CHECK-LABEL: FunctionDecl {{.*}}test_kernel2
// CHECK-: SYCLIntelUseStallEnableClustersAttr {{.*}}
// CHECK: SYCLIntelUseStallEnableClustersAttr
h.single_task<class test_kernel2>(
[]() [[intel::use_stall_enable_clusters]]{});

// Test attribute is not propagated to the kernel.
// CHECK-LABEL: FunctionDecl {{.*}}test_kernel3
// CHECK-NOT: SYCLIntelUseStallEnableClustersAttr {{.*}}
// CHECK-NOT: SYCLIntelUseStallEnableClustersAttr
h.single_task<class test_kernel3>(
[]() { func(); });

// Test attribute is applied to kernel if directly applied through functor.
// CHECK-LABEL: FunctionDecl {{.*}}test_kernel4
// CHECK: SYCLIntelUseStallEnableClustersAttr {{.*}}
// CHECK: SYCLIntelUseStallEnableClustersAttr
Functor f2;
h.single_task<class test_kernel4>(f2);
});
Expand Down