@@ -250,11 +250,7 @@ struct AccHostDataT {
250
250
// To ensure loop unrolling is done when processing dimensions.
251
251
template <size_t ... Inds, class F >
252
252
void dim_loop_impl (std::integer_sequence<size_t , Inds...>, F &&f) {
253
- #if __cplusplus >= 201703L
254
253
(f (Inds), ...);
255
- #else
256
- (void )std::initializer_list<int >{((void )(f (Inds)), 0 )...};
257
- #endif
258
254
}
259
255
260
256
template <size_t count, class F > void dim_loop (F &&f) {
@@ -375,8 +371,6 @@ class accessor_common {
375
371
};
376
372
};
377
373
378
- #if __cplusplus >= 201703L
379
-
380
374
template <typename MayBeTag1, typename MayBeTag2>
381
375
constexpr access::mode deduceAccessMode () {
382
376
// property_list = {} is not properly detected by deduction guide,
@@ -424,8 +418,6 @@ constexpr access::target deduceAccessTarget(access::target defaultTarget) {
424
418
return defaultTarget;
425
419
}
426
420
427
- #endif
428
-
429
421
template <int Dims> class LocalAccessorBaseDevice {
430
422
public:
431
423
LocalAccessorBaseDevice (sycl::range<Dims> Size)
@@ -1038,14 +1030,10 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor :
1038
1030
// We've already adjusted for the accessor's offset in the __init, so
1039
1031
// don't include it here in case of device.
1040
1032
#ifndef __SYCL_DEVICE_ONLY__
1041
- #if __cplusplus >= 201703L
1042
1033
if constexpr (!(PropertyListT::template has_property<
1043
1034
sycl::ext::oneapi::property::no_offset>())) {
1044
1035
Result += getOffset ()[I];
1045
1036
}
1046
- #else
1047
- Result += getOffset ()[I];
1048
- #endif
1049
1037
#endif // __SYCL_DEVICE_ONLY__
1050
1038
});
1051
1039
@@ -1101,14 +1089,10 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor :
1101
1089
range<AdjustedDim> MemRange, id<AdjustedDim> Offset) {
1102
1090
MData = Ptr;
1103
1091
detail::dim_loop<AdjustedDim>([&, this ](size_t I) {
1104
- #if __cplusplus >= 201703L
1105
1092
if constexpr (!(PropertyListT::template has_property<
1106
1093
sycl::ext::oneapi::property::no_offset>())) {
1107
1094
getOffset ()[I] = Offset[I];
1108
1095
}
1109
- #else
1110
- getOffset ()[I] = Offset[I];
1111
- #endif
1112
1096
getAccessRange ()[I] = AccessRange[I];
1113
1097
getMemoryRange ()[I] = MemRange[I];
1114
1098
});
@@ -1461,8 +1445,6 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor :
1461
1445
}
1462
1446
#endif
1463
1447
1464
- #if __cplusplus >= 201703L
1465
-
1466
1448
template <typename T = DataT, int Dims = Dimensions, typename AllocatorT,
1467
1449
typename TagT,
1468
1450
typename = std::enable_if_t <
@@ -1491,7 +1473,6 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor :
1491
1473
: accessor (BufferRef, PropertyList, CodeLoc) {
1492
1474
adjustAccPropsInBuf (BufferRef);
1493
1475
}
1494
- #endif
1495
1476
1496
1477
template <typename T = DataT, int Dims = Dimensions, typename AllocatorT,
1497
1478
typename = std::enable_if_t <
@@ -1559,8 +1540,6 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor :
1559
1540
}
1560
1541
#endif
1561
1542
1562
- #if __cplusplus >= 201703L
1563
-
1564
1543
template <typename T = DataT, int Dims = Dimensions, typename AllocatorT,
1565
1544
typename TagT,
1566
1545
typename = std::enable_if_t <
@@ -1591,8 +1570,6 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor :
1591
1570
adjustAccPropsInBuf (BufferRef);
1592
1571
}
1593
1572
1594
- #endif
1595
-
1596
1573
template <typename T = DataT, int Dims = Dimensions, typename AllocatorT,
1597
1574
typename = std::enable_if_t <
1598
1575
detail::IsRunTimePropertyListT<PropertyListT>::value &&
@@ -1619,8 +1596,6 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor :
1619
1596
const detail::code_location CodeLoc = detail::code_location::current ())
1620
1597
: accessor (BufferRef, AccessRange, {}, PropertyList, CodeLoc) {}
1621
1598
1622
- #if __cplusplus >= 201703L
1623
-
1624
1599
template <typename T = DataT, int Dims = Dimensions, typename AllocatorT,
1625
1600
typename TagT,
1626
1601
typename = std::enable_if_t <
@@ -1650,7 +1625,6 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor :
1650
1625
: accessor (BufferRef, AccessRange, {}, PropertyList, CodeLoc) {
1651
1626
adjustAccPropsInBuf (BufferRef);
1652
1627
}
1653
- #endif
1654
1628
1655
1629
template <typename T = DataT, int Dims = Dimensions, typename AllocatorT,
1656
1630
typename = std::enable_if_t <
@@ -1679,8 +1653,6 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor :
1679
1653
: accessor (BufferRef, CommandGroupHandler, AccessRange, {}, PropertyList,
1680
1654
CodeLoc) {}
1681
1655
1682
- #if __cplusplus >= 201703L
1683
-
1684
1656
template <typename T = DataT, int Dims = Dimensions, typename AllocatorT,
1685
1657
typename TagT,
1686
1658
typename = std::enable_if_t <
@@ -1713,7 +1685,6 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor :
1713
1685
CodeLoc) {
1714
1686
adjustAccPropsInBuf (BufferRef);
1715
1687
}
1716
- #endif
1717
1688
1718
1689
template <typename T = DataT, int Dims = Dimensions, typename AllocatorT,
1719
1690
typename = std::enable_if_t <
@@ -1798,8 +1769,6 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor :
1798
1769
}
1799
1770
#endif
1800
1771
1801
- #if __cplusplus >= 201703L
1802
-
1803
1772
template <typename T = DataT, int Dims = Dimensions, typename AllocatorT,
1804
1773
typename TagT,
1805
1774
typename = std::enable_if_t <
@@ -1829,7 +1798,6 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor :
1829
1798
: accessor (BufferRef, AccessRange, AccessOffset, PropertyList, CodeLoc) {
1830
1799
adjustAccPropsInBuf (BufferRef);
1831
1800
}
1832
- #endif
1833
1801
1834
1802
template <typename T = DataT, int Dims = Dimensions, typename AllocatorT,
1835
1803
typename = std::enable_if_t <
@@ -1913,8 +1881,6 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor :
1913
1881
}
1914
1882
#endif
1915
1883
1916
- #if __cplusplus >= 201703L
1917
-
1918
1884
template <typename T = DataT, int Dims = Dimensions, typename AllocatorT,
1919
1885
typename TagT,
1920
1886
typename = std::enable_if_t <
@@ -1947,7 +1913,6 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor :
1947
1913
PropertyList, CodeLoc) {
1948
1914
adjustAccPropsInBuf (BufferRef);
1949
1915
}
1950
- #endif
1951
1916
1952
1917
template <typename ... NewPropsT>
1953
1918
accessor (
@@ -2001,12 +1966,10 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor :
2001
1966
2002
1967
template <int Dims = Dimensions, typename = std::enable_if_t <(Dims > 0 )>>
2003
1968
id<Dimensions> get_offset () const {
2004
- #if __cplusplus >= 201703L
2005
1969
static_assert (
2006
1970
!(PropertyListT::template has_property<
2007
1971
sycl::ext::oneapi::property::no_offset>()),
2008
1972
" Accessor has no_offset property, get_offset() can not be used" );
2009
- #endif
2010
1973
return detail::convertToArrayOfN<Dimensions, 0 >(getOffset ());
2011
1974
}
2012
1975
@@ -2124,7 +2087,6 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor :
2124
2087
#endif
2125
2088
}
2126
2089
2127
- #if __cplusplus >= 201703L
2128
2090
template <typename Property>
2129
2091
static constexpr bool has_property (
2130
2092
typename std::enable_if_t <
@@ -2138,7 +2100,6 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor :
2138
2100
ext::oneapi::is_compile_time_property<Property>::value> * = 0 ) {
2139
2101
return PropertyListT::template get_property<Property>();
2140
2102
}
2141
- #endif
2142
2103
2143
2104
bool operator ==(const accessor &Rhs) const { return impl == Rhs.impl ; }
2144
2105
bool operator !=(const accessor &Rhs) const { return !(*this == Rhs); }
@@ -2177,14 +2138,10 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor :
2177
2138
size_t TotalOffset = 0 ;
2178
2139
detail::dim_loop<Dimensions>([&, this ](size_t I) {
2179
2140
TotalOffset = TotalOffset * impl.MemRange [I];
2180
- #if __cplusplus >= 201703L
2181
2141
if constexpr (!(PropertyListT::template has_property<
2182
2142
sycl::ext::oneapi::property::no_offset>())) {
2183
2143
TotalOffset += impl.Offset [I];
2184
2144
}
2185
- #else
2186
- TotalOffset += impl.Offset [I];
2187
- #endif
2188
2145
});
2189
2146
2190
2147
return TotalOffset;
@@ -2222,7 +2179,6 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor :
2222
2179
}
2223
2180
}
2224
2181
2225
- #if __cplusplus >= 201703L
2226
2182
template <typename BufT, typename ... PropTypes>
2227
2183
void adjustAccPropsInBuf (BufT &Buffer) {
2228
2184
if constexpr (PropertyListT::template has_property<
@@ -2242,11 +2198,8 @@ class __SYCL_EBO __SYCL_SPECIAL_CLASS __SYCL_TYPE(accessor) accessor :
2242
2198
Buffer.deleteAccProps (
2243
2199
sycl::detail::PropWithDataKind::AccPropBufferLocation);
2244
2200
}
2245
- #endif
2246
2201
};
2247
2202
2248
- #if __cplusplus >= 201703L
2249
-
2250
2203
template <typename DataT, int Dimensions, typename AllocatorT>
2251
2204
accessor (buffer<DataT, Dimensions, AllocatorT>)
2252
2205
-> accessor<DataT, Dimensions, access::mode::read_write, target::device,
@@ -2399,7 +2352,6 @@ accessor(buffer<DataT, Dimensions, AllocatorT>, handler &, Type1, Type2, Type3,
2399
2352
detail::deduceAccessTarget<Type3, Type4>(target::device),
2400
2353
access::placeholder::false_t ,
2401
2354
ext::oneapi::accessor_property_list<PropsT...>>;
2402
- #endif
2403
2355
2404
2356
// / Local accessor
2405
2357
// /
@@ -3003,8 +2955,6 @@ class __SYCL_EBO host_accessor
3003
2955
const detail::code_location CodeLoc = detail::code_location::current())
3004
2956
: AccessorT(BufferRef, PropertyList, CodeLoc) {}
3005
2957
3006
- #if __cplusplus >= 201703L
3007
-
3008
2958
template <typename T = DataT, int Dims = Dimensions, typename AllocatorT,
3009
2959
typename = std::enable_if_t <IsSameAsBuffer<T, Dims>::value>>
3010
2960
host_accessor (
@@ -3013,7 +2963,6 @@ class __SYCL_EBO host_accessor
3013
2963
const detail::code_location CodeLoc = detail::code_location::current())
3014
2964
: host_accessor(BufferRef, PropertyList, CodeLoc) {}
3015
2965
3016
- #endif
3017
2966
3018
2967
template <typename T = DataT, int Dims = Dimensions, typename AllocatorT,
3019
2968
typename = std::enable_if_t <IsSameAsBuffer<T, Dims>::value>>
@@ -3023,8 +2972,6 @@ class __SYCL_EBO host_accessor
3023
2972
const detail::code_location CodeLoc = detail::code_location::current())
3024
2973
: AccessorT(BufferRef, CommandGroupHandler, PropertyList, CodeLoc) {}
3025
2974
3026
- #if __cplusplus >= 201703L
3027
-
3028
2975
template <typename T = DataT, int Dims = Dimensions, typename AllocatorT,
3029
2976
typename = std::enable_if_t <IsSameAsBuffer<T, Dims>::value>>
3030
2977
host_accessor (
@@ -3034,8 +2981,6 @@ class __SYCL_EBO host_accessor
3034
2981
const detail::code_location CodeLoc = detail::code_location::current())
3035
2982
: host_accessor(BufferRef, CommandGroupHandler, PropertyList, CodeLoc) {}
3036
2983
3037
- #endif
3038
-
3039
2984
template <typename T = DataT, int Dims = Dimensions, typename AllocatorT,
3040
2985
typename = std::enable_if_t <IsSameAsBuffer<T, Dims>::value>>
3041
2986
host_accessor (
@@ -3044,8 +2989,6 @@ class __SYCL_EBO host_accessor
3044
2989
const detail::code_location CodeLoc = detail::code_location::current())
3045
2990
: AccessorT(BufferRef, AccessRange, {}, PropertyList, CodeLoc) {}
3046
2991
3047
- #if __cplusplus >= 201703L
3048
-
3049
2992
template <typename T = DataT, int Dims = Dimensions, typename AllocatorT,
3050
2993
typename = std::enable_if_t <IsSameAsBuffer<T, Dims>::value>>
3051
2994
host_accessor (
@@ -3055,8 +2998,6 @@ class __SYCL_EBO host_accessor
3055
2998
const detail::code_location CodeLoc = detail::code_location::current())
3056
2999
: host_accessor(BufferRef, AccessRange, {}, PropertyList, CodeLoc) {}
3057
3000
3058
- #endif
3059
-
3060
3001
template <typename T = DataT, int Dims = Dimensions, typename AllocatorT,
3061
3002
typename = std::enable_if_t <IsSameAsBuffer<T, Dims>::value>>
3062
3003
host_accessor (
@@ -3067,8 +3008,6 @@ class __SYCL_EBO host_accessor
3067
3008
: AccessorT(BufferRef, CommandGroupHandler, AccessRange, {}, PropertyList,
3068
3009
CodeLoc) {}
3069
3010
3070
- #if __cplusplus >= 201703L
3071
-
3072
3011
template <typename T = DataT, int Dims = Dimensions, typename AllocatorT,
3073
3012
typename = std::enable_if_t <IsSameAsBuffer<T, Dims>::value>>
3074
3013
host_accessor (
@@ -3079,8 +3018,6 @@ class __SYCL_EBO host_accessor
3079
3018
: host_accessor(BufferRef, CommandGroupHandler, AccessRange, {},
3080
3019
PropertyList, CodeLoc) {}
3081
3020
3082
- #endif
3083
-
3084
3021
template <typename T = DataT, int Dims = Dimensions, typename AllocatorT,
3085
3022
typename = std::enable_if_t <IsSameAsBuffer<T, Dims>::value>>
3086
3023
host_accessor (
@@ -3091,8 +3028,6 @@ class __SYCL_EBO host_accessor
3091
3028
: AccessorT(BufferRef, AccessRange, AccessOffset, PropertyList, CodeLoc) {
3092
3029
}
3093
3030
3094
- #if __cplusplus >= 201703L
3095
-
3096
3031
template <typename T = DataT, int Dims = Dimensions, typename AllocatorT,
3097
3032
typename = std::enable_if_t <IsSameAsBuffer<T, Dims>::value>>
3098
3033
host_accessor (
@@ -3103,8 +3038,6 @@ class __SYCL_EBO host_accessor
3103
3038
: host_accessor(BufferRef, AccessRange, AccessOffset, PropertyList,
3104
3039
CodeLoc) {}
3105
3040
3106
- #endif
3107
-
3108
3041
template <typename T = DataT, int Dims = Dimensions, typename AllocatorT,
3109
3042
typename = std::enable_if_t <IsSameAsBuffer<T, Dims>::value>>
3110
3043
host_accessor (
@@ -3115,8 +3048,6 @@ class __SYCL_EBO host_accessor
3115
3048
: AccessorT(BufferRef, CommandGroupHandler, AccessRange, AccessOffset,
3116
3049
PropertyList, CodeLoc) {}
3117
3050
3118
- #if __cplusplus >= 201703L
3119
-
3120
3051
template <typename T = DataT, int Dims = Dimensions, typename AllocatorT,
3121
3052
typename = std::enable_if_t <IsSameAsBuffer<T, Dims>::value>>
3122
3053
host_accessor (
@@ -3127,12 +3058,8 @@ class __SYCL_EBO host_accessor
3127
3058
const detail::code_location CodeLoc = detail::code_location::current())
3128
3059
: host_accessor(BufferRef, CommandGroupHandler, AccessRange, AccessOffset,
3129
3060
PropertyList, CodeLoc) {}
3130
-
3131
- #endif
3132
3061
};
3133
3062
3134
- #if __cplusplus >= 201703L
3135
-
3136
3063
template <typename DataT, int Dimensions, typename AllocatorT>
3137
3064
host_accessor (buffer<DataT, Dimensions, AllocatorT>)
3138
3065
-> host_accessor<DataT, Dimensions, access::mode::read_write>;
@@ -3165,9 +3092,6 @@ template <typename DataT, int Dimensions, typename AllocatorT, typename Type1,
3165
3092
host_accessor (buffer<DataT, Dimensions, AllocatorT>, Type1, Type2, Type3, Type4,
3166
3093
Type5) -> host_accessor<DataT, Dimensions,
3167
3094
detail::deduceAccessMode<Type4, Type5>()>;
3168
-
3169
- #endif
3170
-
3171
3095
} // __SYCL_INLINE_VER_NAMESPACE(_V1)
3172
3096
} // namespace sycl
3173
3097
0 commit comments