PR #18407: Fix xla-mlir failures on Windows #19650
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR #18407: Fix xla-mlir failures on Windows
Imported from GitHub PR #18407
This PR aims to enable the XLA/mlir/tool test cases on the Windows Platform.
Error:
//xla/mlir/tools/mlir_bisect/... tests were failing on the Windows platform with the errors shown below:
Errors
Error 1.Error with llvm::seq
no matching function for call to 'seq'
for (auto i : llvm::seq(0ul, sizeof...(T))) {
Solution: change to llvm::seq(0, sizeof...(T))
By explicitly specifying the type (unsigned long) in llvm::seq, the compiler now clearly understands the type of the sequence.
Error 2. Missing dlfcn.h:
Location: xla/mlir/tools/mlir_interpreter/dialects/func.cc
fatal error: 'dlfcn.h' file not found
Solution: include 'windows.h' for Windows platform
Error 3.
Use of Undeclared Identifiers sym and RTLD_DEFAULT:
Location: xla/mlir/tools/mlir_interpreter/dialects/func.cc
use of undeclared identifier 'sym'
sym = dlsym(RTLD_DEFAULT, callee.getSymName().str().c_str());
^
use of undeclared identifier 'RTLD_DEFAULT'
Solution:
On Windows, the approach to obtaining a symbol's address differs from Unix-based systems.
GetModuleHandle function retrieves a handle to the specified module (DLL) that is loaded in the address space of the calling process. This handle is necessary to access the module's symbols.
GetProcAddress function locates the address of an exported function or variable by name.
Copybara import of the project:
--
1a42899 by Raunak [email protected]:
fix xla-mlir failures on windows
--
1500966 by Raunak [email protected]:
resolve comments
--
2483001 by Raunak [email protected]:
Keep the original file
--
4c7fe5e by Raunak [email protected]:
fix the formatting issue
--
270898a by mraunak [email protected]:
Update symbol_finder_windows.cc
6b63a30 by mraunak [email protected]:
Update symbol_finder_linux.cc
f0996fc by mraunak [email protected]:
Update symbol_finder.h
0c0c9bb by Raunak [email protected]:
Fix the build file
--
6d7f269 by Raunak [email protected]:
Resolve the comments
--
ef598af by Raunak [email protected]:
Resolve the comments
--
7131b8d by Raunak [email protected]:
added :find_symbol to dependency
--
64a6e9e by mraunak [email protected]:
Update BUILD
d47a8b2 by mraunak [email protected]:
Fix clang format
1a24df1 by Raunak [email protected]:
resolve the comments
--
12f69fc by Raunak [email protected]:
adding namespace and header style consistent
--
ec9b505 by Raunak [email protected]:
Fix the build file
Merging this change closes #18407
FUTURE_COPYBARA_INTEGRATE_REVIEW=#18407 from Intel-tensorflow:mraunak/xla-mlir ec9b505