-
Notifications
You must be signed in to change notification settings - Fork 124
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
[ur] Remove null adapter default load #261
Conversation
d1b6bbd
to
af59031
Compare
3fdebfb
to
b23004b
Compare
b23004b
to
2ec1153
Compare
static const char *knownAdaptersNames[] = { | ||
MAKE_LIBRARY_NAME("ur_null", UR_VERSION), | ||
}; | ||
|
||
std::vector<PlatformLibraryPath> discoverEnabledPlatforms() { | ||
std::vector<PlatformLibraryPath> enabledPlatforms; | ||
|
||
// UR_ADAPTERS_FORCE_LOAD is for development/debug only | ||
char *altPlatforms = nullptr; | ||
_dupenv_s(&altPlatforms, NULL, "UR_ADAPTERS_FORCE_LOAD"); | ||
|
||
if (altPlatforms == nullptr) { | ||
for (auto libName : knownAdaptersNames) { | ||
enabledPlatforms.emplace_back(libName); | ||
} | ||
} else { |
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.
Unfortunately I had to remove knownAdaptersNames
from the windows build as the MSVC compiler is quite picky about zero-length arrays. Perhaps I should remove from linux equivalent too?
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 could use std::array. zero-length std:array is well defined so Windows should not complain. But if we don't have any adapters yet removing it will work as well I guess.
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.
Yea, I wouldn't worry about removing this if you need to - this code needs to be refactored anyway.
URT PR: oneapi-src/unified-runtime#261 Signed-off-by: Zhang, Winston <[email protected]>
No description provided.