-
Notifications
You must be signed in to change notification settings - Fork 769
[SYCL] Add Clang support for FPGA loop fusion function attributes #2877
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
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
324390f
[SYCL] Add Clang support for FPGA loop fusion function attributes
elizabethandrews c94d591
Disable host support.
elizabethandrews c6cbe4d
Applied review comments -
elizabethandrews 1b9ce65
Revert change which is not required anymore
elizabethandrews d761846
Merge remote-tracking branch 'intel_llvm/sycl' into loopFusion2
elizabethandrews c7ba4b3
Fix incorrect conflict resolution
elizabethandrews 8c3c5b4
Implement review comments.
elizabethandrews 26b2e52
Applied review comment to enable semantic processing of attribute
elizabethandrews 26bbc04
Apply review comments - add missing fullstops in comments
elizabethandrews 702bed5
Fix Windows test fail
elizabethandrews File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
// RUN: %clang_cc1 -fsycl -fsycl-is-device -internal-isystem %S/Inputs -triple spir64-unknown-unknown-sycldevice -emit-llvm -o - %s | FileCheck %s | ||
|
||
#include "sycl.hpp" | ||
|
||
using namespace cl::sycl; | ||
queue q; | ||
|
||
[[intel::loop_fuse(5)]] void foo() {} | ||
|
||
template <int SIZE> | ||
class KernelFunctor5 { | ||
public: | ||
[[intel::loop_fuse(SIZE)]] void operator()() const {} | ||
}; | ||
|
||
void bar() { | ||
|
||
q.submit([&](handler &h) { | ||
// Test template argument. | ||
KernelFunctor5<5> f5; | ||
h.single_task<class kernel_name_1>(f5); | ||
|
||
// Test different argument sizes. | ||
// Emit 1 if there is no argument. | ||
h.single_task<class kernel_name_2>( | ||
[]() [[intel::loop_fuse]]{}); | ||
h.single_task<class kernel_name_3>( | ||
[]() [[intel::loop_fuse(0)]]{}); | ||
h.single_task<class kernel_name_4>( | ||
[]() [[intel::loop_fuse(1)]]{}); | ||
h.single_task<class kernel_name_5>( | ||
[]() [[intel::loop_fuse(10)]]{}); | ||
|
||
// Test attribute is not propagated. | ||
h.single_task<class kernel_name_6>( | ||
[]() { foo(); }); | ||
}); | ||
} | ||
|
||
// CHECK: define spir_kernel void @"{{.*}}kernel_name_1"() {{.*}} !loop_fuse ![[LF5:[0-9]+]] | ||
// CHECK: define spir_kernel void @"{{.*}}kernel_name_2"() {{.*}} !loop_fuse ![[LF1:[0-9]+]] | ||
// CHECK: define spir_kernel void @"{{.*}}kernel_name_3"() {{.*}} !loop_fuse ![[LF0:[0-9]+]] | ||
// CHECK: define spir_kernel void @"{{.*}}kernel_name_4"() {{.*}} !loop_fuse ![[LF1]] | ||
// CHECK: define spir_kernel void @"{{.*}}kernel_name_5"() {{.*}} !loop_fuse ![[LF10:[0-9]+]] | ||
// CHECK: define spir_kernel void @"{{.*}}kernel_name_6"() | ||
// CHECK-NOT: !loop_fuse | ||
// CHECK-SAME: { | ||
// CHECK: define spir_func void @{{.*}}foo{{.*}} !loop_fuse ![[LF5]] | ||
// CHECK: ![[LF5]] = !{i32 5, i32 0} | ||
// CHECK: ![[LF1]] = !{i32 1, i32 0} | ||
// CHECK: ![[LF0]] = !{i32 0, i32 0} | ||
// CHECK: ![[LF10]] = !{i32 10, i32 0} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
// RUN: %clang_cc1 -fsycl -fsycl-is-device -internal-isystem %S/Inputs -triple spir64-unknown-unknown-sycldevice -emit-llvm -o - %s | FileCheck %s | ||
|
||
#include "sycl.hpp" | ||
|
||
using namespace cl::sycl; | ||
queue q; | ||
|
||
[[intel::loop_fuse_independent(5)]] void foo() {} | ||
|
||
template <int SIZE> | ||
class KernelFunctor5 { | ||
public: | ||
[[intel::loop_fuse_independent(SIZE)]] void operator()() const {} | ||
}; | ||
|
||
void bar() { | ||
|
||
q.submit([&](handler &h) { | ||
// Test template argument. | ||
KernelFunctor5<5> f5; | ||
h.single_task<class kernel_name_1>(f5); | ||
|
||
// Test different argument sizes. | ||
// Emit 1 if there is no argument. | ||
h.single_task<class kernel_name_2>( | ||
[]() [[intel::loop_fuse_independent]]{}); | ||
h.single_task<class kernel_name_3>( | ||
[]() [[intel::loop_fuse_independent(0)]]{}); | ||
h.single_task<class kernel_name_4>( | ||
[]() [[intel::loop_fuse_independent(1)]]{}); | ||
h.single_task<class kernel_name_5>( | ||
[]() [[intel::loop_fuse_independent(10)]]{}); | ||
|
||
// Test attribute is not propagated. | ||
h.single_task<class kernel_name_6>( | ||
[]() { foo(); }); | ||
}); | ||
} | ||
|
||
// CHECK: define spir_kernel void @"{{.*}}kernel_name_1"() {{.*}} !loop_fuse ![[LFI5:[0-9]+]] | ||
elizabethandrews marked this conversation as resolved.
Show resolved
Hide resolved
|
||
// CHECK: define spir_kernel void @"{{.*}}kernel_name_2"() {{.*}} !loop_fuse ![[LFI1:[0-9]+]] | ||
// CHECK: define spir_kernel void @"{{.*}}kernel_name_3"() {{.*}} !loop_fuse ![[LFI0:[0-9]+]] | ||
// CHECK: define spir_kernel void @"{{.*}}kernel_name_4"() {{.*}} !loop_fuse ![[LFI1]] | ||
// CHECK: define spir_kernel void @"{{.*}}kernel_name_5"() {{.*}} !loop_fuse ![[LFI10:[0-9]+]] | ||
// CHECK: define spir_kernel void @"{{.*}}kernel_name_6"() | ||
// CHECK-NOT: !loop_fuse | ||
// CHECK-SAME: { | ||
// CHECK: define spir_func void @{{.*}}foo{{.*}} !loop_fuse ![[LFI5]] | ||
// CHECK: ![[LFI5]] = !{i32 5, i32 1} | ||
// CHECK: ![[LFI1]] = !{i32 1, i32 1} | ||
// CHECK: ![[LFI0]] = !{i32 0, i32 1} | ||
// CHECK: ![[LFI10]] = !{i32 10, i32 1} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.