-
Notifications
You must be signed in to change notification settings - Fork 787
[SYCL] [FPGA] Update handler of variadic template argument list in fpga_utils.hpp to support more types other than int32_t #3957
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
13 commits
Select commit
Hold shift + click to select a range
c7da99b
Update fpga_utils.hpp
shuoniu-intel 19000e8
Update fpga_lsu.hpp
shuoniu-intel 7bd756d
Clang-format fpga_lsu.hpp
shuoniu-intel ab5a614
Clang-format fpga_utils.hpp
shuoniu-intel b6d2035
Clang-format fpga_utils.hpp
shuoniu-intel 86c69e5
Merge branch 'intel:sycl' into shuoniu-br-template-list
shuoniu-intel 5498834
Update fpga_utils.hpp
shuoniu-intel 573f3c9
Merge branch 'intel:sycl' into shuoniu-br-template-list
shuoniu-intel 2b96d49
Create arbitrary_template_arg.cpp
shuoniu-intel 17eac46
Update arbitrary_template_arg.cpp
shuoniu-intel fce6391
Update arbitrary_template_arg.cpp
shuoniu-intel 4f44868
Previous tests timeout, rerun tests.
shuoniu-intel 44005ae
Update arbitrary_template_arg.cpp
shuoniu-intel 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// RUN: %clangxx -fsycl -fsyntax-only -Xclang -verify %s -Xclang -verify-ignore-unexpected=note,warning | ||
// expected-no-diagnostics | ||
|
||
// This test performs basic check of SYCL FPGA arbitrary template argument list. | ||
|
||
#include <CL/sycl.hpp> | ||
#include <CL/sycl/INTEL/fpga_utils.hpp> | ||
#include <iostream> | ||
|
||
enum class enumClass { first, second }; | ||
|
||
struct testIntID; | ||
template <int _N> struct testInt : std::integral_constant<int, _N> { | ||
using type_id = testIntID; | ||
}; | ||
|
||
struct testEnumID; | ||
template <enumClass _N> | ||
struct testEnum : std::integral_constant<enumClass, _N> { | ||
using type_id = testEnumID; | ||
}; | ||
|
||
template <int ExpectedIntValue, enumClass ExpectedEnumValue, class... _Params> | ||
void func() { | ||
static_assert(sycl::INTEL::_GetValue<testInt<0>, _Params...>::value == | ||
ExpectedIntValue); | ||
static_assert( | ||
sycl::INTEL::_GetValue<testEnum<enumClass::first>, _Params...>::value == | ||
ExpectedEnumValue); | ||
} | ||
|
||
int main() { | ||
func<0, enumClass::first>(); | ||
func<1, enumClass::first, testInt<1>>(); | ||
func<0, enumClass::second, testEnum<enumClass::second>>(); | ||
func<1, enumClass::second, testInt<1>, testEnum<enumClass::second>>(); | ||
func<1, enumClass::second, testEnum<enumClass::second>, testInt<1>>(); | ||
} |
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.