File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 173173 * Enable exceptions for use in the C++ bindings header. This is the
174174 * preferred error handling mechanism but is not required.
175175 *
176+ * - CL_HPP_CUSTOM_EXCEPTION_TYPE
177+ *
178+ * Specify the type which should be used for exceptions. This type
179+ * must have a constructor accepting an int and a const char*.
180+ *
176181 * - CL_HPP_ENABLE_SIZE_T_COMPATIBILITY
177182 *
178183 * Backward compatibility option to support cl.hpp-style size_t
@@ -748,6 +753,7 @@ namespace cl {
748753#endif // cl_khr_command_buffer
749754
750755#if defined(CL_HPP_ENABLE_EXCEPTIONS)
756+ #if !defined(CL_HPP_CUSTOM_EXCEPTION_TYPE)
751757 /* ! \brief Exception class
752758 *
753759 * This may be thrown by API functions when CL_HPP_ENABLE_EXCEPTIONS is defined.
@@ -790,6 +796,9 @@ namespace cl {
790796 */
791797 cl_int err (void ) const { return err_; }
792798 };
799+ #else
800+ using Error = CL_HPP_CUSTOM_EXCEPTION_TYPE;
801+ #endif
793802#define CL_HPP_ERR_STR_ (x ) #x
794803#else
795804#define CL_HPP_ERR_STR_ (x ) nullptr
You can’t perform that action at this time.
0 commit comments