[Mesa-dev] [PATCH 7/8] clover/llvm: validate requested cl-std against device_clc_version

Aaron Watry awatry at gmail.com
Mon Jul 31 01:26:11 UTC 2017


Signed-off-by: Aaron Watry <awatry at gmail.com>
Cc: Pierre Moreau <pierre.morrow at free.fr>
---
 src/gallium/state_trackers/clover/llvm/invocation.cpp | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/gallium/state_trackers/clover/llvm/invocation.cpp b/src/gallium/state_trackers/clover/llvm/invocation.cpp
index 16966bedb3..63b2961752 100644
--- a/src/gallium/state_trackers/clover/llvm/invocation.cpp
+++ b/src/gallium/state_trackers/clover/llvm/invocation.cpp
@@ -145,6 +145,11 @@ namespace {
          auto pos = opt.find(search);
          if (pos == 0){
             auto ver = opt.substr(pos+search.size());
+            auto device_ver = get_language_version_from_string(device_version);
+            auto requested = get_language_version_from_string(ver);
+            if (requested > device_ver) {
+               throw build_error();
+            }
             return get_language_from_version_str(ver, true);
          }
       }
-- 
2.11.0



More information about the mesa-dev mailing list