From aa93af809fc8268a8a4a80e00ff4b8a2770fa659 Mon Sep 17 00:00:00 2001 From: EdB Date: Sun, 12 Oct 2014 01:58:39 +0300 Subject: [PATCH] clover: Add allow_empty_tag. To allow empty objs() list checks. Reviewed-by: Francisco Jerez --- .../state_trackers/clover/core/object.hpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/gallium/state_trackers/clover/core/object.hpp b/src/gallium/state_trackers/clover/core/object.hpp index daad06848b4..e3a5ab7fafd 100644 --- a/src/gallium/state_trackers/clover/core/object.hpp +++ b/src/gallium/state_trackers/clover/core/object.hpp @@ -55,6 +55,7 @@ namespace clover { }; struct default_tag; + struct allow_empty_tag; struct wait_list_tag; struct property_list_tag; @@ -95,6 +96,23 @@ namespace clover { } }; + template + struct descriptor_traits { + typedef typename D::object_type object_type; + + static void + validate(D *d) { + if (!d || d->dispatch != &_dispatch) + throw invalid_object_error(); + } + + static void + validate_list(D *const *ds, size_t n) { + if (bool(ds) != bool(n)) + throw error(CL_INVALID_VALUE); + } + }; + template struct descriptor_traits { typedef typename D::object_type object_type; -- 2.30.2