[Flang][FlangRT][Runtime] Add RT_OFFLOAD_API_GROUP_BEGIN to missing symbols on AMDGPU (#147612)
After the recent move to work queues, in certain cases when linking in the fortran runtime built for offload on AMDGPU as required in certain cases, we'll get missing symbols when linking. This PR tries to address this issue by encompassing more of the library in RT_OFFLOAD_API_GROUP_BEGIN, which has the affect of compiling these functions for AMDGPU, resolving the missing symbols. This PR should address the following issue: https://github.com/llvm/llvm-project/issues/145888
This commit is contained in:
parent
59a99c6f2c
commit
75f81ded8f
@ -25,6 +25,8 @@ class Descriptor;
|
||||
|
||||
namespace Fortran::runtime::io {
|
||||
|
||||
RT_OFFLOAD_API_GROUP_BEGIN
|
||||
|
||||
class IoStatementState;
|
||||
|
||||
enum EditingFlags {
|
||||
@ -200,5 +202,8 @@ private:
|
||||
// must be last, may be incomplete
|
||||
Iteration stack_[maxMaxHeight];
|
||||
};
|
||||
|
||||
RT_OFFLOAD_API_GROUP_END
|
||||
|
||||
} // namespace Fortran::runtime::io
|
||||
#endif // FLANG_RT_RUNTIME_FORMAT_H_
|
||||
|
@ -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.
|
||||
@ -55,5 +57,8 @@ private:
|
||||
|
||||
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_
|
||||
|
@ -28,6 +28,8 @@
|
||||
|
||||
namespace Fortran::runtime::io {
|
||||
|
||||
RT_OFFLOAD_API_GROUP_BEGIN
|
||||
|
||||
class ExternalFileUnit;
|
||||
class ChildIo;
|
||||
|
||||
@ -880,5 +882,7 @@ private:
|
||||
ExternalFileUnit *unit_{nullptr};
|
||||
};
|
||||
|
||||
RT_OFFLOAD_API_GROUP_END
|
||||
|
||||
} // namespace Fortran::runtime::io
|
||||
#endif // FLANG_RT_RUNTIME_IO_STMT_H_
|
||||
|
@ -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
|
||||
@ -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_
|
||||
|
@ -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 {
|
||||
@ -361,6 +363,7 @@ public:
|
||||
: 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_; }
|
||||
@ -551,5 +554,7 @@ private:
|
||||
TicketList *firstFree_{static_};
|
||||
};
|
||||
|
||||
RT_OFFLOAD_API_GROUP_END
|
||||
|
||||
} // namespace Fortran::runtime
|
||||
#endif // FLANG_RT_RUNTIME_WORK_QUEUE_H_
|
||||
|
@ -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);
|
||||
|
||||
@ -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_
|
||||
|
@ -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
|
||||
@ -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_
|
||||
|
@ -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
|
||||
@ -298,5 +300,7 @@ private:
|
||||
Fortran::common::optional<IoStatementState> io_;
|
||||
};
|
||||
|
||||
RT_OFFLOAD_API_GROUP_END
|
||||
|
||||
} // namespace Fortran::runtime::io
|
||||
#endif // FLANG_RT_RUNTIME_UNIT_H_
|
||||
|
@ -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,
|
||||
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user