Debug flag to append api module build options
Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
This commit is contained in:
parent
b2001bf265
commit
98db084b59
|
@ -583,8 +583,14 @@ bool ModuleImp::initialize(const ze_module_desc_t *desc, NEO::Device *neoDevice)
|
||||||
this->translationUnit->shouldSuppressRebuildWarning = NEO::CompilerOptions::extract(NEO::CompilerOptions::noRecompiledFromIr, buildFlagsInput);
|
this->translationUnit->shouldSuppressRebuildWarning = NEO::CompilerOptions::extract(NEO::CompilerOptions::noRecompiledFromIr, buildFlagsInput);
|
||||||
this->createBuildOptions(buildFlagsInput.c_str(), buildOptions, internalBuildOptions);
|
this->createBuildOptions(buildFlagsInput.c_str(), buildOptions, internalBuildOptions);
|
||||||
|
|
||||||
if (type == ModuleType::User && NEO::DebugManager.flags.InjectInternalBuildOptions.get() != "unk") {
|
if (type == ModuleType::User) {
|
||||||
NEO::CompilerOptions::concatenateAppend(internalBuildOptions, NEO::DebugManager.flags.InjectInternalBuildOptions.get());
|
if (NEO::DebugManager.flags.InjectInternalBuildOptions.get() != "unk") {
|
||||||
|
NEO::CompilerOptions::concatenateAppend(internalBuildOptions, NEO::DebugManager.flags.InjectInternalBuildOptions.get());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (NEO::DebugManager.flags.InjectApiBuildOptions.get() != "unk") {
|
||||||
|
NEO::CompilerOptions::concatenateAppend(buildOptions, NEO::DebugManager.flags.InjectApiBuildOptions.get());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (desc->format == ZE_MODULE_FORMAT_NATIVE) {
|
if (desc->format == ZE_MODULE_FORMAT_NATIVE) {
|
||||||
|
|
|
@ -2889,6 +2889,28 @@ TEST_F(ModuleTest, GivenInjectInternalBuildOptionsWhenBuildingUserModuleThenInte
|
||||||
EXPECT_TRUE(CompilerOptions::contains(cip->buildInternalOptions, "-abc"));
|
EXPECT_TRUE(CompilerOptions::contains(cip->buildInternalOptions, "-abc"));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
TEST_F(ModuleTest, GivenInjectApiBuildOptionsWhenBuildingUserModuleThenApiOptionsAreAppended) {
|
||||||
|
DebugManagerStateRestore dbgRestorer;
|
||||||
|
DebugManager.flags.InjectApiBuildOptions.set(" -abc");
|
||||||
|
|
||||||
|
auto cip = new NEO::MockCompilerInterfaceCaptureBuildOptions();
|
||||||
|
device->getNEODevice()->getExecutionEnvironment()->rootDeviceEnvironments[device->getRootDeviceIndex()]->compilerInterface.reset(cip);
|
||||||
|
|
||||||
|
uint8_t binary[10];
|
||||||
|
ze_module_desc_t moduleDesc = {};
|
||||||
|
moduleDesc.format = ZE_MODULE_FORMAT_IL_SPIRV;
|
||||||
|
moduleDesc.pInputModule = binary;
|
||||||
|
moduleDesc.inputSize = 10;
|
||||||
|
|
||||||
|
ModuleBuildLog *moduleBuildLog = nullptr;
|
||||||
|
|
||||||
|
auto module = std::unique_ptr<L0::ModuleImp>(new L0::ModuleImp(device, moduleBuildLog, ModuleType::User));
|
||||||
|
ASSERT_NE(nullptr, module.get());
|
||||||
|
module->initialize(&moduleDesc, device->getNEODevice());
|
||||||
|
|
||||||
|
EXPECT_TRUE(CompilerOptions::contains(cip->buildOptions, "-abc"));
|
||||||
|
};
|
||||||
|
|
||||||
TEST_F(ModuleTest, GivenInjectInternalBuildOptionsWhenBuildingBuiltinModuleThenInternalOptionsAreNotAppended) {
|
TEST_F(ModuleTest, GivenInjectInternalBuildOptionsWhenBuildingBuiltinModuleThenInternalOptionsAreNotAppended) {
|
||||||
DebugManagerStateRestore dbgRestorer;
|
DebugManagerStateRestore dbgRestorer;
|
||||||
DebugManager.flags.InjectInternalBuildOptions.set(" -abc");
|
DebugManager.flags.InjectInternalBuildOptions.set(" -abc");
|
||||||
|
|
|
@ -84,6 +84,7 @@ DECLARE_DEBUG_VARIABLE(std::string, FilterDeviceId, std::string("unk"), "Device
|
||||||
DECLARE_DEBUG_VARIABLE(std::string, FilterBdfPath, std::string("unk"), "Linux-only, BDF path filter, only matching paths will be opened. Ignored when unk.")
|
DECLARE_DEBUG_VARIABLE(std::string, FilterBdfPath, std::string("unk"), "Linux-only, BDF path filter, only matching paths will be opened. Ignored when unk.")
|
||||||
DECLARE_DEBUG_VARIABLE(std::string, LoadBinarySipFromFile, std::string("unk"), "Select binary file to load SIP kernel raw binary. When file named *_header.* exists, it is used as header")
|
DECLARE_DEBUG_VARIABLE(std::string, LoadBinarySipFromFile, std::string("unk"), "Select binary file to load SIP kernel raw binary. When file named *_header.* exists, it is used as header")
|
||||||
DECLARE_DEBUG_VARIABLE(std::string, InjectInternalBuildOptions, std::string("unk"), "Appends internal build options string to user modules")
|
DECLARE_DEBUG_VARIABLE(std::string, InjectInternalBuildOptions, std::string("unk"), "Appends internal build options string to user modules")
|
||||||
|
DECLARE_DEBUG_VARIABLE(std::string, InjectApiBuildOptions, std::string("unk"), "Appends api build options string to user modules")
|
||||||
DECLARE_DEBUG_VARIABLE(std::string, OverrideDeviceName, std::string("unk"), "Device name to override")
|
DECLARE_DEBUG_VARIABLE(std::string, OverrideDeviceName, std::string("unk"), "Device name to override")
|
||||||
DECLARE_DEBUG_VARIABLE(int64_t, OverrideMultiStoragePlacement, -1, "-1: disable, 0+: tile mask, each bit corresponds to tile")
|
DECLARE_DEBUG_VARIABLE(int64_t, OverrideMultiStoragePlacement, -1, "-1: disable, 0+: tile mask, each bit corresponds to tile")
|
||||||
DECLARE_DEBUG_VARIABLE(int64_t, ForceCompressionDisabledForCompressedBlitCopies, -1, "-1: default, 0: disabled, 1: enabled. If compression is required, set AUX_CCS_E, but force CompressionEnable filed. 0 should result in uncompressed read/write")
|
DECLARE_DEBUG_VARIABLE(int64_t, ForceCompressionDisabledForCompressedBlitCopies, -1, "-1: default, 0: disabled, 1: enabled. If compression is required, set AUX_CCS_E, but force CompressionEnable filed. 0 should result in uncompressed read/write")
|
||||||
|
|
|
@ -37,6 +37,7 @@ FilterDeviceId = unk
|
||||||
FilterBdfPath = unk
|
FilterBdfPath = unk
|
||||||
LoadBinarySipFromFile = unk
|
LoadBinarySipFromFile = unk
|
||||||
InjectInternalBuildOptions = unk
|
InjectInternalBuildOptions = unk
|
||||||
|
InjectApiBuildOptions = unk
|
||||||
OverrideCsrAllocationSize = -1
|
OverrideCsrAllocationSize = -1
|
||||||
ForceL1Caching = -1
|
ForceL1Caching = -1
|
||||||
UseKmdMigration = -1
|
UseKmdMigration = -1
|
||||||
|
|
Loading…
Reference in New Issue