Skip to content

Commit 67d1197

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 9169323 commit 67d1197

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
@@ -630,6 +630,14 @@ namespace driver
630630
pSysman.version = ZE_API_VERSION_CURRENT;
631631
}
632632

633+
char *context_t::setenv_var_with_driver_id(const std::string &key, uint32_t driverId)
634+
{
635+
std::string env = key + "=" + std::to_string(driverId);
636+
char *env_str = strdup_safe(env.c_str());
637+
putenv_safe(env_str);
638+
return env_str;
639+
}
640+
633641
context_t::~context_t()
634642
{
635643
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)