Skip to content
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

[DO NOT MERGE][ABI-Break][SYCL] ABI-neutralize exception constructor #13369

Closed
wants to merge 52 commits into from
Closed
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
361c5ee
[SYCL] trial to ABI-neutralize exception
bso-intel Mar 26, 2024
1872aed
tried to break cyclic deps
bso-intel Mar 28, 2024
4ddb0ce
replace exception with assert
bso-intel Mar 29, 2024
6ccfe8b
removed
bso-intel Apr 9, 2024
94146dc
Merge remote-tracking branch 'upstream/sycl' into exception
bso-intel Apr 9, 2024
05ebf07
merge
bso-intel Apr 11, 2024
dfae4d2
cleanup
bso-intel Apr 11, 2024
6b21678
typo
bso-intel Apr 11, 2024
fd20c25
throw
bso-intel Apr 11, 2024
f695a8b
dump
bso-intel Apr 11, 2024
44aedab
error
bso-intel Apr 11, 2024
6931312
clang-format
bso-intel Apr 11, 2024
0826453
fix test
bso-intel Apr 12, 2024
afb4580
remove forward decl
bso-intel Apr 15, 2024
f4413a9
exception helper
bso-intel Apr 17, 2024
f9acbce
type
bso-intel Apr 17, 2024
995deaa
export
bso-intel Apr 17, 2024
f169cc3
symbol
bso-intel Apr 17, 2024
5e5f43a
silent
bso-intel Apr 17, 2024
8b47141
dummy
bso-intel Apr 17, 2024
e8b5c27
export
bso-intel Apr 17, 2024
9060cdf
clang-format
bso-intel Apr 17, 2024
d96a870
dump
bso-intel Apr 18, 2024
c7979a0
Merge branch 'exception' of https://github.com/bso-intel/llvm into ex…
bso-intel Apr 18, 2024
c791317
throw exception
bso-intel Apr 18, 2024
277bc24
Merge branch 'exception' of https://github.com/bso-intel/llvm into ex…
bso-intel Apr 18, 2024
f8e106e
expect exception
bso-intel Apr 18, 2024
2131aa8
dump symbol
bso-intel Apr 18, 2024
b574722
dump symbol
bso-intel Apr 18, 2024
21a47c3
separate
bso-intel Apr 19, 2024
8a04796
Merge branch 'exception' of https://github.com/bso-intel/llvm into ex…
bso-intel Apr 19, 2024
fb488e8
dump
bso-intel Apr 19, 2024
cb8a42f
copyright
bso-intel Apr 19, 2024
3dbfc7b
Merge remote-tracking branch 'upstream/sycl' into exception
bso-intel Apr 20, 2024
4df3d9d
deps
bso-intel Apr 20, 2024
0eddf87
clang-format
bso-intel Apr 20, 2024
d912fe4
clang-format
bso-intel Apr 20, 2024
dbb0a13
delete
bso-intel Apr 20, 2024
cb0a4ed
address feedback
bso-intel Apr 22, 2024
4a826df
guard abi-breaking changes
bso-intel Apr 23, 2024
254b07d
Merge remote-tracking branch 'upstream/sycl' into exception
bso-intel Apr 23, 2024
97e7f3a
fixed symbols
bso-intel Apr 23, 2024
1b027dd
Merge remote-tracking branch 'upstream/sycl' into exception
bso-intel Apr 24, 2024
43d7be2
fixed deps
bso-intel Apr 24, 2024
9c59740
moved helper to sycl.hpp
bso-intel Apr 24, 2024
1d52c93
fix symbol
bso-intel Apr 24, 2024
e50b867
Merge remote-tracking branch 'upstream/sycl' into exception
bso-intel Apr 24, 2024
c2c9adc
merge
bso-intel Apr 24, 2024
11dff1f
Merge branch 'exception' of https://github.com/bso-intel/llvm into ex…
bso-intel Apr 24, 2024
e16ce52
export
bso-intel Apr 24, 2024
6a0b2b8
try to export forward-decls
bso-intel Apr 24, 2024
85f91ad
dump sym
bso-intel Apr 25, 2024
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
1 change: 0 additions & 1 deletion sycl/include/sycl/context.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ namespace sycl {
inline namespace _V1 {
// Forward declarations
class device;
class platform;

namespace detail {
class context_impl;
Expand Down
5 changes: 2 additions & 3 deletions sycl/include/sycl/detail/array.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@

#include <sycl/detail/defines_elementary.hpp> // for __SYCL_ALWAYS_INLINE
#include <sycl/detail/pi.h> // for PI_ERROR_INVALID_VALUE
#include <sycl/exception.hpp> // for invalid_parameter_error

#include <stddef.h> // for size_t
#include <stdexcept>
#include <type_traits> // for enable_if_t

namespace sycl {
Expand Down Expand Up @@ -106,8 +106,7 @@ template <int dimensions = 1> class array {
__SYCL_ALWAYS_INLINE void check_dimension(int dimension) const {
#ifndef __SYCL_DEVICE_ONLY__
if (dimension >= dimensions || dimension < 0) {
throw sycl::invalid_parameter_error("Index out of range",
PI_ERROR_INVALID_VALUE);
throw std::out_of_range("Index out of range");
}
#endif
(void)dimension;
Expand Down
7 changes: 2 additions & 5 deletions sycl/include/sycl/detail/property_list_base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

#include <sycl/detail/pi.h> // for PI_ERROR_INVALID_VALUE
#include <sycl/detail/property_helper.hpp> // for DataLessPropKind, Propert...
#include <sycl/exception.hpp> // for invalid_object_error

#include <algorithm> // for iter_swap
#include <bitset> // for bitset
Expand Down Expand Up @@ -92,15 +91,13 @@ class PropertyListBase {
get_property_helper() const {
const int PropKind = static_cast<int>(PropT::getKind());
if (PropKind >= PropWithDataKind::PropWithDataKindSize)
throw sycl::invalid_object_error("The property is not found",
PI_ERROR_INVALID_VALUE);
throw std::invalid_argument("The property is not found");

for (const std::shared_ptr<PropertyWithDataBase> &Prop : MPropsWithData)
if (Prop->isSame(PropKind))
return *static_cast<PropT *>(Prop.get());

throw sycl::invalid_object_error("The property is not found",
PI_ERROR_INVALID_VALUE);
throw std::invalid_argument("The property is not found");
}

void add_or_replace_accessor_properties_helper(
Expand Down
12 changes: 9 additions & 3 deletions sycl/include/sycl/exception.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@

// 4.9.2 Exception Class Interface

#include <sycl/backend_types.hpp> // for backend
#include <sycl/backend_types.hpp> // for backend
#include <sycl/context.hpp>
#include <sycl/detail/cl.h> // for cl_int
#include <sycl/detail/common.hpp> // for codeToString
#include <sycl/detail/defines_elementary.hpp> // for __SYCL2020_DEPRECATED
Expand All @@ -26,8 +27,10 @@
namespace sycl {
inline namespace _V1 {

#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
// Forward declaration
class context;
#endif
steffenlarsen marked this conversation as resolved.
Show resolved Hide resolved

enum class errc : unsigned int {
success = 0,
Expand Down Expand Up @@ -84,10 +87,13 @@ class __SYCL_EXPORT exception : public virtual std::exception {
exception(int, const std::error_category &, const char *);
exception(int, const std::error_category &);

exception(context, std::error_code, const std::string &);
exception(context Ctx, std::error_code Ec, const std::string &WhatArg)
: exception(Ec, std::make_shared<context>(Ctx), WhatArg.c_str()) {}
exception(context Ctx, int EV, const std::error_category &ECat,
const std::string &WhatArg)
: exception(Ctx, {EV, ECat}, WhatArg) {}
exception(context, std::error_code, const char *);
exception(context, std::error_code);
exception(context, int, const std::error_category &, const std::string &);
exception(context, int, const std::error_category &, const char *);
exception(context, int, const std::error_category &);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <sycl/detail/defines_elementary.hpp>
#include <sycl/detail/export.hpp> // for __SYCL_EXPORT
#include <sycl/device.hpp>
#include <sycl/exception.hpp>

#include <string>
#include <vector>
Expand Down
2 changes: 0 additions & 2 deletions sycl/include/sycl/id.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@
#pragma once

#include <sycl/detail/array.hpp> // for array
#include <sycl/detail/common.hpp> // for InitializedVal
#include <sycl/detail/defines.hpp> // for __SYCL_ASSUME_INT
#include <sycl/detail/defines_elementary.hpp> // for __SYCL_DEPRECATED, __SYCL_A...
#include <sycl/exception.hpp> // for make_error_code, errc, exce...
#include <sycl/range.hpp> // for range

#include <stddef.h> // for size_t
Expand Down
5 changes: 1 addition & 4 deletions sycl/include/sycl/property_list.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#include <sycl/detail/pi.h> // for PI_ERROR_INVALID_VALUE
#include <sycl/detail/property_helper.hpp> // for DataLessPropKind, Pro...
#include <sycl/detail/property_list_base.hpp> // for PropertyListBase
#include <sycl/exception.hpp> // for invalid_object_error
#include <sycl/properties/property_traits.hpp> // for is_property

#include <bitset> // for bitset
Expand Down Expand Up @@ -46,9 +45,7 @@ class property_list : protected detail::PropertyListBase {

template <typename PropT> PropT get_property() const {
if (!has_property<PropT>())
throw sycl::invalid_object_error("The property is not found",
PI_ERROR_INVALID_VALUE);

throw std::invalid_argument("The property is not found");
bso-intel marked this conversation as resolved.
Show resolved Hide resolved
return get_property_helper<PropT>();
}

Expand Down
8 changes: 0 additions & 8 deletions sycl/source/exception.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ exception::exception(int EV, const std::error_category &ECat,
exception::exception(int EV, const std::error_category &ECat)
: exception({EV, ECat}, nullptr, "") {}

exception::exception(context Ctx, std::error_code EC,
const std::string &WhatArg)
: exception(EC, std::make_shared<context>(Ctx), WhatArg) {}

exception::exception(context Ctx, std::error_code EC, const char *WhatArg)
: exception(Ctx, EC, std::string(WhatArg)) {}

Expand All @@ -43,10 +39,6 @@ exception::exception(context Ctx, int EV, const std::error_category &ECat,
const char *WhatArg)
: exception(Ctx, {EV, ECat}, std::string(WhatArg)) {}

exception::exception(context Ctx, int EV, const std::error_category &ECat,
const std::string &WhatArg)
: exception(Ctx, {EV, ECat}, WhatArg) {}

exception::exception(context Ctx, int EV, const std::error_category &ECat)
: exception(Ctx, EV, ECat, "") {}

Expand Down
2 changes: 1 addition & 1 deletion sycl/test-e2e/InorderQueue/in_order_get_property.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ int main() {
Queue1.get_property<property::queue::in_order>();
assert(false && "Queue1 was created without any properties therefore get "
"property should fail.");
} catch (const invalid_object_error &e) {
} catch (const std::invalid_argument &e) {
std::string ErrorMessage = e.what();
assert(
(ErrorMessage.find("The property is not found") != std::string::npos) &&
Expand Down
10 changes: 3 additions & 7 deletions sycl/test/abi/sycl_symbols_linux.dump
Original file line number Diff line number Diff line change
Expand Up @@ -3644,21 +3644,17 @@ _ZN4sycl3_V18platformC2ERKNS0_6deviceE
_ZN4sycl3_V18platformC2Ev
_ZN4sycl3_V19exceptionC1ENS0_7contextESt10error_code
_ZN4sycl3_V19exceptionC1ENS0_7contextESt10error_codePKc
_ZN4sycl3_V19exceptionC1ENS0_7contextESt10error_codeRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
_ZN4sycl3_V19exceptionC1ENS0_7contextEiRKNSt3_V214error_categoryE
_ZN4sycl3_V19exceptionC1ENS0_7contextEiRKNSt3_V214error_categoryEPKc
_ZN4sycl3_V19exceptionC1ENS0_7contextEiRKNSt3_V214error_categoryERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
_ZN4sycl3_V19exceptionC1ESt10error_code
_ZN4sycl3_V19exceptionC1ESt10error_codePKc
_ZN4sycl3_V19exceptionC1ESt10error_codeSt10shared_ptrINS0_7contextEEPKc
_ZN4sycl3_V19exceptionC1EiRKNSt3_V214error_categoryE
_ZN4sycl3_V19exceptionC1EiRKNSt3_V214error_categoryEPKc
_ZN4sycl3_V19exceptionC2ENS0_7contextESt10error_code
_ZN4sycl3_V19exceptionC2ENS0_7contextESt10error_codePKc
_ZN4sycl3_V19exceptionC2ENS0_7contextESt10error_codeRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
_ZN4sycl3_V19exceptionC2ENS0_7contextEiRKNSt3_V214error_categoryE
_ZN4sycl3_V19exceptionC2ENS0_7contextEiRKNSt3_V214error_categoryEPKc
_ZN4sycl3_V19exceptionC2ENS0_7contextEiRKNSt3_V214error_categoryERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
_ZN4sycl3_V19exceptionC2ESt10error_code
_ZN4sycl3_V19exceptionC2ESt10error_codePKc
_ZN4sycl3_V19exceptionC2ESt10error_codeSt10shared_ptrINS0_7contextEEPKc
Expand Down Expand Up @@ -4093,14 +4089,14 @@ _ZNK4sycl3_V16device9getNativeEv
_ZNK4sycl3_V16kernel11get_backendEv
_ZNK4sycl3_V16kernel11get_contextEv
_ZNK4sycl3_V16kernel13getNativeImplEv
_ZNK4sycl3_V16kernel16get_backend_infoINS0_4info6device15backend_versionEEENS0_6detail20is_backend_info_descIT_E11return_typeEv
_ZNK4sycl3_V16kernel16get_backend_infoINS0_4info6device7versionEEENS0_6detail20is_backend_info_descIT_E11return_typeEv
_ZNK4sycl3_V16kernel16get_backend_infoINS0_4info8platform7versionEEENS0_6detail20is_backend_info_descIT_E11return_typeEv
_ZNK4sycl3_V16kernel13get_info_implINS0_4info6kernel10attributesEEENS0_6detail11ABINeutralTINS6_19is_kernel_info_descIT_E11return_typeEE4typeEv
_ZNK4sycl3_V16kernel13get_info_implINS0_4info6kernel13function_nameEEENS0_6detail11ABINeutralTINS6_19is_kernel_info_descIT_E11return_typeEE4typeEv
_ZNK4sycl3_V16kernel13get_info_implINS0_4info6kernel15reference_countEEENS0_6detail11ABINeutralTINS6_19is_kernel_info_descIT_E11return_typeEE4typeEv
_ZNK4sycl3_V16kernel13get_info_implINS0_4info6kernel7contextEEENS0_6detail11ABINeutralTINS6_19is_kernel_info_descIT_E11return_typeEE4typeEv
_ZNK4sycl3_V16kernel13get_info_implINS0_4info6kernel8num_argsEEENS0_6detail11ABINeutralTINS6_19is_kernel_info_descIT_E11return_typeEE4typeEv
_ZNK4sycl3_V16kernel16get_backend_infoINS0_4info6device15backend_versionEEENS0_6detail20is_backend_info_descIT_E11return_typeEv
_ZNK4sycl3_V16kernel16get_backend_infoINS0_4info6device7versionEEENS0_6detail20is_backend_info_descIT_E11return_typeEv
_ZNK4sycl3_V16kernel16get_backend_infoINS0_4info8platform7versionEEENS0_6detail20is_backend_info_descIT_E11return_typeEv
_ZNK4sycl3_V16kernel17get_kernel_bundleEv
_ZNK4sycl3_V16kernel19ext_oneapi_get_infoINS0_3ext6oneapi12experimental4info21kernel_queue_specific23max_num_work_group_syncEEENT_11return_typeERKNS0_5queueE
_ZNK4sycl3_V16kernel3getEv
Expand Down
Loading