Skip to content

[Flang][FlangRT][Runtime] Add RT_OFFLOAD_API_GROUP_BEGIN to missing symbols on AMDGPU #147612

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
Jul 10, 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
5 changes: 5 additions & 0 deletions flang-rt/include/flang-rt/runtime/format.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ class Descriptor;

namespace Fortran::runtime::io {

RT_OFFLOAD_API_GROUP_BEGIN

class IoStatementState;

enum EditingFlags {
Expand Down Expand Up @@ -200,5 +202,8 @@ template <typename CONTEXT> class FormatControl {
// must be last, may be incomplete
Iteration stack_[maxMaxHeight];
};

RT_OFFLOAD_API_GROUP_END

} // namespace Fortran::runtime::io
#endif // FLANG_RT_RUNTIME_FORMAT_H_
5 changes: 5 additions & 0 deletions flang-rt/include/flang-rt/runtime/internal-unit.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

namespace Fortran::runtime::io {

RT_OFFLOAD_API_GROUP_BEGIN

class IoErrorHandler;

// Points to (but does not own) a CHARACTER scalar or array for internal I/O.
Expand Down Expand Up @@ -55,5 +57,8 @@ template <Direction DIR> class InternalDescriptorUnit : public ConnectionState {

extern template class InternalDescriptorUnit<Direction::Output>;
extern template class InternalDescriptorUnit<Direction::Input>;

RT_OFFLOAD_API_GROUP_END

} // namespace Fortran::runtime::io
#endif // FLANG_RT_RUNTIME_INTERNAL_UNIT_H_
4 changes: 4 additions & 0 deletions flang-rt/include/flang-rt/runtime/io-stmt.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@

namespace Fortran::runtime::io {

RT_OFFLOAD_API_GROUP_BEGIN

class ExternalFileUnit;
class ChildIo;

Expand Down Expand Up @@ -880,5 +882,7 @@ class ErroneousIoStatementState : public IoStatementBase {
ExternalFileUnit *unit_{nullptr};
};

RT_OFFLOAD_API_GROUP_END

} // namespace Fortran::runtime::io
#endif // FLANG_RT_RUNTIME_IO_STMT_H_
4 changes: 4 additions & 0 deletions flang-rt/include/flang-rt/runtime/non-tbp-dio.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ class DerivedType;

namespace Fortran::runtime::io {

RT_OFFLOAD_API_GROUP_BEGIN

struct NonTbpDefinedIo {
const typeInfo::DerivedType &derivedType;
void (*subroutine)(); // null means no non-TBP defined I/O here
Expand All @@ -52,5 +54,7 @@ struct NonTbpDefinedIoTable {
bool ignoreNonTbpEntries{false};
};

RT_OFFLOAD_API_GROUP_END

} // namespace Fortran::runtime::io
#endif // FLANG_RT_RUNTIME_NON_TBP_DIO_H_
5 changes: 5 additions & 0 deletions flang-rt/include/flang-rt/runtime/work-queue.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ namespace Fortran::runtime {
class Terminator;
class WorkQueue;

RT_OFFLOAD_API_GROUP_BEGIN

// Ticket worker base classes

template <typename TICKET> class ImmediateTicketRunner {
Expand Down Expand Up @@ -361,6 +363,7 @@ class DescriptorIoTicket
: ImmediateTicketRunner<DescriptorIoTicket>(*this),
Elementwise{descriptor}, io_{io}, table_{table},
anyIoTookPlace_{anyIoTookPlace} {}

RT_API_ATTRS int Begin(WorkQueue &);
RT_API_ATTRS int Continue(WorkQueue &);
RT_API_ATTRS bool &anyIoTookPlace() { return anyIoTookPlace_; }
Expand Down Expand Up @@ -551,5 +554,7 @@ class WorkQueue {
TicketList *firstFree_{static_};
};

RT_OFFLOAD_API_GROUP_END

} // namespace Fortran::runtime
#endif // FLANG_RT_RUNTIME_WORK_QUEUE_H_
4 changes: 4 additions & 0 deletions flang-rt/lib/runtime/edit-input.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

namespace Fortran::runtime::io {

RT_OFFLOAD_API_GROUP_BEGIN

RT_API_ATTRS bool EditIntegerInput(
IoStatementState &, const DataEdit &, void *, int kind, bool isSigned);

Expand Down Expand Up @@ -49,5 +51,7 @@ extern template RT_API_ATTRS bool EditCharacterInput(
extern template RT_API_ATTRS bool EditCharacterInput(
IoStatementState &, const DataEdit &, char32_t *, std::size_t);

RT_OFFLOAD_API_GROUP_END

} // namespace Fortran::runtime::io
#endif // FLANG_RT_RUNTIME_EDIT_INPUT_H_
4 changes: 4 additions & 0 deletions flang-rt/lib/runtime/edit-output.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@

namespace Fortran::runtime::io {

RT_OFFLOAD_API_GROUP_BEGIN

// I, B, O, Z, and G output editing for INTEGER.
// The DataEdit reference is const here (and elsewhere in this header) so that
// one edit descriptor with a repeat factor may safely serve to edit
Expand Down Expand Up @@ -137,5 +139,7 @@ extern template class RealOutputEditing<10>;
// TODO: double/double
extern template class RealOutputEditing<16>;

RT_OFFLOAD_API_GROUP_END

} // namespace Fortran::runtime::io
#endif // FLANG_RT_RUNTIME_EDIT_OUTPUT_H_
4 changes: 4 additions & 0 deletions flang-rt/lib/runtime/unit.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ extern RT_VAR_ATTRS ExternalFileUnit *defaultOutput; // unit 6
extern RT_VAR_ATTRS ExternalFileUnit *errorOutput; // unit 0 extension
RT_OFFLOAD_VAR_GROUP_END

RT_OFFLOAD_API_GROUP_BEGIN

#if defined(RT_USE_PSEUDO_FILE_UNIT)
// A flavor of OpenFile class that pretends to be a terminal,
// and only provides basic buffering of the output
Expand Down Expand Up @@ -298,5 +300,7 @@ class ChildIo {
Fortran::common::optional<IoStatementState> io_;
};

RT_OFFLOAD_API_GROUP_END

} // namespace Fortran::runtime::io
#endif // FLANG_RT_RUNTIME_UNIT_H_
6 changes: 6 additions & 0 deletions flang/include/flang/Decimal/decimal.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ enum DecimalConversionFlags {
#define EXTRA_DECIMAL_CONVERSION_SPACE (1 + 1 + 2 * 16 - 1)

#ifdef __cplusplus

RT_OFFLOAD_API_GROUP_BEGIN

template <int PREC>
RT_API_ATTRS ConversionToDecimalResult ConvertToDecimal(char *, size_t,
DecimalConversionFlags, int digits, enum FortranRounding rounding,
Expand Down Expand Up @@ -110,6 +113,9 @@ extern template RT_API_ATTRS ConversionToBinaryResult<64> ConvertToBinary<64>(
const char *&, enum FortranRounding, const char *end);
extern template RT_API_ATTRS ConversionToBinaryResult<113> ConvertToBinary<113>(
const char *&, enum FortranRounding, const char *end);

RT_OFFLOAD_API_GROUP_END

} // namespace Fortran::decimal
extern "C" {
#define NS(x) Fortran::decimal::x
Expand Down