Skip to content
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 unnecessary null pointer check in OpenCL command buffer code, and update declaration of filter lamba to avoid copies #17615

Merged
merged 1 commit into from
Mar 27, 2025
Merged
Show file tree
Hide file tree
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
3 changes: 1 addition & 2 deletions unified-runtime/source/adapters/opencl/command_buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferCreateExp(
ur_queue_handle_t Queue = nullptr;
ur_queue_properties_t QueueProperties = {UR_STRUCTURE_TYPE_QUEUE_PROPERTIES,
nullptr, 0};
const bool IsInOrder =
pCommandBufferDesc ? pCommandBufferDesc->isInOrder : false;
const bool IsInOrder = pCommandBufferDesc->isInOrder;
if (!IsInOrder) {
QueueProperties.flags = UR_QUEUE_FLAG_OUT_OF_ORDER_EXEC_MODE_ENABLE;
}
Expand Down
2 changes: 1 addition & 1 deletion unified-runtime/source/common/ur_util.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ inline std::optional<EnvVarMap> getenv_to_map(const char *env_var_name,
if (map.find(key) != map.end()) {
map[key].insert(map[key].end(), values_vec.begin(), values_vec.end());
} else {
map[key] = values_vec;
map[key] = std::move(values_vec);
}
}
return map;
Expand Down
7 changes: 4 additions & 3 deletions unified-runtime/source/loader/ur_adapter_registry.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -277,9 +277,9 @@ class AdapterRegistry {
[](unsigned char c) { return std::tolower(c); });

if (PositiveFilter) {
positiveFilters.push_back({backend, termPair.second});
positiveFilters.push_back({std::move(backend), termPair.second});
} else {
negativeFilters.push_back({backend, termPair.second});
negativeFilters.push_back({std::move(backend), termPair.second});
}
}

Expand All @@ -294,7 +294,8 @@ class AdapterRegistry {
for (const auto &device : manifest.device_types) {
ur_device_tuple single_device = {manifest.backend, device};

auto matchesFilter = [single_device](const FilterTerm &f) -> bool {
const auto matchesFilter =
[single_device](const FilterTerm &f) -> bool {
return f.matches(single_device);
};

Expand Down