diff --git a/test_conformance/compiler/test_compiler_defines_for_extensions.cpp b/test_conformance/compiler/test_compiler_defines_for_extensions.cpp index ca89c70e..e771a0fd 100644 --- a/test_conformance/compiler/test_compiler_defines_for_extensions.cpp +++ b/test_conformance/compiler/test_compiler_defines_for_extensions.cpp @@ -1,6 +1,6 @@ // // Copyright (c) 2017 The Khronos Group Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at @@ -332,7 +332,12 @@ int test_compiler_defines_for_extensions(cl_device_id device, cl_context context cl_program program; cl_kernel kernel; - error = create_single_kernel_helper(context, &program, &kernel, 1, (const char **)&kernel_code, "test"); + size_t major = 0; + size_t minor = 0; + error = get_device_version(device, &major, &minor); + test_error(error, "get_device_version failed"); + + error = create_single_kernel_helper(context, &program, &kernel, 1, (const char **)&kernel_code, "test", major < 2 ? "" : "-cl-std=CL2.0"); test_error(error, "create_single_kernel_helper failed"); data = (cl_int*)malloc(sizeof(cl_int)*(num_not_supported_extensions+num_of_supported_extensions));