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

[libshortfin] Build fixes for gcc 12.3.0 and 13.2.0. #221

Merged
merged 3 commits into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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: 2 additions & 1 deletion libshortfin/src/shortfin/local/messaging.h
Original file line number Diff line number Diff line change
Expand Up @@ -189,10 +189,11 @@ class SHORTFIN_API Queue : public std::enable_shared_from_this<Queue> {
void Close();

protected:
Queue(Options options);

private:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we want to keep this constructor private, we could also rework the anonymous namespace used for QueueCreator, which is already tagged friend struct QueueCreator.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found a different fix: https://stackoverflow.com/a/63398702

Apparently friend struct QueueCreator was an "elaborated type specifier", and that is not needed here since the name is not ambiguous. gcc is happier with just friend QueueCreator.

// Queues can only be created as shared by the System.
static QueuePtr Create(Options options);
Queue(Options options);
mutable iree::slim_mutex lock_;
Options options_;
// Backlog of messages not yet sent to a reader. Messages are pushed on the
Expand Down
4 changes: 2 additions & 2 deletions libshortfin/src/shortfin/local/systems/host.cc
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ HostCPUSystemBuilder::SelectHostCPUNodesFromOptions() {
} else if (*topology_nodes == "all") {
// If topology_nodes == "all", create a mask of all available nodes.
nodes.reserve(available_node_count);
for (auto i = 0; i < available_node_count; ++i) {
for (iree_host_size_t i = 0; i < available_node_count; ++i) {
nodes.push_back(i);
}
} else {
Expand All @@ -110,7 +110,7 @@ HostCPUSystemBuilder::SelectHostCPUNodesFromOptions() {
config_options().GetIntList("hostcpu_topology_nodes");
assert(topology_node_ids);
for (int64_t node_id : *topology_node_ids) {
if (node_id < 0 || node_id >= available_node_count) {
if (node_id < 0 || (iree_host_size_t)node_id >= available_node_count) {
throw std::invalid_argument(fmt::format(
"Illegal value {} in hostcpu_topology_nodes: Expected [0..{}]",
node_id, available_node_count - 1));
Expand Down
Loading