Skip to content
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions sycl/include/CL/sycl/accessor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -834,6 +834,14 @@ class accessor :
#endif // __SYCL_DEVICE_ONLY__

size_t Result = 0;
// Unroll the following loop for both host and device code
#if defined(__clang__) || defined(__INTEL_COMPILER)
#pragma unroll
Comment thread
MrSidims marked this conversation as resolved.
Outdated
#elif defined(__GNUC__) || defined(__GNUG__)
#pragma GCC unroll 3
#elif defined(_MSC_VER)
// MSVC pragma loop doesn't have unroll option
#endif // switch over the compilers is over
for (int I = 0; I < Dims; ++I)
Result = Result * getMemoryRange()[I] + getOffset()[I] + Id[I];
return Result;
Expand Down