Skip to content

Commit b41e8e4

Browse files
[SYCL] Fix error: too few template arguments for class template 'instance' (#4315)
Add default argument for class template 'instance' to prevent possible compile-time errors.
1 parent 80d02e7 commit b41e8e4

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

sycl/include/CL/sycl/properties/accessor_properties.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ namespace ext {
4848
namespace intel {
4949
namespace property {
5050
struct buffer_location {
51-
template <int A> struct instance {
51+
template <int A = 0> struct instance {
5252
template <int B>
5353
constexpr bool operator==(const buffer_location::instance<B> &) const {
5454
return A == B;
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// RUN: %clangxx -fsycl -fsyntax-only -Xclang -verify %s
2+
// expected-no-diagnostics
3+
4+
#include <CL/sycl.hpp>
5+
6+
int main() {
7+
sycl::ext::oneapi::accessor_property_list PL{
8+
sycl::ext::intel::buffer_location<1>};
9+
static_assert(PL.has_property<sycl::ext::intel::property::buffer_location>(),
10+
"Property not found");
11+
return 0;
12+
}

0 commit comments

Comments
 (0)