mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-30 01:35:20 +08:00
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:
committed by
sys_ocldev
parent
f0aef442ec
commit
45f0bc56bc
@@ -105,6 +105,10 @@ cl_int Program::build(
|
||||
if (internalOptions.find(compilerExtensionsOptions) == std::string::npos) {
|
||||
CompilerOptions::concatenateAppend(internalOptions, compilerExtensionsOptions);
|
||||
}
|
||||
auto compilerFeaturesOptions = clDevice->peekCompilerFeatures();
|
||||
if (internalOptions.find(compilerFeaturesOptions) == std::string::npos) {
|
||||
CompilerOptions::concatenateAppend(internalOptions, compilerFeaturesOptions);
|
||||
}
|
||||
|
||||
inputArgs.apiOptions = ArrayRef<const char>(options.c_str(), options.length());
|
||||
inputArgs.internalOptions = ArrayRef<const char>(internalOptions.c_str(), internalOptions.length());
|
||||
|
||||
@@ -133,6 +133,8 @@ cl_int Program::compile(
|
||||
UNRECOVERABLE_IF(clDevice == nullptr);
|
||||
auto compilerExtensionsOptions = clDevice->peekCompilerExtensions();
|
||||
CompilerOptions::concatenateAppend(internalOptions, compilerExtensionsOptions);
|
||||
auto compilerFeaturesOptions = clDevice->peekCompilerFeatures();
|
||||
CompilerOptions::concatenateAppend(internalOptions, compilerFeaturesOptions);
|
||||
|
||||
if (isKernelDebugEnabled()) {
|
||||
std::string filename;
|
||||
|
||||
@@ -63,8 +63,10 @@ Program::Program(ExecutionEnvironment &executionEnvironment, Context *context, b
|
||||
bool force32BitAddressess = false;
|
||||
|
||||
if (pClDevice) {
|
||||
auto areOcl21FeaturesEnabled = pClDevice->areOcl21FeaturesEnabled();
|
||||
if (areOcl21FeaturesEnabled) {
|
||||
auto enabledClVersion = pClDevice->getEnabledClVersion();
|
||||
if (enabledClVersion == 30) {
|
||||
internalOptions = "-ocl-version=300 ";
|
||||
} else if (enabledClVersion == 21) {
|
||||
internalOptions = "-ocl-version=210 ";
|
||||
} else {
|
||||
internalOptions = "-ocl-version=120 ";
|
||||
|
||||
Reference in New Issue
Block a user