Poplar and PopLibs
ScaledAdd.hpp
Go to the documentation of this file.
1// Copyright (c) 2017 Graphcore Ltd. All rights reserved.
8#ifndef popops_ScaledAdd_hpp
9#define popops_ScaledAdd_hpp
10#include <poplar/Graph.hpp>
11#include <poplar/OptionFlags.hpp>
12#include <poplar/Program.hpp>
13#include <string>
14
15namespace popops {
16
17enum class ScaledAddSpecialisation { DEFAULT, X_MINUS_AX_PLUS_BY };
18
55 float scaleB, poplar::program::Sequence &prog,
56 const poplar::DebugContext &debugContext = {},
57 const poplar::OptionFlags &options = {});
58
81 const poplar::DebugContext &debugContext = {},
82 const poplar::OptionFlags &options = {});
83
104 poplar::Tensor B, float scaleB,
106 const poplar::DebugContext &debugContext = {},
107 const poplar::OptionFlags &options = {});
108
132 const poplar::DebugContext &debugContext = {},
133 const poplar::OptionFlags &options = {});
134
160 const poplar::DebugContext &debugContext = {},
161 const poplar::OptionFlags &options = {});
162
190 const ScaledAddSpecialisation speciality,
191 const poplar::DebugContext &debugContext = {},
192 const poplar::OptionFlags &options = {});
193
216void scaledAddTo(poplar::Graph &graph, poplar::Tensor A, float scaleA,
217 poplar::Tensor B, float scaleB,
219 const poplar::DebugContext &debugContext = {},
220 const poplar::OptionFlags &options = {});
221
246void scaledAddTo(poplar::Graph &graph, poplar::Tensor A, float scaleA,
247 poplar::Tensor B, float scaleB,
249 const ScaledAddSpecialisation speciality,
250 const poplar::DebugContext &debugContext = {},
251 const poplar::OptionFlags &options = {});
252
278 const poplar::DebugContext &debugContext = {},
279 const poplar::OptionFlags &options = {});
280
305 poplar::Tensor B, float scaleB,
307 const poplar::DebugContext &debugContext = {},
308 const poplar::OptionFlags &options = {});
309} // namespace popops
310
311#endif // popops_ScaledAdd_hpp
DebugContext gathers the common external parameters of the context of an operation.
Definition: DebugContext.hpp:221
This class represents a graph program to be executed on the IPU.
Definition: Graph.hpp:52
A set of option/value string flags to be used in various APIs.
Definition: OptionFlags.hpp:24
A reference to a subset of tensor elements.
Definition: Tensor.hpp:38
Program that executes a sequence of programs.
Definition: Program.hpp:77
Common functions, such as elementwise and reductions.
Definition: AllTrue.hpp:15
void scaledAddTo(poplar::Graph &graph, poplar::Tensor A, poplar::Tensor B, float scaleB, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext={}, const poplar::OptionFlags &options={})
Add the elements of one tensor multiplied by a scalar to another tensor.
void scaledSubtractFrom(poplar::Graph &graph, poplar::Tensor A, poplar::Tensor B, float scaleB, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext={}, const poplar::OptionFlags &options={})
Subtract the elements of one tensor multiplied by a scalar from another tensor.