Skip to content

Commit

Permalink
[SYCL] Workaround for vec::load and vec::store
Browse files Browse the repository at this point in the history
This is a workaround for vec::load and vec::store to avoid unaligned
load and stores.

Signed-off-by: Vlad Romanov <vlad.romanov@intel.com>
  • Loading branch information
romanovvlad authored and bader committed Jun 28, 2019
1 parent bd54af8 commit aa02e77
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions sycl/include/CL/sycl/types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -596,23 +596,12 @@ template <typename Type, int NumElements> class vec {
#endif
#define __SYCL_LOADSTORE(Space) \
void load(size_t Offset, multi_ptr<const DataT, Space> Ptr) { \
if (NumElements != 3) { \
m_Data = \
*multi_ptr<const DataType, Space>(static_cast<const DataType *>( \
static_cast<const void *>(Ptr + Offset * NumElements))); \
return; \
} \
for (int I = 0; I < NumElements; I++) { \
setValue( \
I, *multi_ptr<const DataT, Space>(Ptr + Offset * NumElements + I)); \
} \
} \
void store(size_t Offset, multi_ptr<DataT, Space> Ptr) const { \
if (NumElements != 3) { \
*multi_ptr<DataType, Space>(static_cast<DataType *>( \
static_cast<void *>(Ptr + Offset * NumElements))) = m_Data; \
return; \
} \
for (int I = 0; I < NumElements; I++) { \
*multi_ptr<DataT, Space>(Ptr + Offset * NumElements + I) = getValue(I); \
} \
Expand Down

0 comments on commit aa02e77

Please sign in to comment.