summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/clover
diff options
context:
space:
mode:
authorKarol Herbst <[email protected]>2019-07-30 13:36:37 +0200
committerKarol Herbst <[email protected]>2019-09-21 08:28:32 +0000
commit1982ac6d6bb3e42db63729355fdd88e2b474e7e2 (patch)
tree9df776fc77e5984bf4ca3693e8b7a54f5b175cfb /src/gallium/state_trackers/clover
parentf3ba98cb18b30bead9ae26716daadce77030c1a0 (diff)
clover/functional: add id_equals helper
v2: pass argument by value Signed-off-by: Karol Herbst <[email protected]> Reviewed-by: Francisco Jerez <[email protected]> Reviewed-by: Pierre Moreau <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/clover')
-rw-r--r--src/gallium/state_trackers/clover/util/functional.hpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/clover/util/functional.hpp b/src/gallium/state_trackers/clover/util/functional.hpp
index 98bbdff4bd1..fc281c5c79a 100644
--- a/src/gallium/state_trackers/clover/util/functional.hpp
+++ b/src/gallium/state_trackers/clover/util/functional.hpp
@@ -347,6 +347,21 @@ namespace clover {
const std::string &name;
};
+ class id_equals {
+ public:
+ id_equals(const uint32_t id) : id(id) {
+ }
+
+ template<typename T>
+ bool
+ operator()(const T &x) const {
+ return x.id == id;
+ }
+
+ private:
+ const uint32_t id;
+ };
+
template<typename T>
class key_equals_t {
public: