diff options
author | Francisco Jerez <[email protected]> | 2013-10-24 12:09:55 -0700 |
---|---|---|
committer | Francisco Jerez <[email protected]> | 2013-10-24 13:33:41 -0700 |
commit | 7463abd37d65abd4d87abe314e0629c853dd9bca (patch) | |
tree | 213cc10169f3819ea8b4488e8d165383da68a5c9 /src/gallium/state_trackers/clover/util | |
parent | b8d7a97fade140b8fb7c464afc24b210f1fe4ff7 (diff) |
clover: Query maximum kernel block size from the device instead of the kernel object.
Based on a similar fix from Aaron Watry. It seems unlikely that we
will ever need a kernel-specific setting for this, and the Gallium API
doesn't support it. Remove kernel::max_block_size() altogether.
Diffstat (limited to 'src/gallium/state_trackers/clover/util')
-rw-r--r-- | src/gallium/state_trackers/clover/util/algorithm.hpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/clover/util/algorithm.hpp b/src/gallium/state_trackers/clover/util/algorithm.hpp index 4eb90cffa9f..1658458ee18 100644 --- a/src/gallium/state_trackers/clover/util/algorithm.hpp +++ b/src/gallium/state_trackers/clover/util/algorithm.hpp @@ -56,6 +56,18 @@ namespace clover { } /// + /// Return the only element in a range. + /// + template<typename R> + detail::preferred_reference_type<R> + unique(R &&r) { + if (r.size() != 1) + throw std::out_of_range(""); + + return r.front(); + } + + /// /// Combine a variable number of ranges element-wise in a single /// range of tuples. /// |