Skip to content

Commit

Permalink
[SYCL] Remove old SYCL 1.2 exception subclasses (#14546)
Browse files Browse the repository at this point in the history
Codebase has been cleaned up from using them in earlier individual PRs.
Now that they aren't used final removal is trivial.
  • Loading branch information
aelovikov-intel committed Jul 13, 2024
1 parent 36543a1 commit c98fc7c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 53 deletions.
47 changes: 0 additions & 47 deletions sycl/include/sycl/exception.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,53 +150,6 @@ class __SYCL_EXPORT exception : public virtual std::exception {
pi_int32 pi_err);
};

class __SYCL2020_DEPRECATED(
"use sycl::exception with sycl::errc::runtime instead.") runtime_error
: public exception {
public:
runtime_error() : exception(make_error_code(errc::runtime)) {}

runtime_error(const char *Msg, pi_int32 Err)
: runtime_error(std::string(Msg), Err) {}

runtime_error(const std::string &Msg, pi_int32 Err)
: exception(make_error_code(errc::runtime), Msg, Err) {}

runtime_error(std::error_code Ec, const std::string &Msg,
const pi_int32 PIErr)
: exception(Ec, Msg, PIErr) {}

protected:
runtime_error(std::error_code Ec) : exception(Ec) {}
};

class __SYCL2020_DEPRECATED(
"use sycl::exception with sycl::errc::nd_range instead.") nd_range_error
: public runtime_error {
public:
nd_range_error() : runtime_error(make_error_code(errc::nd_range)) {}

nd_range_error(const char *Msg, pi_int32 Err)
: nd_range_error(std::string(Msg), Err) {}

nd_range_error(const std::string &Msg, pi_int32 Err)
: runtime_error(make_error_code(errc::nd_range), Msg, Err) {}
};

class __SYCL2020_DEPRECATED(
"use sycl::exception with a sycl::errc enum value instead.")
invalid_parameter_error : public runtime_error {
public:
invalid_parameter_error()
: runtime_error(make_error_code(errc::kernel_argument)) {}

invalid_parameter_error(const char *Msg, pi_int32 Err)
: invalid_parameter_error(std::string(Msg), Err) {}

invalid_parameter_error(const std::string &Msg, pi_int32 Err)
: runtime_error(make_error_code(errc::kernel_argument), Msg, Err) {}
};

} // namespace _V1
} // namespace sycl

Expand Down
6 changes: 0 additions & 6 deletions sycl/test/warnings/sycl_2020_deprecations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,6 @@ int main() {
// expected-warning@+1 {{'get_size' is deprecated: get_size() is deprecated, please use byte_size() instead}}
size_t VecGetSize = Vec.get_size();

// expected-warning@+1 {{'runtime_error' is deprecated: use sycl::exception with sycl::errc::runtime instead.}}
sycl::runtime_error re;
// expected-warning@+1 {{'nd_range_error' is deprecated: use sycl::exception with sycl::errc::nd_range instead.}}
sycl::nd_range_error ne;
// expected-warning@+1 {{'invalid_parameter_error' is deprecated: use sycl::exception with a sycl::errc enum value instead.}}
sycl::invalid_parameter_error ipe;
// expected-warning@+1{{'exception' is deprecated: The version of an exception constructor which takes no arguments is deprecated.}}
sycl::exception ex;

Expand Down

0 comments on commit c98fc7c

Please sign in to comment.