IRGenerator.hpp 1.73 KB
Newer Older
1
2
3
4
5
6
7
8
/*******************************************************************************
 * Copyright (c) 2017 UT-Battelle, LLC.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * and Eclipse Distribution License v1.0 which accompanies this
 * distribution. The Eclipse Public License is available at
 * http://www.eclipse.org/legal/epl-v10.html and the Eclipse Distribution License
 * is available at https://eclipse.org/org/documents/edl-v10.php
9
10
 *
 * Contributors:
11
12
 *   Alexander J. McCaskey - initial API and implementation
 *******************************************************************************/
13
14
#ifndef IR_IRGENERATOR_HPP_
#define IR_IRGENERATOR_HPP_
15

16
#include "AcceleratorBuffer.hpp"
17
#include "Function.hpp"
Mccaskey, Alex's avatar
Mccaskey, Alex committed
18
#include "Identifiable.hpp"
19
20
#include <vector>
#include <memory>
21
22
23

namespace xacc {

24
/**
25
26
 * The IRGenerator interface provides a mechanism for
 * generating common algorithms modeled as an XACC Function instance.
27
28
29
 *
 * @author Alex McCaskey
 */
30
class IRGenerator : public Identifiable {
31
32
33

public:

34
35
36
37
	/**
	 * Implementations of this method generate a Function IR
	 * instance corresponding to the implementation's modeled
	 * algorithm. The algorithm is specified to operate over the
38
39
	 * provided AcceleratorBuffer and can take an optional
	 * vector of InstructionParameters.
40
41
42
43
	 *
	 * @param bits The bits this algorithm operates on
	 * @return function The algorithm represented as an IR Function
	 */
44
45
46
47
	virtual std::shared_ptr<Function> generate(
			std::shared_ptr<AcceleratorBuffer> buffer,
			std::vector<InstructionParameter> parameters = std::vector<
					InstructionParameter> { }) = 0;
48

49
50
51
	/**
	 * The destructor
	 */
52
	virtual ~IRGenerator() {}
53
54
55
56
};

}
#endif