From 70fe6267a37dfc97ef8b6dd22a0431fcfc293d2a Mon Sep 17 00:00:00 2001 From: Serge Martin Date: Tue, 17 May 2016 16:03:09 +0200 Subject: [PATCH] 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 Tested-by: Jan Vesely --- src/gallium/state_trackers/clover/api/util.hpp | 11 +++++++++++ 1 file changed, 11 insertions(+) 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::descriptor_type * + ret_object(const intrusive_ref &v) { + v().retain(); + return desc(v()); + } } #endif -- 2.30.2