28 #ifndef SPLA_CPU_V_COUNT_MF_HPP
29 #define SPLA_CPU_V_COUNT_MF_HPP
52 return "sequential count mf";
56 auto t = ctx.
task.template cast_safe<ScheduleTask_v_count_mf>();
60 return execute_dok(ctx);
62 return execute_coo(ctx);
64 return execute_dense(ctx);
66 return execute_coo(ctx);
73 auto t = ctx.
task.template cast_safe<ScheduleTask_v_count_mf>();
77 t->r->set_uint(dec_v->values);
81 Status execute_coo(
const DispatchContext& ctx) {
84 auto t = ctx.task.template cast_safe<ScheduleTask_v_count_mf>();
85 ref_ptr<TVector<T>> v = t->v.template cast_safe<TVector<T>>();
86 CpuCooVec<T>* dec_v = v->template get<CpuCooVec<T>>();
88 t->r->set_uint(dec_v->values);
92 Status execute_dense(
const DispatchContext& ctx) {
95 auto t = ctx.task.template cast_safe<ScheduleTask_v_count_mf>();
96 ref_ptr<TVector<T>> v = t->v.template cast_safe<TVector<T>>();
97 CpuDenseVec<T>* dec_v = v->template get<CpuDenseVec<T>>();
100 const T ref = v->get_fill_value();
102 for (
uint i = 0; i < v->get_n_rows(); i++) {
103 if (dec_v->Ax[i] != ref) {
108 t->r->set_uint(values);
Status of library operation execution.
Definition: cpu_v_count_mf.hpp:43
std::string get_description() override
Definition: cpu_v_count_mf.hpp:51
~Algo_v_count_mf_cpu() override=default
Status execute(const DispatchContext &ctx) override
Definition: cpu_v_count_mf.hpp:55
std::string get_name() override
Definition: cpu_v_count_mf.hpp:47
Definition: cpu_formats.hpp:55
Algorithm suitable to process schedule task based on task string key.
Definition: registry.hpp:66
Automates reference counting and behaves as shared smart pointer.
Definition: ref.hpp:117
std::uint32_t uint
Library index and size type.
Definition: config.hpp:56
Definition: algorithm.hpp:37
Execution context of a single task.
Definition: dispatcher.hpp:46
ref_ptr< ScheduleTask > task
Definition: dispatcher.hpp:48
#define TIME_PROFILE_SCOPE(name)
Definition: time_profiler.hpp:92