From 99d447cc5dafa3a36b970068961989cced62e3b6 Mon Sep 17 00:00:00 2001 From: Francisco Jerez Date: Tue, 12 Nov 2013 11:14:20 -0800 Subject: clover: Fix the const variant of adaptor_range::end to deal with mismatching range sizes. Fixes infinite loop in find_grid_optimal_factor() in cases where the user specifies a grid size with less dimensions than the device supports. Reported-by: Tom Stellard Cc: "10.0" --- src/gallium/state_trackers/clover/util/range.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/gallium/state_trackers/clover/util/range.hpp b/src/gallium/state_trackers/clover/util/range.hpp index cefa5b5ad17..afa5f7730bf 100644 --- a/src/gallium/state_trackers/clover/util/range.hpp +++ b/src/gallium/state_trackers/clover/util/range.hpp @@ -269,7 +269,8 @@ namespace clover { typename super::const_iterator end() const { - return { f, tuple::map(ends(), os) }; + return { f, tuple::map(advances_by(size()), + tuple::map(begins(), os)) }; } typename super::size_type -- cgit v1.2.3