Skip to content

[SYCL-MLIR] Add back the reverted sycl commit #7264

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 3, 2022
Merged
Show file tree
Hide file tree
Changes from all 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
22 changes: 19 additions & 3 deletions polygeist/tools/cgeist/Lib/clang-mlir.cc
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,11 @@ void MLIRScanner::initSupportedFunctions() {
"_ZN4sycl3_V18accessorIiLi1ELNS0_6access4modeE1025ELNS2_"
"6targetE2014ELNS2_11placeholderE0ENS0_3ext6oneapi22accessor_property_"
"listIJEEEE6__initEPU3AS1iNS0_5rangeILi1EEESE_NS0_2idILi1EEE");
supportedFuncs.insert(
"_ZZN4sycl3_V18accessorIiLi1ELNS0_6access4modeE1025ELNS2_"
"6targetE2014ELNS2_11placeholderE0ENS0_3ext6oneapi22accessor_property_"
"listIJEEEE6__initEPU3AS1iNS0_5rangeILi1EEESE_NS0_2idILi1EEEENKUlmE_"
"clEm");
supportedFuncs.insert(
"_ZN4sycl3_V18accessorIiLi1ELNS0_6access4modeE1025ELNS2_"
"6targetE2014ELNS2_11placeholderE0ENS0_3ext6oneapi22accessor_property_"
Expand Down Expand Up @@ -300,6 +305,11 @@ void MLIRScanner::initSupportedFunctions() {
supportedFuncs.insert("_ZNK4sycl3_V16detail5arrayILi1EE15check_dimensionEi");
supportedFuncs.insert("_ZN4sycl3_V16detail14InitializedValILi1ENS0_"
"5rangeEE3getILi0EEENS3_ILi1EEEv");
supportedFuncs.insert(
"_ZN4sycl3_V16detail8dim_loopILm1EZNS0_8accessorIiLi1ELNS0_"
"6access4modeE1025ELNS4_6targetE2014ELNS4_11placeholderE0ENS0_"
"3ext6oneapi22accessor_property_listIJEEEE6__initEPU3AS1iNS0_"
"5rangeILi1EEESG_NS0_2idILi1EEEEUlmE_EEvOT0_");
supportedFuncs.insert(
"_ZN4sycl3_V16detail8dim_loopILm1EZNKS0_8accessorIiLi1ELNS0_"
"6access4modeE1025ELNS4_6targetE2014ELNS4_11placeholderE0ENS0_"
Expand All @@ -311,15 +321,21 @@ void MLIRScanner::initSupportedFunctions() {
"3ext6oneapi22accessor_property_listIJEEEE14getTotalOffsetEvEUlmE_"
"EEvOT0_");
supportedFuncs.insert(
"_ZN4sycl3_V16detail13dim_loop_implIJLm0EEZNKS0_8accessorIiLi1ELNS0_"
"_ZN4sycl3_V16detail13dim_loop_implIJLm0EEZNS0_8accessorIiLi1ELNS0_"
"6access4modeE1025ELNS4_6targetE2014ELNS4_11placeholderE0ENS0_"
"3ext6oneapi22accessor_property_listIJEEEE14getTotalOffsetEvEUlmE_"
"EEvSt16integer_sequenceImJXspT_EEEOT0_");
"3ext6oneapi22accessor_property_listIJEEEE6__initEPU3AS1iNS0_"
"5rangeILi1EEESG_NS0_2idILi1EEEEUlmE_EEvSt16integer_sequenceImJXspT_"
"EEEOT0_");
supportedFuncs.insert(
"_ZN4sycl3_V16detail13dim_loop_implIJLm0EEZNKS0_8accessorIiLi1ELNS0_"
"6access4modeE1025ELNS4_6targetE2014ELNS4_11placeholderE0ENS0_"
"3ext6oneapi22accessor_property_listIJEEEE14getLinearIndexILi1EEEmNS0_"
"2idIXT_EEEEUlmE_EEvSt16integer_sequenceImJXspT_EEEOT0_");
supportedFuncs.insert(
"_ZN4sycl3_V16detail13dim_loop_implIJLm0EEZNKS0_8accessorIiLi1ELNS0_"
"6access4modeE1025ELNS4_6targetE2014ELNS4_11placeholderE0ENS0_"
"3ext6oneapi22accessor_property_listIJEEEE14getTotalOffsetEvEUlmE_"
"EEvSt16integer_sequenceImJXspT_EEEOT0_");
}

static void checkFunctionParent(const FunctionOpInterface F,
Expand Down
10 changes: 4 additions & 6 deletions sycl/include/sycl/accessor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1084,8 +1084,7 @@ class __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor :
void __init(ConcreteASPtrType Ptr, range<AdjustedDim> AccessRange,
range<AdjustedDim> MemRange, id<AdjustedDim> Offset) {
MData = Ptr;
#pragma unroll
for (int I = 0; I < AdjustedDim; ++I) {
detail::dim_loop<AdjustedDim>([&, this](size_t I) {
#if __cplusplus >= 201703L
if constexpr (!(PropertyListT::template has_property<
sycl::ext::oneapi::property::no_offset>())) {
Expand All @@ -1096,7 +1095,7 @@ class __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor :
#endif
getAccessRange()[I] = AccessRange[I];
getMemoryRange()[I] = MemRange[I];
}
});

// Adjust for offsets as that part is invariant for all invocations of
// operator[]. Will have to re-adjust in get_pointer.
Expand Down Expand Up @@ -2415,9 +2414,8 @@ class __SYCL_SPECIAL_CLASS local_accessor_base :
void __init(ConcreteASPtrType Ptr, range<AdjustedDim> AccessRange,
range<AdjustedDim>, id<AdjustedDim>) {
MData = Ptr;
#pragma unroll
for (int I = 0; I < AdjustedDim; ++I)
getSize()[I] = AccessRange[I];
detail::dim_loop<AdjustedDim>(
[&, this](size_t I) { getSize()[I] = AccessRange[I]; });
}

public:
Expand Down