Unverified Commit 93d91734 authored by Robert Kimball's avatar Robert Kimball Committed by GitHub

Merge pull request #3088 from NervanaSystems/bob/async

First cut at async interface for backend tensor allocation and execution
parents 8aa14954 9b82f8a1
......@@ -123,3 +123,25 @@ void runtime::Executable::save(std::ostream& output_stream)
{
throw runtime_error("save opertion unimplemented.");
}
shared_ptr<runtime::Tensor> runtime::Executable::create_input_tensor(size_t input_index)
{
throw runtime_error("create_input_tensor unimplemented");
}
shared_ptr<runtime::Tensor> runtime::Executable::create_output_tensor(size_t output_index)
{
throw runtime_error("create_output_tensor unimplemented");
}
vector<shared_ptr<runtime::Tensor>> runtime::Executable::create_input_tensor(size_t input_index,
size_t pipeline_depth)
{
throw runtime_error("create_input_tensor unimplemented");
}
vector<shared_ptr<runtime::Tensor>> runtime::Executable::create_output_tensor(size_t output_index,
size_t pipeline_depth)
{
throw runtime_error("create_output_tensor unimplemented");
}
......@@ -73,6 +73,36 @@ public:
/// Saved stream may be read with Backend::load
virtual void save(std::ostream& output_stream);
/// \brief Create an input Tensor
/// \param input_index The index position in the input Parameter vector. This would be the same
/// order of Parameters passed into the inputs in the call() method.
/// \returns A Tensor
virtual std::shared_ptr<runtime::Tensor> create_input_tensor(size_t input_index);
/// \brief Create an output Tensor
/// \param output_index The index position in the output Result vector. This would be the same
/// order of Results passed into the outputs in the call() method.
/// \returns A Tensor
virtual std::shared_ptr<runtime::Tensor> create_output_tensor(size_t output_index);
/// \brief Create a vector of input Tensors
/// \param input_index The index position in the input Parameter vector. This would be the same
/// order of Parameters passed into the inputs in the call() method.
/// \param pipeline_depth The number of stages in the input pipeline. For double-buffered input
/// you would specify pipeline_depth=2
/// \returns A vector of Tensors, one for each stage of the pipeline
virtual std::vector<std::shared_ptr<runtime::Tensor>>
create_input_tensor(size_t input_index, size_t pipeline_depth);
/// \brief Create a vector of output Tensors
/// \param output_index The index position in the output Result vector. This would be the same
/// order of Results passed into the outputs in the call() method.
/// \param pipeline_depth The number of stages in the output pipeline. For double-buffered output
/// you would specify pipeline_depth=2
/// \returns A vector of Tensors, one for each stage of the pipeline
virtual std::vector<std::shared_ptr<runtime::Tensor>>
create_output_tensor(size_t output_index, size_t pipeline_depth);
protected:
/// \brief Called at the end of compile to the values to be returned by get_parameters
/// and get_results
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment