8#include <src/util/internal-api.hh>
30 std::vector<Sb2stHhRefl> out;
31 if (n <= 2 || kd <= 1)
return out;
33 for (int32_t st = 0; st + 2 < n; ++st) {
35 int32_t r1 = (st + kd < n - 1) ? (st + kd) : (n - 1);
36 if (r1 <= r0)
continue;
41 const int32_t p0 = r1 + 1;
42 const int32_t p1 = (r1 + kd < n - 1) ? (r1 + kd) : (n - 1);
58 const int32_t want = 2 * kd;
59 const int32_t cap = (n > 0) ? (n - 1) : 0;
60 return (want < cap) ? want : cap;
67template <Backend B,
typename T>
79template <Backend B,
typename T>
85 const std::vector<Sb2stHhRefl>& sched, int32_t n) {
86 std::vector<int32_t> off;
87 const int32_t nrefl =
static_cast<int32_t
>(sched.size());
88 if (nrefl <= 0 || n <= 0)
return off;
90 std::vector<int32_t> stamp(
static_cast<size_t>(n), -1);
93 for (int32_t k = 0; k < nrefl; ++k) {
94 const int32_t s = sched[k].start;
95 const int32_t e = s + sched[k].len;
96 bool overlaps =
false;
97 for (int32_t r = s; r < e && r < n; ++r) {
98 if (stamp[r] == run) { overlaps =
true;
break; }
100 if (overlaps) { off.push_back(k); ++run; }
101 for (int32_t r = s; r < e && r < n; ++r) stamp[r] = run;
103 off.push_back(nrefl);
109template <Backend B,
typename T>
Non-owning view of a batch of matrices: the argument type of every entry point.
Non-owning view of a batch of strided vectors: the vector argument type of the entry points.
Enumerations, scalar traits and scalar concepts shared by every public header.
Uplo
Which triangle of a symmetric, Hermitian or triangular operand is referenced.
The batched containers: Matrix (owning), MatrixView (non-owning), KernelMatrixView (device-side),...
std::vector< Sb2stHhRefl > build_sb2st_hh_schedule(int32_t n, int32_t kd)
int32_t sb2st_hh_num_reflectors(int32_t n, int32_t kd)
BATCHLAS_INTERNAL_API Event unmqr_hb2st(Queue &ctx, const MatrixView< T, MatrixFormat::Dense > &v_in, const VectorView< T > &tau_in, const MatrixView< T, MatrixFormat::Dense > &z_io, int32_t n, int32_t kd, Span< const int32_t > starts, Span< const int32_t > lens, Span< const int32_t > waves)
int32_t sb2st_hh_work_bandwidth(int32_t n, int32_t kd)
BATCHLAS_INTERNAL_API size_t sytrd_sb2st_hh_buffer_size(Queue &ctx, int32_t n, int32_t kd, int32_t batch)
std::vector< int32_t > build_sb2st_hh_wave_offsets(const std::vector< Sb2stHhRefl > &sched, int32_t n)
BATCHLAS_INTERNAL_API Event sytrd_sb2st_hh(Queue &ctx, const MatrixView< T, MatrixFormat::Dense > &ab_in, const MatrixView< T, MatrixFormat::Dense > &ab_tri_out, const VectorView< typename base_type< T >::type > &d_out, const VectorView< typename base_type< T >::type > &e_out, const MatrixView< T, MatrixFormat::Dense > &v_out, const VectorView< T > &tau_out, Uplo uplo, int32_t kd, const Span< std::byte > &ws)
Completion handle of enqueued work, returned by every entry point.
Where BatchLAS work runs: a device, a backend, an ordered SYCL queue and a workspace arena.
Non-owning view of size() contiguous elements of type T.
batchlas::Device, batchlas::Event and batchlas::Queue: where work runs and how it is ordered.
batchlas::Span, the non-owning pointer + length every entry point takes for 1-D data.