Poplar and PopLibs
Cast.hpp
Go to the documentation of this file.
1// Copyright (c) 2016 Graphcore Ltd. All rights reserved.
8#ifndef popops_Cast_hpp
9#define popops_Cast_hpp
10
11#include <poplar/Graph.hpp>
12#include <poplar/Interval.hpp>
13#include <poplar/Program.hpp>
14#include <vector>
15
16namespace popops {
17
31 const poplar::Type &dstType,
33 const poplar::DebugContext &debugContext = {});
34
52 const poplar::Type &dstType, const poplar::Tensor &metadata,
54 const poplar::DebugContext &debugContext = {});
55
72 const poplar::DebugContext &debugContext = {});
73
87
100 const poplar::Type &dstType, poplar::ComputeSet cs,
101 const poplar::DebugContext &debugContext = {});
102
119 const poplar::Type &dstType, const poplar::Tensor &metadata,
121 const poplar::DebugContext &debugContext = {});
122
145 poplar::Type outputType, double tolerance,
147 const poplar::DebugContext &debugContext = {});
148
149} // namespace popops
150
151#endif // popops_Cast_hpp
A reference to a compute set within a graph.
Definition: GraphElements.hpp:131
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 reference to a subset of tensor elements.
Definition: Tensor.hpp:38
Class representing device data types.
Definition: Type.hpp:42
This class represents a control program that executes operations on the graph.
Definition: Program.hpp:30
Program that executes a sequence of programs.
Definition: Program.hpp:77
Common functions, such as elementwise and reductions.
Definition: AllTrue.hpp:15
poplar::Tensor checkAccuracyWhenCast(poplar::Graph &graph, const poplar::Tensor &input, poplar::Type outputType, double tolerance, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext={})
Helper function which checks the relative error in the tensor input when casting it to type outputTyp...
poplar::Tensor cast(poplar::Graph &graph, const poplar::Tensor &src, const poplar::Type &dstType, poplar::program::Sequence &prog, const poplar::DebugContext &debugContext={})
Cast elements of the specified src tensor to dstType, returning the result as a new tensor.