Skip to content

Commit 9572660

Browse files
authored
[ABI-Break][SYCL] ABI-neutralize filter_selector constructor (#13213)
Signed-off-by: Byoungro So <[email protected]>
1 parent b8c627a commit 9572660

File tree

5 files changed

+25
-13
lines changed

5 files changed

+25
-13
lines changed

sycl/include/sycl/ext/oneapi/filter_selector.hpp

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ inline namespace _V1 {
2323
// Forward declarations
2424
class device;
2525
class device_selector;
26+
#ifdef __SYCL_INTERNAL_API
27+
namespace ONEAPI {
28+
class filter_selector;
29+
}
30+
#endif // __SYCL_INTERNAL_API
2631

2732
namespace ext::oneapi {
2833
namespace detail {
@@ -31,13 +36,18 @@ class filter_selector_impl;
3136

3237
class __SYCL_EXPORT filter_selector : public device_selector {
3338
public:
34-
filter_selector(const std::string &filter);
39+
filter_selector(const std::string &filter)
40+
: filter_selector(sycl::detail::string_view{filter}) {}
3541
int operator()(const device &dev) const override;
3642
void reset() const;
3743
device select_device() const override;
44+
#ifdef __SYCL_INTERNAL_API
45+
friend class sycl::ONEAPI::filter_selector;
46+
#endif
3847

3948
private:
4049
std::shared_ptr<detail::filter_selector_impl> impl;
50+
filter_selector(sycl::detail::string_view filter);
4151
};
4252
} // namespace ext::oneapi
4353

@@ -46,10 +56,14 @@ namespace __SYCL2020_DEPRECATED("use 'ext::oneapi' instead") ONEAPI {
4656
using namespace ext::oneapi;
4757
class __SYCL_EXPORT filter_selector : public ext::oneapi::filter_selector {
4858
public:
49-
filter_selector(const std::string &filter);
59+
filter_selector(const std::string &filter)
60+
: filter_selector(sycl::detail::string_view{filter}) {}
5061
int operator()(const device &dev) const override;
5162
void reset() const;
5263
device select_device() const override;
64+
65+
private:
66+
filter_selector(sycl::detail::string_view filter);
5367
};
5468
} // namespace __SYCL2020_DEPRECATED("use 'ext::oneapi' instead")ONEAPI
5569
#endif // __SYCL_INTERNAL_API

sycl/source/device_selector.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -283,8 +283,8 @@ int accelerator_selector::operator()(const device &dev) const {
283283

284284
namespace ext::oneapi {
285285

286-
filter_selector::filter_selector(const std::string &Input)
287-
: impl(std::make_shared<detail::filter_selector_impl>(Input)) {}
286+
filter_selector::filter_selector(sycl::detail::string_view Input)
287+
: impl(std::make_shared<detail::filter_selector_impl>(Input.data())) {}
288288

289289
int filter_selector::operator()(const device &Dev) const {
290290
return impl->operator()(Dev);
@@ -316,7 +316,7 @@ device filter_selector::select_device() const {
316316

317317
namespace __SYCL2020_DEPRECATED("use 'ext::oneapi' instead") ONEAPI {
318318
using namespace ext::oneapi;
319-
filter_selector::filter_selector(const std::string &Input)
319+
filter_selector::filter_selector(sycl::detail::string_view Input)
320320
: ext::oneapi::filter_selector(Input) {}
321321

322322
int filter_selector::operator()(const device &Dev) const {

sycl/test/abi/sycl_abi_neutrality_test.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@
2121
// CHECK:_ZN4sycl3_V13ext6oneapi12experimental6detail17build_from_sourceERNS0_13kernel_bundleILNS0_12bundle_stateE3EEERKSt6vectorINS0_6deviceESaISA_EERKS9_INSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaISK_EEPSK_SO_
2222
// CHECK:_ZN4sycl3_V13ext6oneapi12experimental6detail30make_kernel_bundle_from_sourceERKNS0_7contextENS3_15source_languageERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESt6vectorISt4pairISE_SE_ESaISJ_EE
2323
// CHECK:_ZN4sycl3_V13ext6oneapi12experimental6detail30make_kernel_bundle_from_sourceERKNS0_7contextENS3_15source_languageERKSt6vectorISt4byteSaISA_EES9_ISt4pairINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESL_ESaISM_EE
24-
// CHECK:_ZN4sycl3_V13ext6oneapi15filter_selectorC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
25-
// CHECK:_ZN4sycl3_V13ext6oneapi15filter_selectorC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
26-
// CHECK:_ZN4sycl3_V16ONEAPI15filter_selectorC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
27-
// CHECK:_ZN4sycl3_V16ONEAPI15filter_selectorC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
2824
// CHECK:_ZN4sycl3_V16detail19kernel_bundle_plain21ext_oneapi_get_kernelERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
2925
// CHECK:_ZN4sycl3_V16detail19kernel_bundle_plain21ext_oneapi_has_kernelERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
3026
// CHECK:_ZN4sycl3_V16detail6OSUtil10getDirNameB5cxx11EPKc

sycl/test/abi/sycl_symbols_linux.dump

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3104,8 +3104,8 @@ _ZN4sycl3_V13ext6oneapi12experimental9image_memC1ERKNS3_16image_descriptorERKNS0
31043104
_ZN4sycl3_V13ext6oneapi12experimental9image_memC1ERKNS3_16image_descriptorERKNS0_6deviceERKNS0_7contextE
31053105
_ZN4sycl3_V13ext6oneapi12experimental9image_memC2ERKNS3_16image_descriptorERKNS0_5queueE
31063106
_ZN4sycl3_V13ext6oneapi12experimental9image_memC2ERKNS3_16image_descriptorERKNS0_6deviceERKNS0_7contextE
3107-
_ZN4sycl3_V13ext6oneapi15filter_selectorC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
3108-
_ZN4sycl3_V13ext6oneapi15filter_selectorC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
3107+
_ZN4sycl3_V13ext6oneapi15filter_selectorC1ENS0_6detail11string_viewE
3108+
_ZN4sycl3_V13ext6oneapi15filter_selectorC2ENS0_6detail11string_viewE
31093109
_ZN4sycl3_V13ext8codeplay12experimental14fusion_wrapper12start_fusionEv
31103110
_ZN4sycl3_V13ext8codeplay12experimental14fusion_wrapper13cancel_fusionEv
31113111
_ZN4sycl3_V13ext8codeplay12experimental14fusion_wrapper15complete_fusionERKNS0_13property_listE
@@ -3160,8 +3160,8 @@ _ZN4sycl3_V15queueC2ERKNS0_7contextERKNS0_15device_selectorERKNS0_13property_lis
31603160
_ZN4sycl3_V15queueC2ERKNS0_7contextERKNS0_15device_selectorERKSt8functionIFvNS0_14exception_listEEERKNS0_13property_listE
31613161
_ZN4sycl3_V15queueC2ERKNS0_7contextERKNS0_6deviceERKNS0_13property_listE
31623162
_ZN4sycl3_V15queueC2ERKNS0_7contextERKNS0_6deviceERKSt8functionIFvNS0_14exception_listEEERKNS0_13property_listE
3163-
_ZN4sycl3_V16ONEAPI15filter_selectorC1ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
3164-
_ZN4sycl3_V16ONEAPI15filter_selectorC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
3163+
_ZN4sycl3_V16ONEAPI15filter_selectorC1ENS0_6detail11string_viewE
3164+
_ZN4sycl3_V16ONEAPI15filter_selectorC2ENS0_6detail11string_viewE
31653165
_ZN4sycl3_V16detail10build_implERKNS0_13kernel_bundleILNS0_12bundle_stateE0EEERKSt6vectorINS0_6deviceESaIS8_EERKNS0_13property_listE
31663166
_ZN4sycl3_V16detail10frexp_implENS1_9half_impl4halfEPi
31673167
_ZN4sycl3_V16detail10frexp_implEdPi

sycl/test/abi/sycl_symbols_windows.dump

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,9 +361,11 @@
361361
??0executable_command_graph@detail@experimental@oneapi@ext@_V1@sycl@@IEAA@AEBV?$shared_ptr@Vgraph_impl@detail@experimental@oneapi@ext@_V1@sycl@@@std@@AEBVcontext@56@AEBVproperty_list@56@@Z
362362
??0executable_command_graph@detail@experimental@oneapi@ext@_V1@sycl@@QEAA@$$QEAV0123456@@Z
363363
??0executable_command_graph@detail@experimental@oneapi@ext@_V1@sycl@@QEAA@AEBV0123456@@Z
364+
??0filter_selector@ONEAPI@_V1@sycl@@AEAA@Vstring_view@detail@23@@Z
364365
??0filter_selector@ONEAPI@_V1@sycl@@QEAA@$$QEAV0123@@Z
365366
??0filter_selector@ONEAPI@_V1@sycl@@QEAA@AEBV0123@@Z
366367
??0filter_selector@ONEAPI@_V1@sycl@@QEAA@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z
368+
??0filter_selector@oneapi@ext@_V1@sycl@@AEAA@Vstring_view@detail@34@@Z
367369
??0filter_selector@oneapi@ext@_V1@sycl@@QEAA@$$QEAV01234@@Z
368370
??0filter_selector@oneapi@ext@_V1@sycl@@QEAA@AEBV01234@@Z
369371
??0filter_selector@oneapi@ext@_V1@sycl@@QEAA@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z

0 commit comments

Comments
 (0)