Skip to content

Commit b512077

Browse files
authored
[flang][runtime] Another try to fix build failure (llvm#143702)
Tweak accessibility to try to get code past whatever gcc is being used by the flang-runtime-cuda-gcc build bot.
1 parent cc9f674 commit b512077

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

flang-rt/include/flang-rt/runtime/work-queue.h

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ template <typename TICKET> class ImmediateTicketRunner {
9494

9595
// Base class for ticket workers that operate elementwise over descriptors
9696
class Elementwise {
97-
protected:
97+
public:
9898
RT_API_ATTRS Elementwise(
9999
const Descriptor &instance, const Descriptor *from = nullptr)
100100
: instance_{instance}, from_{from} {
@@ -120,6 +120,7 @@ class Elementwise {
120120
}
121121
}
122122

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

130131
// Base class for ticket workers that operate over derived type components.
131132
class Componentwise {
132-
protected:
133+
public:
133134
RT_API_ATTRS Componentwise(const typeInfo::DerivedType &);
134135
RT_API_ATTRS bool IsComplete() const { return componentAt_ >= components_; }
135136
RT_API_ATTRS void Advance() {
@@ -147,6 +148,7 @@ class Componentwise {
147148
}
148149
RT_API_ATTRS void GetComponent();
149150

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

156158
// Base class for ticket workers that operate over derived type components
157159
// in an outer loop, and elements in an inner loop.
158-
class ComponentsOverElements : protected Componentwise, protected Elementwise {
159-
protected:
160+
class ComponentsOverElements : public Componentwise, public Elementwise {
161+
public:
160162
RT_API_ATTRS ComponentsOverElements(const Descriptor &instance,
161163
const typeInfo::DerivedType &derived, const Descriptor *from = nullptr)
162164
: Componentwise{derived}, Elementwise{instance, from} {
@@ -187,13 +189,14 @@ class ComponentsOverElements : protected Componentwise, protected Elementwise {
187189
Componentwise::Reset();
188190
}
189191

192+
protected:
190193
int phase_{0};
191194
};
192195

193196
// Base class for ticket workers that operate over elements in an outer loop,
194197
// type components in an inner loop.
195-
class ElementsOverComponents : protected Elementwise, protected Componentwise {
196-
protected:
198+
class ElementsOverComponents : public Elementwise, public Componentwise {
199+
public:
197200
RT_API_ATTRS ElementsOverComponents(const Descriptor &instance,
198201
const typeInfo::DerivedType &derived, const Descriptor *from = nullptr)
199202
: Elementwise{instance, from}, Componentwise{derived} {
@@ -219,6 +222,7 @@ class ElementsOverComponents : protected Elementwise, protected Componentwise {
219222
Elementwise::Advance();
220223
}
221224

225+
protected:
222226
int phase_{0};
223227
};
224228

@@ -319,7 +323,7 @@ class AssignTicket : public ImmediateTicketRunner<AssignTicket> {
319323
template <bool IS_COMPONENTWISE>
320324
class DerivedAssignTicket
321325
: public ImmediateTicketRunner<DerivedAssignTicket<IS_COMPONENTWISE>>,
322-
protected std::conditional_t<IS_COMPONENTWISE, ComponentsOverElements,
326+
private std::conditional_t<IS_COMPONENTWISE, ComponentsOverElements,
323327
ElementsOverComponents> {
324328
public:
325329
using Base = std::conditional_t<IS_COMPONENTWISE, ComponentsOverElements,
@@ -348,7 +352,7 @@ namespace io::descr {
348352
template <io::Direction DIR>
349353
class DescriptorIoTicket
350354
: public ImmediateTicketRunner<DescriptorIoTicket<DIR>>,
351-
protected Elementwise {
355+
private Elementwise {
352356
public:
353357
RT_API_ATTRS DescriptorIoTicket(io::IoStatementState &io,
354358
const Descriptor &descriptor, const io::NonTbpDefinedIoTable *table,
@@ -372,7 +376,7 @@ class DescriptorIoTicket
372376

373377
template <io::Direction DIR>
374378
class DerivedIoTicket : public ImmediateTicketRunner<DerivedIoTicket<DIR>>,
375-
protected ElementsOverComponents {
379+
private ElementsOverComponents {
376380
public:
377381
RT_API_ATTRS DerivedIoTicket(io::IoStatementState &io,
378382
const Descriptor &descriptor, const typeInfo::DerivedType &derived,

0 commit comments

Comments
 (0)