spla
Loading...
Searching...
No Matches
schedule.hpp
Go to the documentation of this file.
1/**********************************************************************************/
2/* This file is part of spla project */
3/* https://github.com/SparseLinearAlgebra/spla */
4/**********************************************************************************/
5/* MIT License */
6/* */
7/* Copyright (c) 2023 SparseLinearAlgebra */
8/* */
9/* Permission is hereby granted, free of charge, to any person obtaining a copy */
10/* of this software and associated documentation files (the "Software"), to deal */
11/* in the Software without restriction, including without limitation the rights */
12/* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell */
13/* copies of the Software, and to permit persons to whom the Software is */
14/* furnished to do so, subject to the following conditions: */
15/* */
16/* The above copyright notice and this permission notice shall be included in all */
17/* copies or substantial portions of the Software. */
18/* */
19/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR */
20/* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, */
21/* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE */
22/* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER */
23/* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, */
24/* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE */
25/* SOFTWARE. */
26/**********************************************************************************/
27
28#ifndef SPLA_SCHEDULE_HPP
29#define SPLA_SCHEDULE_HPP
30
31#include "config.hpp"
32#include "descriptor.hpp"
33#include "object.hpp"
34
35#include <string>
36#include <vector>
37
38namespace spla {
39
49 class ScheduleTask : public Object {
50 public:
51 SPLA_API ~ScheduleTask() override = default;
52 SPLA_API virtual std::string get_name() = 0;
53 SPLA_API virtual std::string get_key() = 0;
54 SPLA_API virtual std::string get_key_full() = 0;
55 SPLA_API virtual std::vector<ref_ptr<Object>> get_args() = 0;
58 };
59
64 class Schedule : public Object {
65 public:
66 SPLA_API ~Schedule() override = default;
68 SPLA_API virtual Status step_tasks(std::vector<ref_ptr<ScheduleTask>> tasks) = 0;
69 SPLA_API virtual Status submit() = 0;
70 };
71
78
83}// namespace spla
84
85#endif//SPLA_SCHEDULE_HPP
Status of library operation execution.
Base class for any library primitive.
Definition object.hpp:47
Represent single smallest evaluation tasks which can scheduled.
Definition schedule.hpp:49
virtual std::string get_key_full()=0
virtual std::vector< ref_ptr< Object > > get_args()=0
virtual ref_ptr< Descriptor > get_desc_or_default()=0
virtual ref_ptr< Descriptor > get_desc()=0
~ScheduleTask() override=default
virtual std::string get_name()=0
virtual std::string get_key()=0
Object with sequence of steps with tasks forming schedule for execution.
Definition schedule.hpp:64
~Schedule() override=default
virtual Status step_task(ref_ptr< ScheduleTask > task)=0
virtual Status submit()=0
virtual Status step_tasks(std::vector< ref_ptr< ScheduleTask > > tasks)=0
Automates reference counting and behaves as shared smart pointer.
Definition ref.hpp:117
#define SPLA_API
Definition config.hpp:43
ref_ptr< Schedule > make_schedule()
Makes new schedule for making execution schedule.
Definition schedule.cpp:34
Definition algorithm.hpp:37