Skip to content

Commit 35de06d

Browse files
committed
Add tests for Loader Driver interaction conformance for Sysman VF Management API's
Related-To: NEO-15334 Signed-off-by: Vishnu Khanth <vishnu.khanth.b@intel.com>
1 parent ec50c9c commit 35de06d

6 files changed

Lines changed: 427 additions & 834 deletions

File tree

scripts/templates/nullddi.cpp.mako

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,7 @@ namespace driver
9494
}
9595
%if not fname.endswith("DriverGet") and not re.match("Init", obj['name']):
9696

97-
char *env_str = strdup_safe((std::string("${fname}=") + std::to_string(ZEL_NULL_DRIVER_ID)).c_str());
98-
putenv_safe(env_str);
97+
char *env_str = context.setenv_var_with_driver_id("${fname}", ZEL_NULL_DRIVER_ID);
9998
context.env_vars.push_back(env_str);
10099
%endif
101100

source/drivers/null/ze_null.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -619,6 +619,14 @@ namespace driver
619619
pSysman.version = ZE_API_VERSION_CURRENT;
620620
}
621621

622+
char *context_t::setenv_var_with_driver_id(const std::string &key, uint32_t driverId)
623+
{
624+
std::string env = key + "=" + std::to_string(driverId);
625+
char *env_str = strdup_safe(env.c_str());
626+
putenv_safe(env_str);
627+
return env_str;
628+
}
629+
622630
context_t::~context_t()
623631
{
624632
for (auto handle : globalBaseNullHandle)

source/drivers/null/ze_null.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ namespace driver
5757
return reinterpret_cast<void*>( ++count );
5858
}
5959
}
60+
61+
char *setenv_var_with_driver_id(const std::string &key, uint32_t driverId);
6062
};
6163

6264
extern context_t context;

0 commit comments

Comments
 (0)