File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 17
17
namespace sycl {
18
18
__SYCL_INLINE_VER_NAMESPACE (_V1) {
19
19
20
- template <std::size_t N, std::size_t SizeOfT>
21
- constexpr std::size_t vecAlignment () {
20
+ template <std::size_t N, typename T> constexpr std::size_t vecAlignment () {
22
21
static_assert (N > 0 , " Invalid number of elements." );
22
+ size_t SizeOfT = sizeof (T);
23
23
static_assert (SizeOfT > 0 , " Invalid size of T." );
24
24
// First find the "previous" vector num elements.
25
25
size_t res = N >= 16 ? 16
@@ -42,12 +42,12 @@ constexpr std::size_t vecAlignment() {
42
42
43
43
#if defined(_WIN32) || defined(_WIN64)
44
44
#define MARRAY_WINDOWS_ALIGN_ATTR \
45
- __declspec (align (vecAlignment<NumElements, sizeof ( Type) >()))
45
+ __declspec (align (vecAlignment<NumElements, Type>()))
46
46
#define MARRAY_LINUX_ALIGN_ATTR
47
47
#else
48
48
#define MARRAY_WINDOWS_ALIGN_ATTR
49
49
#define MARRAY_LINUX_ALIGN_ATTR \
50
- __attribute__ ((aligned (vecAlignment<NumElements, sizeof ( Type) >())))
50
+ __attribute__ ((aligned (vecAlignment<NumElements, Type>())))
51
51
#endif
52
52
53
53
// / Provides a cross-patform math array class template that works on
You can’t perform that action at this time.
0 commit comments