16 template <
typename T,
typename D>
22 static constexpr
bool gpu_computable =
false;
39 template <
typename... Sizes>
50 bool alias(
const E& rhs)
const noexcept {
51 return sub.alias(rhs);
62 sub.visit(std::forward<V>(visitor));
71 sub.ensure_cpu_up_to_date();
80 sub.ensure_gpu_up_to_date();
88 const derived_t& as_derived()
const noexcept {
89 return *
static_cast<const derived_t*
>(
this);
98 template <
typename T,
size_t...
D>
105 static constexpr
bool gpu_computable =
false;
109 static constexpr
size_t dimensions =
sizeof...(D) + sub_d;
110 static constexpr
size_t dim_start = 0;
111 static constexpr
size_t dim_end = sub_d;
129 return this->
sub[i / (
D * ...)];
139 return this->
sub.read_flat(i / (
D * ...));
145 template <
typename... Sizes,
size_t... I>
147 return this->
sub(cpp::nth_value<I>(sizes...)...);
157 return os <<
"rep_r[" <<
concat_sizes(
D...) <<
"](" << transformer.
sub <<
")";
166 template <
typename T,
size_t...
D>
173 static constexpr
bool gpu_computable =
false;
177 static constexpr
size_t dimensions =
sizeof...(D) + sub_d;
178 static constexpr
size_t dim_start =
sizeof...(D);
179 static constexpr
size_t dim_end = dimensions;
213 template <
typename... Sizes,
size_t... I>
215 return this->
sub(cpp::nth_value<I>(sizes...)...);
225 return os <<
"rep_l[" <<
concat_sizes(
D...) <<
"](" << transformer.
sub <<
")";
234 template <
typename T,
size_t D>
241 static constexpr
bool gpu_computable =
false;
245 static constexpr
size_t dimensions =
D + sub_d;
246 static constexpr
size_t dim_start = 0;
247 static constexpr
size_t dim_end = sub_d;
249 std::array<size_t, D> reps;
262 m = std::accumulate(reps.begin(), reps.end(), 1UL, [](
size_t a,
size_t b) {
return a * b; });
271 return this->
sub[i / m];
281 return this->
sub.read_flat(i / m);
287 template <
typename... Sizes,
size_t... I>
289 return this->
sub(cpp::nth_value<I>(sizes...)...);
298 template <
typename T,
size_t D>
305 static constexpr
bool gpu_computable =
false;
309 static constexpr
size_t dimensions =
D + sub_d;
310 static constexpr
size_t dim_start =
D;
311 static constexpr
size_t dim_end = dimensions;
313 std::array<size_t, D> reps;
326 m = std::accumulate(reps.begin(), reps.end(), 1UL, [](
size_t a,
size_t b) {
return a * b; });
351 template <
typename... Sizes,
size_t... I>
353 return this->
sub(cpp::nth_value<I>(sizes...)...);
360 template <
typename T,
size_t...
D>
366 static constexpr
bool is_etl =
true;
371 static constexpr
bool is_linear =
false;
373 static constexpr
bool is_value =
false;
374 static constexpr
bool is_direct =
false;
375 static constexpr
bool is_generator =
false;
376 static constexpr
bool is_padded =
false;
377 static constexpr
bool is_aligned =
false;
379 static constexpr
bool gpu_computable =
false;
389 template <vector_mode_t V>
390 static constexpr
bool vectorizable =
false;
419 static constexpr
size_t size() {
427 static constexpr
size_t dim() {
428 if constexpr (D2 < sub_d) {
455 template <
typename T,
size_t...
D>
461 static constexpr
bool is_etl =
true;
466 static constexpr
bool is_linear =
false;
468 static constexpr
bool is_value =
false;
469 static constexpr
bool is_direct =
false;
470 static constexpr
bool is_generator =
false;
471 static constexpr
bool is_padded =
false;
472 static constexpr
bool is_aligned =
false;
474 static constexpr
bool gpu_computable =
false;
482 template <vector_mode_t V>
483 static constexpr
bool vectorizable =
false;
501 if (d >=
sizeof...(
D)) {
512 static constexpr
size_t size() {
522 static constexpr
size_t dim() {
523 if constexpr (D2 >=
sizeof...(
D)) {
550 template <
typename T,
size_t D>
556 static constexpr
bool is_etl =
true;
561 static constexpr
bool is_linear =
false;
563 static constexpr
bool is_value =
false;
564 static constexpr
bool is_direct =
false;
565 static constexpr
bool is_generator =
false;
566 static constexpr
bool is_padded =
false;
567 static constexpr
bool is_aligned =
false;
569 static constexpr
bool gpu_computable =
false;
579 template <vector_mode_t V>
580 static constexpr
bool vectorizable =
false;
621 template <
typename T,
size_t D>
627 static constexpr
bool is_etl =
true;
632 static constexpr
bool is_linear =
false;
634 static constexpr
bool is_value =
false;
635 static constexpr
bool is_direct =
false;
636 static constexpr
bool is_generator =
false;
637 static constexpr
bool is_padded =
false;
638 static constexpr
bool is_aligned =
false;
640 static constexpr
bool gpu_computable =
false;
648 template <vector_mode_t V>
649 static constexpr
bool vectorizable =
false;
size_t dyn_nth_size(size_t i)
Returns the dth (dynamic) dimension from the variadic list D.
Definition: tmp.hpp:116
value_t< sub_type > value_type
The value contained in the expression.
Definition: dyn_matrix_view.hpp:31
constexpr bool is_magic_view
Traits indicating if the given ETL type is a magic view expression.
Definition: traits.hpp:311
D D
The number of dimensions.
Definition: dyn_matrix_view.hpp:24
order
Storage order of a matrix.
Definition: order.hpp:15
constexpr size_t nth_size()
Traits to get the Sth dimension in Dims..
Definition: tmp.hpp:102
T sub_type
The sub type.
Definition: dyn_matrix_view.hpp:30
std::string concat_sizes(Dims... sizes)
Returns a string representation of the given dimensions.
Definition: tmp.hpp:192
constexpr bool is_fast
Traits to test if the given ETL expresion type is fast (sizes known at compile-time) ...
Definition: traits.hpp:588
Traits to get information about ETL types.
Definition: tmp.hpp:68
Root namespace for the ETL library.
Definition: adapter.hpp:15
static constexpr size_t dimensions()
Return the number of dimensions of the expression.
Definition: traits_base.hpp:31
auto dim(E &&value, size_t i) -> detail::identity_helper< E, dim_view< detail::build_identity_type< E >, D >>
Return a view representing the ith Dth dimension.
Definition: view_expression_builder.hpp:25
constexpr bool is_transformer
Traits indicating if the given ETL type is a transformer expression.
Definition: traits.hpp:297
constexpr size_t size(const E &expr) noexcept
Returns the size of the given ETL expression.
Definition: helpers.hpp:108
constexpr bool is_view
Traits indicating if the given ETL type is a view expression.
Definition: traits.hpp:304
make_integer_range< size_t, Begin, End > make_index_range
Helper to create an integer_range of size_t numbers.
Definition: tmp.hpp:186
constexpr bool is_thread_safe
Traits to test if the given ETL expresion type is thread safe.
Definition: traits.hpp:687
typename decay_traits< E >::value_type value_t
Traits to extract the value type out of an ETL type.
Definition: tmp.hpp:81