24 template <
typename E,
typename V>
26 if constexpr (is_single_precision<E> &&
egblas_enabled && impl::egblas::has_scalar_sset) {
29 if (mat.gpu_memory()) {
30 impl::egblas::scalar_set(mat.gpu_memory(),
etl::size(mat), 1, value_conv);
35 std::fill(mat.memory_start(), mat.memory_end(), value_conv);
38 }
else if constexpr (is_double_precision<E> &&
egblas_enabled && impl::egblas::has_scalar_dset) {
41 if (mat.gpu_memory()) {
42 impl::egblas::scalar_set(mat.gpu_memory(),
etl::size(mat), 1, value_conv);
47 std::fill(mat.memory_start(), mat.memory_end(), value_conv);
51 std::fill(mat.memory_start(), mat.memory_end(), value);
Root namespace for the ETL library.
Definition: adapter.hpp:15
constexpr bool egblas_enabled
Indicates if the EGBLAS library is available for ETL.
Definition: config.hpp:119
void direct_fill(E &&mat, V value)
Fill the given ETL value class with the given value.
Definition: direct_fill.hpp:25
constexpr size_t size(const E &expr) noexcept
Returns the size of the given ETL expression.
Definition: helpers.hpp:108
EGBLAS wrappers for the scalar_set operation.
typename decay_traits< E >::value_type value_t
Traits to extract the value type out of an ETL type.
Definition: tmp.hpp:81