Skip to content

[flang][runtime] Another try to fix build failure #143702

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

Merged
merged 1 commit into from
Jun 11, 2025
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
22 changes: 13 additions & 9 deletions flang-rt/include/flang-rt/runtime/work-queue.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ template <typename TICKET> class ImmediateTicketRunner {

// Base class for ticket workers that operate elementwise over descriptors
class Elementwise {
protected:
public:
RT_API_ATTRS Elementwise(
const Descriptor &instance, const Descriptor *from = nullptr)
: instance_{instance}, from_{from} {
Expand All @@ -120,6 +120,7 @@ class Elementwise {
}
}

protected:
const Descriptor &instance_, *from_{nullptr};
std::size_t elements_{instance_.Elements()};
std::size_t elementAt_{0};
Expand All @@ -129,7 +130,7 @@ class Elementwise {

// Base class for ticket workers that operate over derived type components.
class Componentwise {
protected:
public:
RT_API_ATTRS Componentwise(const typeInfo::DerivedType &);
RT_API_ATTRS bool IsComplete() const { return componentAt_ >= components_; }
RT_API_ATTRS void Advance() {
Expand All @@ -147,6 +148,7 @@ class Componentwise {
}
RT_API_ATTRS void GetComponent();

protected:
const typeInfo::DerivedType &derived_;
std::size_t components_{0}, componentAt_{0};
const typeInfo::Component *component_{nullptr};
Expand All @@ -155,8 +157,8 @@ class Componentwise {

// Base class for ticket workers that operate over derived type components
// in an outer loop, and elements in an inner loop.
class ComponentsOverElements : protected Componentwise, protected Elementwise {
protected:
class ComponentsOverElements : public Componentwise, public Elementwise {
public:
RT_API_ATTRS ComponentsOverElements(const Descriptor &instance,
const typeInfo::DerivedType &derived, const Descriptor *from = nullptr)
: Componentwise{derived}, Elementwise{instance, from} {
Expand Down Expand Up @@ -187,13 +189,14 @@ class ComponentsOverElements : protected Componentwise, protected Elementwise {
Componentwise::Reset();
}

protected:
int phase_{0};
};

// Base class for ticket workers that operate over elements in an outer loop,
// type components in an inner loop.
class ElementsOverComponents : protected Elementwise, protected Componentwise {
protected:
class ElementsOverComponents : public Elementwise, public Componentwise {
public:
RT_API_ATTRS ElementsOverComponents(const Descriptor &instance,
const typeInfo::DerivedType &derived, const Descriptor *from = nullptr)
: Elementwise{instance, from}, Componentwise{derived} {
Expand All @@ -219,6 +222,7 @@ class ElementsOverComponents : protected Elementwise, protected Componentwise {
Elementwise::Advance();
}

protected:
int phase_{0};
};

Expand Down Expand Up @@ -319,7 +323,7 @@ class AssignTicket : public ImmediateTicketRunner<AssignTicket> {
template <bool IS_COMPONENTWISE>
class DerivedAssignTicket
: public ImmediateTicketRunner<DerivedAssignTicket<IS_COMPONENTWISE>>,
protected std::conditional_t<IS_COMPONENTWISE, ComponentsOverElements,
private std::conditional_t<IS_COMPONENTWISE, ComponentsOverElements,
ElementsOverComponents> {
public:
using Base = std::conditional_t<IS_COMPONENTWISE, ComponentsOverElements,
Expand Down Expand Up @@ -348,7 +352,7 @@ namespace io::descr {
template <io::Direction DIR>
class DescriptorIoTicket
: public ImmediateTicketRunner<DescriptorIoTicket<DIR>>,
protected Elementwise {
private Elementwise {
public:
RT_API_ATTRS DescriptorIoTicket(io::IoStatementState &io,
const Descriptor &descriptor, const io::NonTbpDefinedIoTable *table,
Expand All @@ -372,7 +376,7 @@ class DescriptorIoTicket

template <io::Direction DIR>
class DerivedIoTicket : public ImmediateTicketRunner<DerivedIoTicket<DIR>>,
protected ElementsOverComponents {
private ElementsOverComponents {
public:
RT_API_ATTRS DerivedIoTicket(io::IoStatementState &io,
const Descriptor &descriptor, const typeInfo::DerivedType &derived,
Expand Down
Loading