Task.h 1020 字节
Newer Older
W
wxyu 已提交
1 2 3 4 5 6 7 8 9
/*******************************************************************************
 * Copyright 上海赜睿信息科技有限公司(Zilliz) - All Rights Reserved
 * Unauthorized copying of this file, via any medium is strictly prohibited.
 * Proprietary and confidential.
 ******************************************************************************/
#pragma once

#include <string>
#include <memory>
10 11
#include <src/db/scheduler/context/SearchContext.h>
#include "src/db/scheduler/task/IScheduleTask.h"
W
wxyu 已提交
12 13 14 15 16 17


namespace zilliz {
namespace milvus {
namespace engine {

18 19 20 21 22 23 24 25 26 27
enum class LoadType {
    DISK2CPU,
    CPU2GPU,
    GPU2CPU,
};

class Task;

using TaskPtr = std::shared_ptr<Task>;

W
wxyu 已提交
28 29
class Task {
public:
30
    Task() = default;
W
wxyu 已提交
31

32 33 34 35 36 37
    virtual void
    Load(LoadType type, uint8_t device_id) = 0;

    virtual void
    Execute() = 0;

W
wxyu 已提交
38
    // TODO: dont use this method to support task move
W
wxyu 已提交
39 40 41
    virtual TaskPtr
    Clone() = 0;

42 43 44
public:
    std::vector<SearchContextPtr> search_contexts_;
    ScheduleTaskPtr task_;
W
wxyu 已提交
45 46 47 48 49 50
};


}
}
}