Add options when building the program

Report "-ocl-version=300" when OCL 3.0 is enabled.
Report "-cl-feature=" with list of supported features.

Related-To: NEO-4368

Change-Id: I9aee559ed53541a0f0c1a2a004926d9d29a53d94
Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>
This commit is contained in:
Filip Hazubski
2020-06-16 20:54:15 +02:00
committed by sys_ocldev
parent f0aef442ec
commit 45f0bc56bc
15 changed files with 220 additions and 92 deletions

View File

@ -13,6 +13,7 @@
#include "shared/source/helpers/hw_info.h"
#include "shared/test/unit_test/helpers/debug_manager_state_restore.h"
#include "opencl/source/platform/extensions.h"
#include "opencl/test/unit_test/mocks/mock_compilers.h"
#include "compiler_options.h"
@ -247,6 +248,11 @@ TEST_F(OfflineCompilerTests, TestExtensions) {
mockOfflineCompiler->parseCommandLine(argv.size(), argv);
std::string internalOptions = mockOfflineCompiler->internalOptions;
EXPECT_THAT(internalOptions, ::testing::HasSubstr(std::string("cl_khr_3d_image_writes")));
StackVec<cl_name_version, 12> openclCFeatures;
getOpenclCFeaturesList(DEFAULT_PLATFORM::hwInfo, openclCFeatures);
auto expectedFeaturesOption = convertEnabledOclCFeaturesToCompilerInternalOptions(openclCFeatures);
EXPECT_THAT(internalOptions, ::testing::HasSubstr(expectedFeaturesOption));
}
TEST_F(OfflineCompilerTests, GoodBuildTest) {
std::vector<std::string> argv = {