Skip to content

[SYCL] Remove default error code value in exception #1150

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

Merged

Conversation

s-kanaev
Copy link
Contributor

Signed-off-by: Sergey Kanaev sergey.kanaev@intel.com

Signed-off-by: Sergey Kanaev <sergey.kanaev@intel.com>
}

template <typename T, access::address_space Space>
void store(multi_ptr<T, Space> dst, T &x) const {
throw runtime_error("Subgroups are not supported on host device. ");
throw runtime_error("Subgroups are not supported on host device. ",
PI_INVALID_DEVICE);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it is more like feature_not_supported("text", PI_INVALID_OPERATION), but I'm okay with this resolution for now

@romanovvlad
Copy link
Contributor

@s-kanaev ping

Sergey Kanaev added 4 commits February 26, 2020 15:20
Signed-off-by: Sergey Kanaev <sergey.kanaev@intel.com>
Signed-off-by: Sergey Kanaev <sergey.kanaev@intel.com>
Signed-off-by: Sergey Kanaev <sergey.kanaev@intel.com>
@@ -264,7 +264,7 @@ Command *Scheduler::GraphBuilder::insertMemoryMove(MemObjRecord *Record,
AllocaCmdSrc = (Record->MAllocaCommands.end() != It) ? *It : nullptr;
}
if (!AllocaCmdSrc)
throw runtime_error("Cannot find buffer allocation");
throw runtime_error("Cannot find buffer allocation", PI_INVALID_VALUE);
Copy link
Contributor

@sergey-semenov sergey-semenov Mar 3, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think PI_INVALID_VALUE is appropriate here, but this and some other exceptions here are internal errors and should probably be assertions instead. But this is outside the scope of this patch, so I'm fine with this resolution for now.

Copy link
Contributor

@garimagu garimagu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just some nitpicking.

@@ -236,7 +236,8 @@ class SYCLMemObjT : public SYCLMemObjI {
if (useHostPtr())
throw invalid_parameter_error(
"Buffer constructor from a pair of iterator values does not support "
"use_host_ptr property.");
"use_host_ptr property.",
PI_INVALID_OPERATION);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think PI_INVALID_VALUE is not apt for a invalid_parameter_error.
You have used that in the above file pretty consistently.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no requirement in spec on exception in this case.
Though, for sake of consistency I'd rather change the type of exception to a mere cl::sycl::runtime_error.
Done.

Sergey Kanaev added 3 commits March 4, 2020 15:57
Signed-off-by: Sergey Kanaev <sergey.kanaev@intel.com>
Signed-off-by: Sergey Kanaev <sergey.kanaev@intel.com>
@romanovvlad romanovvlad merged commit 04ee17c into intel:sycl Mar 4, 2020
alexbatashev pushed a commit to alexbatashev/llvm that referenced this pull request Mar 5, 2020
…_accessor_refactor

* origin/sycl: (38 commits)
  [SYCL] Fix device::get_devices() with a non-host device type (intel#1235)
  [SYCL][PI][CUDA] Implement kernel and kernel-group information queries (intel#1180)
  [SYCL] Remove default error code value in exception (intel#1150)
  [SYCL] Fix devicelib assert LIT test (intel#1245)
  [SYCL] Set aux-target-cpu for SYCL offload device compilation (intel#1225)
  [SYCL] Remove fabs and ceil from the list of unsupported math functions (intel#1217)
  [SYCL] Fix circular reference between events and queues (intel#1226)
  [CI][Doc] Use SSH to deploy GitHub Pages (intel#1232)
  [SYCL][CUDA][Test] Testing for use of CUDA primary context (intel#1174)
  [SYCL] allow underscore symbol in temporary directory name
  [SYCL] Reject zero length arrays (intel#1153)
  [SYCL] Fix static code analyzis concerns (intel#1189)
  [SYCL] Add more details about the -fintelfpga option (intel#1218)
  [SYCL][CUDA] Select only NVPTX64 device binaries (intel#1223)
  [SYCL] Reverse max work-group size order (intel#1177)
  [SYCL][Doc] Add GroupAlgorithms extension (intel#1079)
  [SYCL] Fix SYCL internal enumerators conflict with user defined macro (intel#1188)
  [SYCL][CUDA] Fixes context release and unnamed context scope (intel#1207)
  [SYCL][CUDA] Fix context creation property parsing
  [CUDA][PI] clang-format pi.h
  ...
alexbatashev pushed a commit to alexbatashev/llvm that referenced this pull request Mar 5, 2020
…ctor_tests

* origin/sycl:
  [SYCL] Fix device::get_devices() with a non-host device type (intel#1235)
  [SYCL][PI][CUDA] Implement kernel and kernel-group information queries (intel#1180)
  [SYCL] Remove default error code value in exception (intel#1150)
  [SYCL] Fix devicelib assert LIT test (intel#1245)
  [SYCL] Set aux-target-cpu for SYCL offload device compilation (intel#1225)
  [SYCL] Remove fabs and ceil from the list of unsupported math functions (intel#1217)
@s-kanaev s-kanaev deleted the private/s-kanaev/exception-default-param branch March 12, 2020 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants