Skip to content

Commit f574019

Browse files
author
JackAKirk
committed
Made impl vs2019 compiler compatible.
Signed-off-by: JackAKirk <[email protected]>
1 parent 12de028 commit f574019

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

sycl/include/sycl/marray.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
namespace sycl {
1818
__SYCL_INLINE_VER_NAMESPACE(_V1) {
1919

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() {
2221
static_assert(N > 0, "Invalid number of elements.");
22+
size_t SizeOfT = sizeof(T);
2323
static_assert(SizeOfT > 0, "Invalid size of T.");
2424
// First find the "previous" vector num elements.
2525
size_t res = N >= 16 ? 16
@@ -42,12 +42,12 @@ constexpr std::size_t vecAlignment() {
4242

4343
#if defined(_WIN32) || defined(_WIN64)
4444
#define MARRAY_WINDOWS_ALIGN_ATTR \
45-
__declspec(align(vecAlignment<NumElements, sizeof(Type)>()))
45+
__declspec(align(vecAlignment<NumElements, Type>()))
4646
#define MARRAY_LINUX_ALIGN_ATTR
4747
#else
4848
#define MARRAY_WINDOWS_ALIGN_ATTR
4949
#define MARRAY_LINUX_ALIGN_ATTR \
50-
__attribute__((aligned(vecAlignment<NumElements, sizeof(Type)>())))
50+
__attribute__((aligned(vecAlignment<NumElements, Type>())))
5151
#endif
5252

5353
/// Provides a cross-patform math array class template that works on

0 commit comments

Comments
 (0)