Skip to content

Commit c182a1e

Browse files
authored
Fix static loader to request current version as the latest APIs (#327)
Signed-off-by: Neil R. Spruit <neil.r.spruit@intel.com>
1 parent a03488a commit c182a1e

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

source/lib/ze_lib.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ namespace ze_lib
101101
}
102102

103103
bool zeInitDriversSupport = true;
104+
ze_api_version_t current_api_version = version;
104105
const std::string loader_name = "loader";
105106
for (auto &component : versions) {
106107
if (loader_name == component.component_name) {
@@ -121,6 +122,12 @@ namespace ze_lib
121122
}
122123
}
123124

125+
if (version > current_api_version) {
126+
version = current_api_version;
127+
std::string message = "ze_lib Context Init() Static Loader Requesting Loader API Version v" + std::to_string(ZE_MAJOR_VERSION(version)) + "." + std::to_string(ZE_MINOR_VERSION(version));
128+
debug_trace_message(message, "");
129+
}
130+
124131
typedef HMODULE (ZE_APICALL *getTracing_t)();
125132
auto getTracing = reinterpret_cast<getTracing_t>(
126133
GET_FUNCTION_PTR(loader, "zeLoaderGetTracingHandle") );

0 commit comments

Comments
 (0)