EngineFactory.cpp 1.0 KB
Newer Older
G
groot 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
/*******************************************************************************
 * Copyright 上海赜睿信息科技有限公司(Zilliz) - All Rights Reserved
 * Unauthorized copying of this file, via any medium is strictly prohibited.
 * Proprietary and confidential.
 ******************************************************************************/
#include "EngineFactory.h"
#include "FaissExecutionEngine.h"
#include "Log.h"

namespace zilliz {
namespace vecwise {
namespace engine {

ExecutionEnginePtr
EngineFactory::Build(uint16_t dimension,
        const std::string& location,
        EngineType type) {
    switch(type) {
        case EngineType::FAISS_IDMAP:
            return ExecutionEnginePtr(new FaissExecutionEngine(dimension, location, "IDMap", "IDMap,Flat"));
        case EngineType::FAISS_IVFFLAT:
            return ExecutionEnginePtr(new FaissExecutionEngine(dimension, location, "IVF", "IDMap,Flat"));
        default:
            ENGINE_LOG_ERROR << "Unsupportted engine type";
            return nullptr;
    }
}

}
}
}