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

Submitted by Aaron Watry on July 31, 2017, 1:26 a.m.

Details

Message ID 20170731012612.23176-8-awatry@gmail.com
State New
Headers show
Series "A few clover fixes for both CTS and eventual 1.2 support" ( rev: 1 ) in Mesa

Not browsing as part of any series.

Commit Message

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

Patch hide | download patch | download mbox

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);
          }
       }