@@ -18,7 +18,7 @@ namespace cl {
18
18
namespace sycl {
19
19
class handler ;
20
20
class queue ;
21
- template <int dimentions > class range ;
21
+ template <int dimensions > class range ;
22
22
23
23
template <typename T, int dimensions = 1 ,
24
24
typename AllocatorT = cl::sycl::buffer_allocator>
@@ -28,6 +28,8 @@ class buffer {
28
28
using reference = value_type &;
29
29
using const_reference = const value_type &;
30
30
using allocator_type = AllocatorT;
31
+ template <int dims>
32
+ using EnableIfOneDimension = typename std::enable_if<1 == dims>::type;
31
33
32
34
buffer (const range<dimensions> &bufferRange,
33
35
const property_list &propList = {})
@@ -83,7 +85,8 @@ class buffer {
83
85
hostData, get_count () * sizeof (T), propList);
84
86
}
85
87
86
- template <class InputIterator >
88
+ template <class InputIterator , int N = dimensions,
89
+ typename = EnableIfOneDimension<N>>
87
90
buffer (InputIterator first, InputIterator last, AllocatorT allocator,
88
91
const property_list &propList = {})
89
92
: Range(range<1 >(std::distance(first, last))) {
@@ -92,7 +95,7 @@ class buffer {
92
95
}
93
96
94
97
template <class InputIterator , int N = dimensions,
95
- typename = std::enable_if<N == 1 >>
98
+ typename = EnableIfOneDimension<N >>
96
99
buffer (InputIterator first, InputIterator last,
97
100
const property_list &propList = {})
98
101
: Range(range<1 >(std::distance(first, last))) {
@@ -105,7 +108,7 @@ class buffer {
105
108
// impl = std::make_shared<detail::buffer_impl>(b, baseIndex, subRange);
106
109
// }
107
110
108
- template <int N = dimensions, typename = std::enable_if<N == 1 >>
111
+ template <int N = dimensions, typename = EnableIfOneDimension<N >>
109
112
buffer (cl_mem MemObject, const context &SyclContext,
110
113
event AvailableEvent = {}) {
111
114
impl = std::make_shared<detail::buffer_impl<AllocatorT>>(
0 commit comments