@@ -15,6 +15,10 @@ __SYCL_INLINE_NAMESPACE(cl) {
1515namespace  sycl  {
1616namespace  detail  {
1717
18+ // / The plugin class provides a unified interface to the underlying low-level
19+ // / runtimes for the device-agnostic SYCL runtime.
20+ // /
21+ // / \ingroup sycl_pi
1822class  plugin  {
1923public: 
2024  plugin () = delete ;
@@ -25,21 +29,24 @@ class plugin {
2529
2630  ~plugin () = default ;
2731
28-   //  Utility function to check return from PI calls.
29-   //  Throws if pi_result is not a PI_SUCCESS.
30-   //  Exception - The type of exception to throw if PiResult of a call is not
31-   //  PI_SUCCESS. Default value is cl::sycl::runtime_error.
32+   // / Checks return value from PI calls.
33+   // /
34+   // / \throw Exception if pi_result is not a PI_SUCCESS.
3235  template  <typename  Exception = cl::sycl::runtime_error>
3336  void  checkPiResult (RT::PiResult pi_result) const  {
3437    CHECK_OCL_CODE_THROW (pi_result, Exception);
3538  }
3639
37-   //  Call the PiApi, trace the call and return the result.
38-   //  To check the result use checkPiResult.
39-   //  Usage:
40-   //  PiResult Err = plugin.call<PiApiKind::pi>(Args);
41-   //  Plugin.checkPiResult(Err); <- Checks Result and throws a runtime_error
42-   //  exception.
40+   // / Calls the PiApi, traces the call, and returns the result.
41+   // /
42+   // / Usage:
43+   // / \code{cpp}
44+   // / PiResult Err = plugin.call<PiApiKind::pi>(Args);
45+   // / Plugin.checkPiResult(Err); // Checks Result and throws a runtime_error
46+   // / // exception.
47+   // / \endcode
48+   // /
49+   // / \sa plugin::checkPiResult
4350  template  <PiApiKind PiApiOffset, typename ... ArgsT>
4451  RT::PiResult call_nocheck (ArgsT... Args) const  {
4552    RT::PiFuncInfo<PiApiOffset> PiCallInfo;
@@ -56,8 +63,9 @@ class plugin {
5663    return  R;
5764  }
5865
59-   //  Call the API, trace the call, check the result and throw
60-   //  a runtime_error Exception
66+   // / Calls the API, traces the call, checks the result
67+   // /
68+   // / \throw cl::sycl::runtime_exception if the call was not successful.
6169  template  <PiApiKind PiApiOffset, typename ... ArgsT>
6270  void  call (ArgsT... Args) const  {
6371    RT::PiResult Err = call_nocheck<PiApiOffset>(Args...);
0 commit comments