summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEdB <[email protected]>2014-10-12 01:58:39 +0300
committerFrancisco Jerez <[email protected]>2014-10-20 10:35:10 +0300
commitaa93af809fc8268a8a4a80e00ff4b8a2770fa659 (patch)
tree6dcbe60b5bb8d6918ccdf4a162b786b5009b5427 /src
parent611d66fe4513e53bde052dd2bab95d448c909a2a (diff)
clover: Add allow_empty_tag.
To allow empty objs() list checks. Reviewed-by: Francisco Jerez <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/state_trackers/clover/core/object.hpp18
1 files changed, 18 insertions, 0 deletions
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;
@@ -96,6 +97,23 @@ namespace clover {
};
template<typename D>
+ struct descriptor_traits<allow_empty_tag, D> {
+ typedef typename D::object_type object_type;
+
+ static void
+ validate(D *d) {
+ if (!d || d->dispatch != &_dispatch)
+ throw invalid_object_error<object_type>();
+ }
+
+ static void
+ validate_list(D *const *ds, size_t n) {
+ if (bool(ds) != bool(n))
+ throw error(CL_INVALID_VALUE);
+ }
+ };
+
+ template<typename D>
struct descriptor_traits<wait_list_tag, D> {
typedef typename D::object_type object_type;