From f8fc883da951064a310e365680b4b567fad58ebc Mon Sep 17 00:00:00 2001 From: Peter Klausler <35819229+klausler@users.noreply.github.com> Date: Thu, 13 Jun 2024 11:10:32 -0700 Subject: [flang][runtime] Distinguish VALUE from non-VALUE operations in REDUCE (#95297) Accommodate operations with VALUE dummy arguments in the runtime support for the REDUCE intrinsic function by splitting most entry points into Reduce...Ref and Reduce...Value variants. Further work will be needed in lowering to call the ...Value entry points. --- .../flang/Optimizer/Builder/Runtime/RTBuilder.h | 24 +- flang/include/flang/Runtime/reduce.h | 425 +++++++++++++++------ 2 files changed, 315 insertions(+), 134 deletions(-) (limited to 'flang/include') diff --git a/flang/include/flang/Optimizer/Builder/Runtime/RTBuilder.h b/flang/include/flang/Optimizer/Builder/Runtime/RTBuilder.h index 99161c5..809d5b8 100644 --- a/flang/include/flang/Optimizer/Builder/Runtime/RTBuilder.h +++ b/flang/include/flang/Optimizer/Builder/Runtime/RTBuilder.h @@ -53,10 +53,10 @@ namespace fir::runtime { using TypeBuilderFunc = mlir::Type (*)(mlir::MLIRContext *); using FuncTypeBuilderFunc = mlir::FunctionType (*)(mlir::MLIRContext *); -#define REDUCTION_OPERATION_MODEL(T) \ +#define REDUCTION_REF_OPERATION_MODEL(T) \ template <> \ constexpr TypeBuilderFunc \ - getModel>() { \ + getModel>() { \ return [](mlir::MLIRContext *context) -> mlir::Type { \ TypeBuilderFunc f{getModel()}; \ auto refTy = fir::ReferenceType::get(f(context)); \ @@ -480,18 +480,18 @@ constexpr TypeBuilderFunc getModel() { }; } -REDUCTION_OPERATION_MODEL(std::int8_t) -REDUCTION_OPERATION_MODEL(std::int16_t) -REDUCTION_OPERATION_MODEL(std::int32_t) -REDUCTION_OPERATION_MODEL(std::int64_t) -REDUCTION_OPERATION_MODEL(Fortran::common::int128_t) +REDUCTION_REF_OPERATION_MODEL(std::int8_t) +REDUCTION_REF_OPERATION_MODEL(std::int16_t) +REDUCTION_REF_OPERATION_MODEL(std::int32_t) +REDUCTION_REF_OPERATION_MODEL(std::int64_t) +REDUCTION_REF_OPERATION_MODEL(Fortran::common::int128_t) -REDUCTION_OPERATION_MODEL(float) -REDUCTION_OPERATION_MODEL(double) -REDUCTION_OPERATION_MODEL(long double) +REDUCTION_REF_OPERATION_MODEL(float) +REDUCTION_REF_OPERATION_MODEL(double) +REDUCTION_REF_OPERATION_MODEL(long double) -REDUCTION_OPERATION_MODEL(std::complex) -REDUCTION_OPERATION_MODEL(std::complex) +REDUCTION_REF_OPERATION_MODEL(std::complex) +REDUCTION_REF_OPERATION_MODEL(std::complex) REDUCTION_CHAR_OPERATION_MODEL(char) REDUCTION_CHAR_OPERATION_MODEL(char16_t) diff --git a/flang/include/flang/Runtime/reduce.h b/flang/include/flang/Runtime/reduce.h index 975aa6dea..60f54c3 100644 --- a/flang/include/flang/Runtime/reduce.h +++ b/flang/include/flang/Runtime/reduce.h @@ -28,7 +28,9 @@ namespace Fortran::runtime { class Descriptor; -template using ReductionOperation = T (*)(const T *, const T *); +template +using ReferenceReductionOperation = T (*)(const T *, const T *); +template using ValueReductionOperation = T (*)(T, T); template using ReductionCharOperation = void (*)(CHAR *hiddenResult, std::size_t resultLen, const CHAR *x, const CHAR *y, std::size_t xLen, @@ -38,185 +40,364 @@ using ReductionDerivedTypeOperation = void (*)( extern "C" { -std::int8_t RTDECL(ReduceInteger1)(const Descriptor &, - ReductionOperation, const char *source, int line, int dim = 0, - const Descriptor *mask = nullptr, const std::int8_t *identity = nullptr, - bool ordered = true); -void RTDECL(ReduceInteger1Dim)(Descriptor &result, const Descriptor &array, - ReductionOperation, const char *source, int line, int dim, +std::int8_t RTDECL(ReduceInteger1Ref)(const Descriptor &, + ReferenceReductionOperation, const char *source, int line, + int dim = 0, const Descriptor *mask = nullptr, + const std::int8_t *identity = nullptr, bool ordered = true); +std::int8_t RTDECL(ReduceInteger1Value)(const Descriptor &, + ValueReductionOperation, const char *source, int line, + int dim = 0, const Descriptor *mask = nullptr, + const std::int8_t *identity = nullptr, bool ordered = true); +void RTDECL(ReduceInteger1DimRef)(Descriptor &result, const Descriptor &array, + ReferenceReductionOperation, const char *source, int line, + int dim, const Descriptor *mask = nullptr, + const std::int8_t *identity = nullptr, bool ordered = true); +void RTDECL(ReduceInteger1DimValue)(Descriptor &result, const Descriptor &array, + ValueReductionOperation, const char *source, int line, int dim, const Descriptor *mask = nullptr, const std::int8_t *identity = nullptr, bool ordered = true); -std::int16_t RTDECL(ReduceInteger2)(const Descriptor &, - ReductionOperation, const char *source, int line, int dim = 0, - const Descriptor *mask = nullptr, const std::int16_t *identity = nullptr, - bool ordered = true); -void RTDECL(ReduceInteger2Dim)(Descriptor &result, const Descriptor &array, - ReductionOperation, const char *source, int line, int dim, - const Descriptor *mask = nullptr, const std::int16_t *identity = nullptr, - bool ordered = true); -std::int32_t RTDECL(ReduceInteger4)(const Descriptor &, - ReductionOperation, const char *source, int line, int dim = 0, - const Descriptor *mask = nullptr, const std::int32_t *identity = nullptr, - bool ordered = true); -void RTDECL(ReduceInteger4Dim)(Descriptor &result, const Descriptor &array, - ReductionOperation, const char *source, int line, int dim, - const Descriptor *mask = nullptr, const std::int32_t *identity = nullptr, - bool ordered = true); -std::int64_t RTDECL(ReduceInteger8)(const Descriptor &, - ReductionOperation, const char *source, int line, int dim = 0, - const Descriptor *mask = nullptr, const std::int64_t *identity = nullptr, - bool ordered = true); -void RTDECL(ReduceInteger8Dim)(Descriptor &result, const Descriptor &array, - ReductionOperation, const char *source, int line, int dim, - const Descriptor *mask = nullptr, const std::int64_t *identity = nullptr, - bool ordered = true); +std::int16_t RTDECL(ReduceInteger2Ref)(const Descriptor &, + ReferenceReductionOperation, const char *source, int line, + int dim = 0, const Descriptor *mask = nullptr, + const std::int16_t *identity = nullptr, bool ordered = true); +std::int16_t RTDECL(ReduceInteger2Value)(const Descriptor &, + ValueReductionOperation, const char *source, int line, + int dim = 0, const Descriptor *mask = nullptr, + const std::int16_t *identity = nullptr, bool ordered = true); +void RTDECL(ReduceInteger2DimRef)(Descriptor &result, const Descriptor &array, + ReferenceReductionOperation, const char *source, int line, + int dim, const Descriptor *mask = nullptr, + const std::int16_t *identity = nullptr, bool ordered = true); +void RTDECL(ReduceInteger2DimValue)(Descriptor &result, const Descriptor &array, + ValueReductionOperation, const char *source, int line, + int dim, const Descriptor *mask = nullptr, + const std::int16_t *identity = nullptr, bool ordered = true); +std::int32_t RTDECL(ReduceInteger4Ref)(const Descriptor &, + ReferenceReductionOperation, const char *source, int line, + int dim = 0, const Descriptor *mask = nullptr, + const std::int32_t *identity = nullptr, bool ordered = true); +std::int32_t RTDECL(ReduceInteger4Value)(const Descriptor &, + ValueReductionOperation, const char *source, int line, + int dim = 0, const Descriptor *mask = nullptr, + const std::int32_t *identity = nullptr, bool ordered = true); +void RTDECL(ReduceInteger4DimRef)(Descriptor &result, const Descriptor &array, + ReferenceReductionOperation, const char *source, int line, + int dim, const Descriptor *mask = nullptr, + const std::int32_t *identity = nullptr, bool ordered = true); +void RTDECL(ReduceInteger4DimValue)(Descriptor &result, const Descriptor &array, + ValueReductionOperation, const char *source, int line, + int dim, const Descriptor *mask = nullptr, + const std::int32_t *identity = nullptr, bool ordered = true); +std::int64_t RTDECL(ReduceInteger8Ref)(const Descriptor &, + ReferenceReductionOperation, const char *source, int line, + int dim = 0, const Descriptor *mask = nullptr, + const std::int64_t *identity = nullptr, bool ordered = true); +std::int64_t RTDECL(ReduceInteger8Value)(const Descriptor &, + ValueReductionOperation, const char *source, int line, + int dim = 0, const Descriptor *mask = nullptr, + const std::int64_t *identity = nullptr, bool ordered = true); +void RTDECL(ReduceInteger8DimRef)(Descriptor &result, const Descriptor &array, + ReferenceReductionOperation, const char *source, int line, + int dim, const Descriptor *mask = nullptr, + const std::int64_t *identity = nullptr, bool ordered = true); +void RTDECL(ReduceInteger8DimValue)(Descriptor &result, const Descriptor &array, + ValueReductionOperation, const char *source, int line, + int dim, const Descriptor *mask = nullptr, + const std::int64_t *identity = nullptr, bool ordered = true); #ifdef __SIZEOF_INT128__ -common::int128_t RTDECL(ReduceInteger16)(const Descriptor &, - ReductionOperation, const char *source, int line, +common::int128_t RTDECL(ReduceInteger16Ref)(const Descriptor &, + ReferenceReductionOperation, const char *source, int line, int dim = 0, const Descriptor *mask = nullptr, const common::int128_t *identity = nullptr, bool ordered = true); -void RTDECL(ReduceInteger16Dim)(Descriptor &result, const Descriptor &array, - ReductionOperation, const char *source, int line, int dim, - const Descriptor *mask = nullptr, +common::int128_t RTDECL(ReduceInteger16Value)(const Descriptor &, + ValueReductionOperation, const char *source, int line, + int dim = 0, const Descriptor *mask = nullptr, + const common::int128_t *identity = nullptr, bool ordered = true); +void RTDECL(ReduceInteger16DimRef)(Descriptor &result, const Descriptor &array, + ReferenceReductionOperation, const char *source, int line, + int dim, const Descriptor *mask = nullptr, + const common::int128_t *identity = nullptr, bool ordered = true); +void RTDECL(ReduceInteger16DimValue)(Descriptor &result, + const Descriptor &array, ValueReductionOperation, + const char *source, int line, int dim, const Descriptor *mask = nullptr, const common::int128_t *identity = nullptr, bool ordered = true); #endif // REAL/COMPLEX(2 & 3) return 32-bit float results for the caller to downconvert -float RTDECL(ReduceReal2)(const Descriptor &, ReductionOperation, - const char *source, int line, int dim = 0, const Descriptor *mask = nullptr, +float RTDECL(ReduceReal2Ref)(const Descriptor &, + ReferenceReductionOperation, const char *source, int line, + int dim = 0, const Descriptor *mask = nullptr, const float *identity = nullptr, bool ordered = true); -void RTDECL(ReduceReal2Dim)(Descriptor &result, const Descriptor &array, - ReductionOperation, const char *source, int line, int dim, +float RTDECL(ReduceReal2Value)(const Descriptor &, + ValueReductionOperation, const char *source, int line, int dim = 0, const Descriptor *mask = nullptr, const float *identity = nullptr, bool ordered = true); -float RTDECL(ReduceReal3)(const Descriptor &, ReductionOperation, - const char *source, int line, int dim = 0, const Descriptor *mask = nullptr, +void RTDECL(ReduceReal2DimRef)(Descriptor &result, const Descriptor &array, + ReferenceReductionOperation, const char *source, int line, int dim, + const Descriptor *mask = nullptr, const float *identity = nullptr, + bool ordered = true); +void RTDECL(ReduceReal2DimValue)(Descriptor &result, const Descriptor &array, + ValueReductionOperation, const char *source, int line, int dim, + const Descriptor *mask = nullptr, const float *identity = nullptr, + bool ordered = true); +float RTDECL(ReduceReal3Ref)(const Descriptor &, + ReferenceReductionOperation, const char *source, int line, + int dim = 0, const Descriptor *mask = nullptr, const float *identity = nullptr, bool ordered = true); -void RTDECL(ReduceReal3Dim)(Descriptor &result, const Descriptor &array, - ReductionOperation, const char *source, int line, int dim, +float RTDECL(ReduceReal3Value)(const Descriptor &, + ValueReductionOperation, const char *source, int line, int dim = 0, const Descriptor *mask = nullptr, const float *identity = nullptr, bool ordered = true); -float RTDECL(ReduceReal4)(const Descriptor &, ReductionOperation, - const char *source, int line, int dim = 0, const Descriptor *mask = nullptr, +void RTDECL(ReduceReal3DimRef)(Descriptor &result, const Descriptor &array, + ReferenceReductionOperation, const char *source, int line, int dim, + const Descriptor *mask = nullptr, const float *identity = nullptr, + bool ordered = true); +void RTDECL(ReduceReal3DimValue)(Descriptor &result, const Descriptor &array, + ValueReductionOperation, const char *source, int line, int dim, + const Descriptor *mask = nullptr, const float *identity = nullptr, + bool ordered = true); +float RTDECL(ReduceReal4Ref)(const Descriptor &, + ReferenceReductionOperation, const char *source, int line, + int dim = 0, const Descriptor *mask = nullptr, const float *identity = nullptr, bool ordered = true); -void RTDECL(ReduceReal4Dim)(Descriptor &result, const Descriptor &array, - ReductionOperation, const char *source, int line, int dim, +float RTDECL(ReduceReal4Value)(const Descriptor &, + ValueReductionOperation, const char *source, int line, int dim = 0, const Descriptor *mask = nullptr, const float *identity = nullptr, bool ordered = true); -double RTDECL(ReduceReal8)(const Descriptor &, ReductionOperation, - const char *source, int line, int dim = 0, const Descriptor *mask = nullptr, +void RTDECL(ReduceReal4DimRef)(Descriptor &result, const Descriptor &array, + ReferenceReductionOperation, const char *source, int line, int dim, + const Descriptor *mask = nullptr, const float *identity = nullptr, + bool ordered = true); +void RTDECL(ReduceReal4DimValue)(Descriptor &result, const Descriptor &array, + ValueReductionOperation, const char *source, int line, int dim, + const Descriptor *mask = nullptr, const float *identity = nullptr, + bool ordered = true); +double RTDECL(ReduceReal8Ref)(const Descriptor &, + ReferenceReductionOperation, const char *source, int line, + int dim = 0, const Descriptor *mask = nullptr, const double *identity = nullptr, bool ordered = true); -void RTDECL(ReduceReal8Dim)(Descriptor &result, const Descriptor &array, - ReductionOperation, const char *source, int line, int dim, +double RTDECL(ReduceReal8Value)(const Descriptor &, + ValueReductionOperation, const char *source, int line, int dim = 0, const Descriptor *mask = nullptr, const double *identity = nullptr, bool ordered = true); -#if LDBL_MANT_DIG == 64 -long double RTDECL(ReduceReal10)(const Descriptor &, - ReductionOperation, const char *source, int line, int dim = 0, - const Descriptor *mask = nullptr, const long double *identity = nullptr, +void RTDECL(ReduceReal8DimRef)(Descriptor &result, const Descriptor &array, + ReferenceReductionOperation, const char *source, int line, int dim, + const Descriptor *mask = nullptr, const double *identity = nullptr, bool ordered = true); -void RTDECL(ReduceReal10Dim)(Descriptor &result, const Descriptor &array, - ReductionOperation, const char *source, int line, int dim, +void RTDECL(ReduceReal8DimValue)(Descriptor &result, const Descriptor &array, + ValueReductionOperation, const char *source, int line, int dim, + const Descriptor *mask = nullptr, const double *identity = nullptr, + bool ordered = true); +#if LDBL_MANT_DIG == 64 +long double RTDECL(ReduceReal10Ref)(const Descriptor &, + ReferenceReductionOperation, const char *source, int line, + int dim = 0, const Descriptor *mask = nullptr, + const long double *identity = nullptr, bool ordered = true); +long double RTDECL(ReduceReal10Value)(const Descriptor &, + ValueReductionOperation, const char *source, int line, + int dim = 0, const Descriptor *mask = nullptr, + const long double *identity = nullptr, bool ordered = true); +void RTDECL(ReduceReal10DimRef)(Descriptor &result, const Descriptor &array, + ReferenceReductionOperation, const char *source, int line, + int dim, const Descriptor *mask = nullptr, + const long double *identity = nullptr, bool ordered = true); +void RTDECL(ReduceReal10DimValue)(Descriptor &result, const Descriptor &array, + ValueReductionOperation, const char *source, int line, int dim, const Descriptor *mask = nullptr, const long double *identity = nullptr, bool ordered = true); #endif #if LDBL_MANT_DIG == 113 || HAS_FLOAT128 -CppFloat128Type RTDECL(ReduceReal16)(const Descriptor &, - ReductionOperation, const char *source, int line, +CppFloat128Type RTDECL(ReduceReal16Ref)(const Descriptor &, + ReferenceReductionOperation, const char *source, int line, int dim = 0, const Descriptor *mask = nullptr, const CppFloat128Type *identity = nullptr, bool ordered = true); -void RTDECL(ReduceReal16Dim)(Descriptor &result, const Descriptor &array, - ReductionOperation, const char *source, int line, int dim, - const Descriptor *mask = nullptr, const CppFloat128Type *identity = nullptr, - bool ordered = true); +CppFloat128Type RTDECL(ReduceReal16Value)(const Descriptor &, + ValueReductionOperation, const char *source, int line, + int dim = 0, const Descriptor *mask = nullptr, + const CppFloat128Type *identity = nullptr, bool ordered = true); +void RTDECL(ReduceReal16DimRef)(Descriptor &result, const Descriptor &array, + ReferenceReductionOperation, const char *source, int line, + int dim, const Descriptor *mask = nullptr, + const CppFloat128Type *identity = nullptr, bool ordered = true); +void RTDECL(ReduceReal16DimValue)(Descriptor &result, const Descriptor &array, + ValueReductionOperation, const char *source, int line, + int dim, const Descriptor *mask = nullptr, + const CppFloat128Type *identity = nullptr, bool ordered = true); #endif -void RTDECL(CppReduceComplex2)(std::complex &, const Descriptor &, - ReductionOperation>, const char *source, int line, +void RTDECL(CppReduceComplex2Ref)(std::complex &, const Descriptor &, + ReferenceReductionOperation>, const char *source, + int line, int dim = 0, const Descriptor *mask = nullptr, + const std::complex *identity = nullptr, bool ordered = true); +void RTDECL(CppReduceComplex2Value)(std::complex &, const Descriptor &, + ValueReductionOperation>, const char *source, int line, int dim = 0, const Descriptor *mask = nullptr, const std::complex *identity = nullptr, bool ordered = true); -void RTDECL(CppReduceComplex2Dim)(Descriptor &result, const Descriptor &array, - ReductionOperation>, const char *source, int line, - int dim, const Descriptor *mask = nullptr, +void RTDECL(CppReduceComplex2DimRef)(Descriptor &result, + const Descriptor &array, ReferenceReductionOperation>, + const char *source, int line, int dim, const Descriptor *mask = nullptr, + const std::complex *identity = nullptr, bool ordered = true); +void RTDECL(CppReduceComplex2DimValue)(Descriptor &result, + const Descriptor &array, ValueReductionOperation>, + const char *source, int line, int dim, const Descriptor *mask = nullptr, const std::complex *identity = nullptr, bool ordered = true); -void RTDECL(CppReduceComplex3)(std::complex &, const Descriptor &, - ReductionOperation>, const char *source, int line, +void RTDECL(CppReduceComplex3Ref)(std::complex &, const Descriptor &, + ReferenceReductionOperation>, const char *source, + int line, int dim = 0, const Descriptor *mask = nullptr, + const std::complex *identity = nullptr, bool ordered = true); +void RTDECL(CppReduceComplex3Value)(std::complex &, const Descriptor &, + ValueReductionOperation>, const char *source, int line, int dim = 0, const Descriptor *mask = nullptr, const std::complex *identity = nullptr, bool ordered = true); -void RTDECL(CppReduceComplex3Dim)(Descriptor &result, const Descriptor &array, - ReductionOperation>, const char *source, int line, - int dim, const Descriptor *mask = nullptr, +void RTDECL(CppReduceComplex3DimRef)(Descriptor &result, + const Descriptor &array, ReferenceReductionOperation>, + const char *source, int line, int dim, const Descriptor *mask = nullptr, + const std::complex *identity = nullptr, bool ordered = true); +void RTDECL(CppReduceComplex3DimValue)(Descriptor &result, + const Descriptor &array, ValueReductionOperation>, + const char *source, int line, int dim, const Descriptor *mask = nullptr, const std::complex *identity = nullptr, bool ordered = true); -void RTDECL(CppReduceComplex4)(std::complex &, const Descriptor &, - ReductionOperation>, const char *source, int line, +void RTDECL(CppReduceComplex4Ref)(std::complex &, const Descriptor &, + ReferenceReductionOperation>, const char *source, + int line, int dim = 0, const Descriptor *mask = nullptr, + const std::complex *identity = nullptr, bool ordered = true); +void RTDECL(CppReduceComplex4Value)(std::complex &, const Descriptor &, + ValueReductionOperation>, const char *source, int line, int dim = 0, const Descriptor *mask = nullptr, const std::complex *identity = nullptr, bool ordered = true); -void RTDECL(CppReduceComplex4Dim)(Descriptor &result, const Descriptor &array, - ReductionOperation>, const char *source, int line, - int dim, const Descriptor *mask = nullptr, +void RTDECL(CppReduceComplex4DimRef)(Descriptor &result, + const Descriptor &array, ReferenceReductionOperation>, + const char *source, int line, int dim, const Descriptor *mask = nullptr, const std::complex *identity = nullptr, bool ordered = true); -void RTDECL(CppReduceComplex8)(std::complex &, const Descriptor &, - ReductionOperation>, const char *source, int line, +void RTDECL(CppReduceComplex4DimValue)(Descriptor &result, + const Descriptor &array, ValueReductionOperation>, + const char *source, int line, int dim, const Descriptor *mask = nullptr, + const std::complex *identity = nullptr, bool ordered = true); +void RTDECL(CppReduceComplex8Ref)(std::complex &, const Descriptor &, + ReferenceReductionOperation>, const char *source, + int line, int dim = 0, const Descriptor *mask = nullptr, + const std::complex *identity = nullptr, bool ordered = true); +void RTDECL(CppReduceComplex8Value)(std::complex &, const Descriptor &, + ValueReductionOperation>, const char *source, int line, int dim = 0, const Descriptor *mask = nullptr, const std::complex *identity = nullptr, bool ordered = true); -void RTDECL(CppReduceComplex8Dim)(Descriptor &result, const Descriptor &array, - ReductionOperation>, const char *source, int line, - int dim, const Descriptor *mask = nullptr, +void RTDECL(CppReduceComplex8DimRef)(Descriptor &result, + const Descriptor &array, ReferenceReductionOperation>, + const char *source, int line, int dim, const Descriptor *mask = nullptr, + const std::complex *identity = nullptr, bool ordered = true); +void RTDECL(CppReduceComplex8DimValue)(Descriptor &result, + const Descriptor &array, ValueReductionOperation>, + const char *source, int line, int dim, const Descriptor *mask = nullptr, const std::complex *identity = nullptr, bool ordered = true); #if LDBL_MANT_DIG == 64 -void RTDECL(CppReduceComplex10)(std::complex &, const Descriptor &, - ReductionOperation>, const char *source, int line, - int dim = 0, const Descriptor *mask = nullptr, +void RTDECL(CppReduceComplex10Ref)(std::complex &, + const Descriptor &, ReferenceReductionOperation>, + const char *source, int line, int dim = 0, const Descriptor *mask = nullptr, const std::complex *identity = nullptr, bool ordered = true); -void RTDECL(CppReduceComplex10Dim)(Descriptor &result, const Descriptor &array, - ReductionOperation>, const char *source, int line, - int dim, const Descriptor *mask = nullptr, +void RTDECL(CppReduceComplex10Value)(std::complex &, + const Descriptor &, ValueReductionOperation>, + const char *source, int line, int dim = 0, const Descriptor *mask = nullptr, + const std::complex *identity = nullptr, bool ordered = true); +void RTDECL(CppReduceComplex10DimRef)(Descriptor &result, + const Descriptor &array, + ReferenceReductionOperation>, const char *source, + int line, int dim, const Descriptor *mask = nullptr, + const std::complex *identity = nullptr, bool ordered = true); +void RTDECL(CppReduceComplex10DimValue)(Descriptor &result, + const Descriptor &array, ValueReductionOperation>, + const char *source, int line, int dim, const Descriptor *mask = nullptr, const std::complex *identity = nullptr, bool ordered = true); #endif #if LDBL_MANT_DIG == 113 || HAS_FLOAT128 -void RTDECL(CppReduceComplex16)(std::complex &, - const Descriptor &, ReductionOperation>, +void RTDECL(CppReduceComplex16Ref)(std::complex &, + const Descriptor &, + ReferenceReductionOperation>, const char *source, int line, int dim = 0, const Descriptor *mask = nullptr, const std::complex *identity = nullptr, bool ordered = true); -void RTDECL(CppReduceComplex16Dim)(Descriptor &result, const Descriptor &array, - ReductionOperation>, const char *source, +void RTDECL(CppReduceComplex16Value)(std::complex &, + const Descriptor &, ValueReductionOperation>, + const char *source, int line, int dim = 0, const Descriptor *mask = nullptr, + const std::complex *identity = nullptr, + bool ordered = true); +void RTDECL(CppReduceComplex16DimRef)(Descriptor &result, + const Descriptor &array, + ReferenceReductionOperation>, + const char *source, int line, int dim, const Descriptor *mask = nullptr, + const std::complex *identity = nullptr, + bool ordered = true); +void RTDECL(CppReduceComplex16DimValue)(Descriptor &result, + const Descriptor &array, + ValueReductionOperation>, const char *source, int line, int dim, const Descriptor *mask = nullptr, const std::complex *identity = nullptr, bool ordered = true); #endif -bool RTDECL(ReduceLogical1)(const Descriptor &, ReductionOperation, - const char *source, int line, int dim = 0, const Descriptor *mask = nullptr, +bool RTDECL(ReduceLogical1Ref)(const Descriptor &, + ReferenceReductionOperation, const char *source, int line, + int dim = 0, const Descriptor *mask = nullptr, + const std::int8_t *identity = nullptr, bool ordered = true); +bool RTDECL(ReduceLogical1Value)(const Descriptor &, + ValueReductionOperation, const char *source, int line, + int dim = 0, const Descriptor *mask = nullptr, + const std::int8_t *identity = nullptr, bool ordered = true); +void RTDECL(ReduceLogical1DimRef)(Descriptor &result, const Descriptor &array, + ReferenceReductionOperation, const char *source, int line, + int dim, const Descriptor *mask = nullptr, const std::int8_t *identity = nullptr, bool ordered = true); -void RTDECL(ReduceLogical1Dim)(Descriptor &result, const Descriptor &array, - ReductionOperation, const char *source, int line, int dim, +void RTDECL(ReduceLogical1DimValue)(Descriptor &result, const Descriptor &array, + ValueReductionOperation, const char *source, int line, int dim, const Descriptor *mask = nullptr, const std::int8_t *identity = nullptr, bool ordered = true); -bool RTDECL(ReduceLogical2)(const Descriptor &, - ReductionOperation, const char *source, int line, int dim = 0, - const Descriptor *mask = nullptr, const std::int16_t *identity = nullptr, - bool ordered = true); -void RTDECL(ReduceLogical2Dim)(Descriptor &result, const Descriptor &array, - ReductionOperation, const char *source, int line, int dim, - const Descriptor *mask = nullptr, const std::int16_t *identity = nullptr, - bool ordered = true); -bool RTDECL(ReduceLogical4)(const Descriptor &, - ReductionOperation, const char *source, int line, int dim = 0, - const Descriptor *mask = nullptr, const std::int32_t *identity = nullptr, - bool ordered = true); -void RTDECL(ReduceLogical4Dim)(Descriptor &result, const Descriptor &array, - ReductionOperation, const char *source, int line, int dim, - const Descriptor *mask = nullptr, const std::int32_t *identity = nullptr, - bool ordered = true); -bool RTDECL(ReduceLogical8)(const Descriptor &, - ReductionOperation, const char *source, int line, int dim = 0, - const Descriptor *mask = nullptr, const std::int64_t *identity = nullptr, - bool ordered = true); -void RTDECL(ReduceLogical8Dim)(Descriptor &result, const Descriptor &array, - ReductionOperation, const char *source, int line, int dim, - const Descriptor *mask = nullptr, const std::int64_t *identity = nullptr, - bool ordered = true); +bool RTDECL(ReduceLogical2Ref)(const Descriptor &, + ReferenceReductionOperation, const char *source, int line, + int dim = 0, const Descriptor *mask = nullptr, + const std::int16_t *identity = nullptr, bool ordered = true); +bool RTDECL(ReduceLogical2Value)(const Descriptor &, + ValueReductionOperation, const char *source, int line, + int dim = 0, const Descriptor *mask = nullptr, + const std::int16_t *identity = nullptr, bool ordered = true); +void RTDECL(ReduceLogical2DimRef)(Descriptor &result, const Descriptor &array, + ReferenceReductionOperation, const char *source, int line, + int dim, const Descriptor *mask = nullptr, + const std::int16_t *identity = nullptr, bool ordered = true); +void RTDECL(ReduceLogical2DimValue)(Descriptor &result, const Descriptor &array, + ValueReductionOperation, const char *source, int line, + int dim, const Descriptor *mask = nullptr, + const std::int16_t *identity = nullptr, bool ordered = true); +bool RTDECL(ReduceLogical4Ref)(const Descriptor &, + ReferenceReductionOperation, const char *source, int line, + int dim = 0, const Descriptor *mask = nullptr, + const std::int32_t *identity = nullptr, bool ordered = true); +bool RTDECL(ReduceLogical4Value)(const Descriptor &, + ValueReductionOperation, const char *source, int line, + int dim = 0, const Descriptor *mask = nullptr, + const std::int32_t *identity = nullptr, bool ordered = true); +void RTDECL(ReduceLogical4DimRef)(Descriptor &result, const Descriptor &array, + ReferenceReductionOperation, const char *source, int line, + int dim, const Descriptor *mask = nullptr, + const std::int32_t *identity = nullptr, bool ordered = true); +void RTDECL(ReduceLogical4DimValue)(Descriptor &result, const Descriptor &array, + ValueReductionOperation, const char *source, int line, + int dim, const Descriptor *mask = nullptr, + const std::int32_t *identity = nullptr, bool ordered = true); +bool RTDECL(ReduceLogical8Ref)(const Descriptor &, + ReferenceReductionOperation, const char *source, int line, + int dim = 0, const Descriptor *mask = nullptr, + const std::int64_t *identity = nullptr, bool ordered = true); +bool RTDECL(ReduceLogical8Value)(const Descriptor &, + ValueReductionOperation, const char *source, int line, + int dim = 0, const Descriptor *mask = nullptr, + const std::int64_t *identity = nullptr, bool ordered = true); +void RTDECL(ReduceLogical8DimRef)(Descriptor &result, const Descriptor &array, + ReferenceReductionOperation, const char *source, int line, + int dim, const Descriptor *mask = nullptr, + const std::int64_t *identity = nullptr, bool ordered = true); +void RTDECL(ReduceLogical8DimValue)(Descriptor &result, const Descriptor &array, + ValueReductionOperation, const char *source, int line, + int dim, const Descriptor *mask = nullptr, + const std::int64_t *identity = nullptr, bool ordered = true); void RTDECL(ReduceChar1)(char *result, const Descriptor &array, ReductionCharOperation, const char *source, int line, int dim = 0, -- cgit v1.1