Skip to content

Commit 0d19467

Browse files
committed
address feedback
Signed-off-by: Byoungro So <[email protected]>
1 parent 6e18644 commit 0d19467

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

sycl/include/sycl/detail/util.hpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,6 @@ template <> struct ABINeutralT<std::vector<std::string>> {
8484
using type = std::vector<detail::string>;
8585
};
8686

87-
template <> struct ABINeutralT<detail::string> { using type = std::string; };
88-
89-
template <> struct ABINeutralT<std::vector<detail::string>> {
90-
using type = std::vector<std::string>;
91-
};
9287
template <typename T> using ABINeutralT_t = typename ABINeutralT<T>::type;
9388
#else
9489
template <typename T> using ABINeutralT_t = T;

sycl/include/sycl/device.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,9 @@ class __SYCL_EXPORT device : public detail::OwnerLessBase<device> {
228228
}
229229
#else
230230
template <typename Param>
231-
typename detail::is_device_info_desc<Param>::return_type get_info() const;
231+
detail::ABINeutralT_t<
232+
typename detail::is_device_info_desc<Param>::return_type>
233+
get_info() const;
232234
#endif
233235

234236
/// Check SYCL extension support by device

sycl/source/device.cpp

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -135,17 +135,19 @@ bool device::has_extension(const std::string &extension_name) const {
135135

136136
#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
137137
template <typename Param>
138-
detail::ABINeutralT_t<
139-
typename detail::is_device_info_desc<Param>::return_type>
138+
detail::ABINeutralT_t<typename detail::is_device_info_desc<Param>::return_type>
140139
device::get_info_impl() const {
141-
auto Info = impl->template get_info<Param>();
142-
return detail::convert_to_abi_neutral(Info);
140+
return detail::convert_to_abi_neutral(impl->template get_info<Param>());
143141
}
144142
#else
145143
template <typename Param>
146-
typename detail::is_device_info_desc<Param>::return_type
144+
detail::ABINeutralT_t<typename detail::is_device_info_desc<Param>::return_type>
147145
device::get_info() const {
148-
return impl->template get_info<Param>();
146+
static_assert(
147+
std::is_same_v<detail::ABINeutralT_t<typename detail::is_device_info_desc<
148+
Param>::return_type>,
149+
typename detail::is_device_info_desc<Param>::return_type>);
150+
return detail::convert_to_abi_neutral(impl->template get_info<Param>());
149151
}
150152
#endif
151153

@@ -211,11 +213,12 @@ __SYCL_EXPORT bool device::get_info<info::device::image_support>() const {
211213

212214
#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
213215
#define __SYCL_PARAM_TRAITS_SPEC(DescType, Desc, ReturnT, PiCode) \
214-
template __SYCL_EXPORT detail::ABINeutralT_t<ReturnT> \
216+
template __SYCL_EXPORT detail::ABINeutralT_t<ReturnT> \
215217
device::get_info_impl<info::device::Desc>() const;
216218
#else
217219
#define __SYCL_PARAM_TRAITS_SPEC(DescType, Desc, ReturnT, PiCode) \
218-
template __SYCL_EXPORT ReturnT device::get_info<info::device::Desc>() const;
220+
template __SYCL_EXPORT detail::ABINeutralT_t<ReturnT> \
221+
device::get_info<info::device::Desc>() const;
219222
#endif
220223

221224
#define __SYCL_PARAM_TRAITS_SPEC_SPECIALIZED(DescType, Desc, ReturnT, PiCode)
@@ -226,11 +229,11 @@ __SYCL_EXPORT bool device::get_info<info::device::image_support>() const {
226229

227230
#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
228231
#define __SYCL_PARAM_TRAITS_SPEC(Namespace, DescType, Desc, ReturnT, PiCode) \
229-
template __SYCL_EXPORT detail::ABINeutralT_t<ReturnT> \
232+
template __SYCL_EXPORT detail::ABINeutralT_t<ReturnT> \
230233
device::get_info_impl<Namespace::info::DescType::Desc>() const;
231234
#else
232235
#define __SYCL_PARAM_TRAITS_SPEC(Namespace, DescType, Desc, ReturnT, PiCode) \
233-
template __SYCL_EXPORT ReturnT \
236+
template __SYCL_EXPORT typename detail::ABINeutralT_t<ReturnT> \
234237
device::get_info<Namespace::info::DescType::Desc>() const;
235238
#endif
236239

0 commit comments

Comments
 (0)