|
Uni20
Asynchronous tensor and runtime library.
|
Internal macros and helpers that support backend integrations without being part of the public API surface. More...
Files | |
| file | blasproto.hpp |
| Templated BLAS interface declarations and wrappers. | |
| file | reference_blas_mkl_direct.hpp |
| Enables MKL direct-call support for Uni20 reference BLAS wrappers. | |
| file | strided_transform.hpp |
| CPU executor for compact strided elementwise iteration plans. | |
Classes | |
| struct | uni20::extent_stride< ExtentT, StrideT > |
| Represents a single dimension's extent and stride for iteration planning. More... | |
| struct | uni20::iteration_offset_range |
| Inclusive range of handle-relative offsets visited by an iteration plan. More... | |
| struct | uni20::multi_iteration_plan< OperandCount, MaximumRank > |
| Compact affine iteration plan shared by host and device backends. More... | |
Macros | |
| #define | BLASCHAR s |
| Internal macro specifying the BLAS routine prefix for single-precision instantiations. | |
| #define | BLASCHAR d |
| Internal macro specifying the BLAS routine prefix for single-precision instantiations. | |
| #define | BLASCHAR c |
| Internal macro specifying the BLAS routine prefix for single-precision instantiations. | |
| #define | BLASCHAR z |
| Internal macro specifying the BLAS routine prefix for single-precision instantiations. | |
| #define | BLASCOMPLEX 0 |
| Internal flag indicating that the single-precision instantiation is real-valued. | |
| #define | BLASCOMPLEX 0 |
| Internal flag indicating that the single-precision instantiation is real-valued. | |
| #define | BLASCOMPLEX 1 |
| Internal flag indicating that the single-precision instantiation is real-valued. | |
| #define | BLASCOMPLEX 1 |
| Internal flag indicating that the single-precision instantiation is real-valued. | |
| #define | BLASREALTYPE float32 |
| Internal macro naming the real-valued companion type for complex single-precision instantiations. | |
| #define | BLASREALTYPE float64 |
| Internal macro naming the real-valued companion type for complex single-precision instantiations. | |
| #define | BLASTYPE float32 |
| Internal macro mapping the BLAS prefix to the associated Uni20 scalar type. | |
| #define | BLASTYPE float64 |
| Internal macro mapping the BLAS prefix to the associated Uni20 scalar type. | |
| #define | BLASTYPE complex64 |
| Internal macro mapping the BLAS prefix to the associated Uni20 scalar type. | |
| #define | BLASTYPE complex128 |
| Internal macro mapping the BLAS prefix to the associated Uni20 scalar type. | |
| #define | MKL_DIRECT_CALL |
| Marks that MKL direct-call entry points should be used instead of dispatcher stubs. | |
| #define | MKL_DIRECT_CALL_SEQ |
| Ensures the sequential (non-threaded) MKL direct-call path is selected. | |
| #define | UNI20_INTERNAL_API_CALL_STRINGIZE(func) UNI20_INTERNAL_STRINGIFY_TOKEN(func) |
| Produces the log-friendly spelling of an external backend API symbol. | |
| #define | UNI20_INTERNAL_BLAS_FN(NAME) UNI20_INTERNAL_CONCAT(UNI20_INTERNAL_CONCAT(BLASCHAR, NAME), _) |
| Builds the mangled Fortran symbol name for the current BLAS instantiation. | |
| #define | UNI20_INTERNAL_CONCAT(x, y) UNI20_INTERNAL_CONCAT2(x, y) |
| Internal macro that concatenates two tokens after expanding both arguments. | |
| #define | UNI20_INTERNAL_CONCAT2(x, y) x##y |
Internal macro that concatenates two tokens without macro expansion on x. | |
| #define | UNI20_INTERNAL_STRINGIFY_TOKEN(x) #x |
| Converts the supplied token into a string literal without macro expansion. | |
Typedefs | |
| template<typename... Spans> | |
| using | uni20::common_extents_t = typename detail::common_extents< Spans... >::type |
| Convenience alias that represents the common extents of a set of mdspans. | |
| template<typename T , std::size_t N> | |
| using | uni20::tuple_n = decltype(detail::make_tuple_n_impl< T >(std::make_index_sequence< N >{})) |
Alias: tuple_n<T,N> is std::tuple<T,T,…> with N repetitions of T. | |
Functions | |
| constexpr bool | uni20::extent_stride< ExtentT, StrideT >::can_merge_with_inner (extent_stride inner) const noexcept |
| Returns true when two adjacent dimensions can be merged. | |
| template<typename T , std::size_t N> | |
| UNI20_HOST_DEVICE constexpr std::array< T, N+1 > | uni20::concat (const std::array< T, N > &a, const T &x) |
| Append a single element to the end of an array. | |
| template<typename T , std::size_t N1, std::size_t N2> | |
| UNI20_HOST_DEVICE constexpr std::array< T, N1+N2 > | uni20::concat (const std::array< T, N1 > &a1, const std::array< T, N2 > &a2) |
| Concatenate two std::array instances into one (constexpr helper). | |
| template<typename T , std::size_t N> | |
| UNI20_HOST_DEVICE constexpr std::array< T, N+1 > | uni20::concat (const T &x, const std::array< T, N > &a) |
| Prepend a single element in front of an array. | |
| template<typename... Spans> | |
| auto | uni20::make_common_extents (Spans... spans) |
| Build an extents object representing the common shape of the given spans. | |
| template<typename Mapping > | |
| auto | uni20::make_iteration_plan_with_offset (Mapping const &mapping) |
| Construct a merged iteration plan and offset for a single mapping. | |
| template<typename... Mappings> | |
| auto | uni20::make_multi_iteration_plan (std::tuple< Mappings... > const &mappings) |
| Build a merged iteration plan for multiple tensors sharing the same extents. | |
| constexpr void | uni20::extent_stride< ExtentT, StrideT >::merge_with_inner (extent_stride inner) noexcept |
| Merge an inner dimension into this one. | |
Internal macros and helpers that support backend integrations without being part of the public API surface.
| #define BLASCHAR s |
Internal macro specifying the BLAS routine prefix for single-precision instantiations.
Internal macro specifying the BLAS routine prefix for complex double-precision instantiations.
Internal macro specifying the BLAS routine prefix for complex single-precision instantiations.
Internal macro specifying the BLAS routine prefix for double-precision instantiations.
| #define BLASCHAR d |
Internal macro specifying the BLAS routine prefix for single-precision instantiations.
Internal macro specifying the BLAS routine prefix for complex double-precision instantiations.
Internal macro specifying the BLAS routine prefix for complex single-precision instantiations.
Internal macro specifying the BLAS routine prefix for double-precision instantiations.
| #define BLASCHAR c |
Internal macro specifying the BLAS routine prefix for single-precision instantiations.
Internal macro specifying the BLAS routine prefix for complex double-precision instantiations.
Internal macro specifying the BLAS routine prefix for complex single-precision instantiations.
Internal macro specifying the BLAS routine prefix for double-precision instantiations.
| #define BLASCHAR z |
Internal macro specifying the BLAS routine prefix for single-precision instantiations.
Internal macro specifying the BLAS routine prefix for complex double-precision instantiations.
Internal macro specifying the BLAS routine prefix for complex single-precision instantiations.
Internal macro specifying the BLAS routine prefix for double-precision instantiations.
| #define BLASCOMPLEX 0 |
Internal flag indicating that the single-precision instantiation is real-valued.
Internal flag indicating that the complex double-precision instantiation uses complex arithmetic.
Internal flag indicating that the complex single-precision instantiation uses complex arithmetic.
Internal flag indicating that the double-precision instantiation is real-valued.
| #define BLASCOMPLEX 0 |
Internal flag indicating that the single-precision instantiation is real-valued.
Internal flag indicating that the complex double-precision instantiation uses complex arithmetic.
Internal flag indicating that the complex single-precision instantiation uses complex arithmetic.
Internal flag indicating that the double-precision instantiation is real-valued.
| #define BLASCOMPLEX 1 |
Internal flag indicating that the single-precision instantiation is real-valued.
Internal flag indicating that the complex double-precision instantiation uses complex arithmetic.
Internal flag indicating that the complex single-precision instantiation uses complex arithmetic.
Internal flag indicating that the double-precision instantiation is real-valued.
| #define BLASCOMPLEX 1 |
Internal flag indicating that the single-precision instantiation is real-valued.
Internal flag indicating that the complex double-precision instantiation uses complex arithmetic.
Internal flag indicating that the complex single-precision instantiation uses complex arithmetic.
Internal flag indicating that the double-precision instantiation is real-valued.
| #define BLASREALTYPE float32 |
Internal macro naming the real-valued companion type for complex single-precision instantiations.
Internal macro naming the real-valued companion type for complex double-precision instantiations.
| #define BLASREALTYPE float64 |
Internal macro naming the real-valued companion type for complex single-precision instantiations.
Internal macro naming the real-valued companion type for complex double-precision instantiations.
| #define BLASTYPE float32 |
Internal macro mapping the BLAS prefix to the associated Uni20 scalar type.
Internal macro mapping the complex double-precision BLAS prefix to the associated Uni20 scalar type.
Internal macro mapping the complex BLAS prefix to the associated Uni20 scalar type.
| #define BLASTYPE float64 |
Internal macro mapping the BLAS prefix to the associated Uni20 scalar type.
Internal macro mapping the complex double-precision BLAS prefix to the associated Uni20 scalar type.
Internal macro mapping the complex BLAS prefix to the associated Uni20 scalar type.
| #define BLASTYPE complex64 |
Internal macro mapping the BLAS prefix to the associated Uni20 scalar type.
Internal macro mapping the complex double-precision BLAS prefix to the associated Uni20 scalar type.
Internal macro mapping the complex BLAS prefix to the associated Uni20 scalar type.
| #define BLASTYPE complex128 |
Internal macro mapping the BLAS prefix to the associated Uni20 scalar type.
Internal macro mapping the complex double-precision BLAS prefix to the associated Uni20 scalar type.
Internal macro mapping the complex BLAS prefix to the associated Uni20 scalar type.
| #define MKL_DIRECT_CALL |
Marks that MKL direct-call entry points should be used instead of dispatcher stubs.
| #define MKL_DIRECT_CALL_SEQ |
Ensures the sequential (non-threaded) MKL direct-call path is selected.
| #define UNI20_INTERNAL_API_CALL_STRINGIZE | ( | func | ) | UNI20_INTERNAL_STRINGIFY_TOKEN(func) |
Produces the log-friendly spelling of an external backend API symbol.
| func | Macro argument that names the symbol being traced. |
| #define UNI20_INTERNAL_BLAS_FN | ( | NAME | ) | UNI20_INTERNAL_CONCAT(UNI20_INTERNAL_CONCAT(BLASCHAR, NAME), _) |
Builds the mangled Fortran symbol name for the current BLAS instantiation.
| #define UNI20_INTERNAL_CONCAT | ( | x, | |
| y | |||
| ) | UNI20_INTERNAL_CONCAT2(x, y) |
Internal macro that concatenates two tokens after expanding both arguments.
| #define UNI20_INTERNAL_CONCAT2 | ( | x, | |
| y | |||
| ) | x##y |
Internal macro that concatenates two tokens without macro expansion on x.
| #define UNI20_INTERNAL_STRINGIFY_TOKEN | ( | x | ) | #x |
Converts the supplied token into a string literal without macro expansion.
| x | Token to stringify. |
x. | using uni20::common_extents_t = typedef typename detail::common_extents<Spans...>::type |
Convenience alias that represents the common extents of a set of mdspans.
| Spans | Mdspan types whose extents are merged. |
| using uni20::tuple_n = typedef decltype(detail::make_tuple_n_impl<T>(std::make_index_sequence<N>{})) |
Alias: tuple_n<T,N> is std::tuple<T,T,…> with N repetitions of T.
| T | Type to repeat. |
| N | Number of repetitions. |
|
inlineconstexprnoexcept |
Returns true when two adjacent dimensions can be merged.
An extent-one dimension is always mergeable because its stride is not observed by any logical index.
| inner | Metadata describing the inner dimension. |
|
constexpr |
Append a single element to the end of an array.
| T | Element type stored in the arrays. |
| N | Length of the original array. |
| a | Original array. |
| x | Element appended at the end. |
x appended.
|
constexpr |
Concatenate two std::array instances into one (constexpr helper).
| T | Element type stored in the arrays. |
| N1 | Length of the first array. |
| N2 | Length of the second array. |
| a1 | First array. |
| a2 | Second array. |
a1 followed by a2.
|
constexpr |
Prepend a single element in front of an array.
| T | Element type stored in the arrays. |
| N | Length of the original array. |
| x | Element inserted at the beginning. |
| a | Array whose contents follow x. |
x prepended. | auto uni20::make_common_extents | ( | Spans... | spans | ) |
Build an extents object representing the common shape of the given spans.
| Spans | Mdspan types participating in the merge. |
| spans | Mdspan instances with compatible extents. |
| auto uni20::make_iteration_plan_with_offset | ( | Mapping const & | mapping | ) |
Construct a merged iteration plan and offset for a single mapping.
| Mapping | Layout mapping type modelling the mdspan mapping interface. |
| mapping | Mapping used to compute strides and extents. |
| auto uni20::make_multi_iteration_plan | ( | std::tuple< Mappings... > const & | mappings | ) |
Build a merged iteration plan for multiple tensors sharing the same extents.
The first mapping determines iteration order and negative-stride normalization. Remaining mappings may have different layout and extents types, but must have the same rank and runtime extents.
| Mappings | Layout mapping types modelling the mdspan mapping interface. |
| mappings | Tuple of mappings, with the writable output mapping first. |
|
inlineconstexprnoexcept |
Merge an inner dimension into this one.
The merged descriptor retains the non-singleton dimension's stride. Two singleton dimensions use the canonical unit stride.
| inner | The dimension that satisfies can_merge_with_inner. |