-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
port class 'dynamic_loader' to Windows #2278
Conversation
src/CMakeLists.txt
Outdated
@@ -104,6 +103,11 @@ add_library(migraphx | |||
value.cpp | |||
verify_args.cpp | |||
) | |||
if(WIN32) | |||
target_sources(migraphx PRIVATE dynamic_loader_win32.cpp) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Put this in the same file.
Codecov Report
@@ Coverage Diff @@
## develop #2278 +/- ##
========================================
Coverage 91.45% 91.45%
========================================
Files 433 433
Lines 16174 16174
========================================
Hits 14792 14792
Misses 1382 1382
|
src/dynamic_loader_win32.cpp
Outdated
std::to_string(GetLastError()) + ")"); | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to add a move constructor and delete the copy constructor, and add an assignment operator.
src/dynamic_loader_win32.cpp
Outdated
} | ||
|
||
HMODULE handle = nullptr; | ||
std::shared_ptr<tmp_dir> temp = nullptr; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the class is not copyable, then there is no reason to use shared_ptr
here.
@@ -46,6 +47,7 @@ struct MIGRAPHX_EXPORT dynamic_loader | |||
static fs::path path(void* address); | |||
|
|||
static optional<dynamic_loader> try_load(const fs::path& p); | |||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this disabled on windows?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For some reason, on Windows, static analysis is showing the catch
part of the function is unreachable code. I made it available on Windows because it looks like a false-positive case.
This build is OK for merge ✅ |
🔴bert_base_cased_fp16: FAILED: MIGraphX is not within tolerance - check verbose output🔴bert_large_uncased_fp16: FAILED: MIGraphX is not within tolerance - check verbose output🔴distilgpt2_fp16: FAILED: MIGraphX is not within tolerance - check verbose output |
std::to_string(GetLastError()) + ")"); | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sure to delete the copy constructor and add a an assignment operator.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a cpp check failure that needs to be addressed
No description provided.