summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSerge Martin <[email protected]>2016-05-17 16:03:09 +0200
committerFrancisco Jerez <[email protected]>2016-07-11 20:34:34 -0700
commit70fe6267a37dfc97ef8b6dd22a0431fcfc293d2a (patch)
tree55e0666e94fe0592c9454f0a69627fcc0a82c552 /src
parent85309e8b55419f7d80dcf7e962e54e00f6acb05c (diff)
clover: Override ret_object.
Return an API object from an intrusive reference to a Clover object, incrementing the reference count of the object. Reviewed-by: Francisco Jerez <[email protected]> Tested-by: Jan Vesely <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/state_trackers/clover/api/util.hpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/clover/api/util.hpp b/src/gallium/state_trackers/clover/api/util.hpp
index 31e20e424b9..66bd12597c6 100644
--- a/src/gallium/state_trackers/clover/api/util.hpp
+++ b/src/gallium/state_trackers/clover/api/util.hpp
@@ -68,6 +68,17 @@ namespace clover {
*p = desc(v());
}
}
+
+ ///
+ /// Return an API object from an intrusive reference to a Clover object,
+ /// incrementing the reference count of the object.
+ ///
+ template<typename T>
+ typename T::descriptor_type *
+ ret_object(const intrusive_ref<T> &v) {
+ v().retain();
+ return desc(v());
+ }
}
#endif