-
Notifications
You must be signed in to change notification settings - Fork 798
[SYCL] Fix warnings in source/detail code #16334
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
Changes from all commits
35969a0
fed7229
56de460
19983fe
637ad26
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -76,7 +76,7 @@ static ur_program_handle_t | |
| createBinaryProgram(const ContextImplPtr Context, | ||
| const std::vector<device> &Devices, | ||
| const uint8_t **Binaries, size_t *Lengths, | ||
| const std::vector<ur_program_metadata_t> Metadata) { | ||
| const std::vector<ur_program_metadata_t> &Metadata) { | ||
| const AdapterPtr &Adapter = Context->getAdapter(); | ||
| ur_program_handle_t Program; | ||
| std::vector<ur_device_handle_t> DeviceHandles; | ||
|
|
@@ -230,7 +230,7 @@ ProgramManager::createURProgram(const RTDeviceBinaryImage &Img, | |
| "SPIR-V online compilation is not supported in this context"); | ||
|
|
||
| // Get program metadata from properties | ||
| auto ProgMetadata = Img.getProgramMetadataUR(); | ||
| const auto &ProgMetadata = Img.getProgramMetadataUR(); | ||
|
|
||
| // Load the image | ||
| const ContextImplPtr Ctx = getSyclObjImpl(Context); | ||
|
|
@@ -990,7 +990,15 @@ ur_program_handle_t ProgramManager::getBuiltURProgram( | |
| // emplace all subsets of the current set of devices into the cache. | ||
| // Set of all devices is not included in the loop as it was already added | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this comment ("Set of all devices is not included...") needs to be moved to the line 832, if I understand the logic correctly.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed 19983fe |
||
| // into the cache. | ||
| for (int Mask = 1; Mask < (1 << URDevicesSet.size()) - 1; ++Mask) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This code is much more maintainable than the new one. Also, if the problem is the "overflow" here, then it's inherent part of the problem. We'll have that many entries in the resulting set anyway (and likely OOM regardless).
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. discussed in person, fixed in 19983fe |
||
| int Mask = 1; | ||
| if (URDevicesSet.size() > sizeof(Mask) * 8 - 1) { | ||
| // Protection for the algorithm below. Although overflow is very unlikely | ||
| // to be reached. | ||
AlexeySachkov marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| throw sycl::exception( | ||
| make_error_code(errc::runtime), | ||
| "Unable to cache built program for more than 31 devices"); | ||
| } | ||
| for (; Mask < (1 << URDevicesSet.size()) - 1; ++Mask) { | ||
| std::set<ur_device_handle_t> Subset; | ||
| int Index = 0; | ||
| for (auto It = URDevicesSet.begin(); It != URDevicesSet.end(); | ||
|
|
@@ -1124,7 +1132,7 @@ ProgramManager::getUrProgramFromUrKernel(ur_kernel_handle_t Kernel, | |
|
|
||
| std::string | ||
| ProgramManager::getProgramBuildLog(const ur_program_handle_t &Program, | ||
| const ContextImplPtr Context) { | ||
| const ContextImplPtr &Context) { | ||
| size_t URDevicesSize = 0; | ||
| const AdapterPtr &Adapter = Context->getAdapter(); | ||
| Adapter->call<UrApiKind::urProgramGetInfo>(Program, UR_PROGRAM_INFO_DEVICES, | ||
|
|
||
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.
nit: I think more idiomatic fix would be to use
std::string_view.Uh oh!
There was an error while loading. Please reload this page.
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.
I am eliminating extra copy here, no intention to change types.