Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,16 @@ static std::unique_ptr<void, std::function<void(void *)>>
void loadOclocLibrary(const std::vector<uint32_t> &IPVersionVec) {
#ifdef __SYCL_RT_OS_WINDOWS
// first the environment, if not compatible will move on to absolute path.
static const std::vector<std::string> OclocPaths = {
static const std::vector<std::string_view> OclocPaths = {
"ocloc64.dll",
"C:\\Program Files (x86)\\Intel\\oneAPI\\ocloc\\latest\\ocloc64.dll"};
#else
static const std::vector<std::string> OclocPaths = {"libocloc.so"};
static const std::vector<std::string_view> OclocPaths = {"libocloc.so"};
#endif

// attemptLoad() sets OclocLibrary value by side effect.
auto attemptLoad = [&](std::string OclocPath) {
auto attemptLoad = [&](std::string_view OclocPath_sv) {
std::string OclocPath(OclocPath_sv);
try {
// Load then perform checks. Each check throws.
void *tempPtr = sycl::detail::ur::loadOsLibrary(OclocPath);
Expand All @@ -98,7 +99,7 @@ void loadOclocLibrary(const std::vector<uint32_t> &IPVersionVec) {
}
return true;
};
for (auto result : OclocPaths) {
for (const std::string_view result : OclocPaths) {
if (attemptLoad(result))
return; // exit on successful attempt
}
Expand Down