C++ Reference
shape
-
enum migraphx_shape_datatype_t
An enum to represent the different data type inputs.
Values:
-
enumerator migraphx_shape_tuple_type
-
enumerator migraphx_shape_bool_type
-
enumerator migraphx_shape_half_type
-
enumerator migraphx_shape_float_type
-
enumerator migraphx_shape_double_type
-
enumerator migraphx_shape_uint8_type
-
enumerator migraphx_shape_int8_type
-
enumerator migraphx_shape_uint16_type
-
enumerator migraphx_shape_int16_type
-
enumerator migraphx_shape_int32_type
-
enumerator migraphx_shape_int64_type
-
enumerator migraphx_shape_uint32_type
-
enumerator migraphx_shape_uint64_type
-
enumerator migraphx_shape_tuple_type
-
struct migraphx::shape : public migraphx::handle_base<>
Describe shape of tensor.
A shape consists of a data type, lengths of multi-dimension tensor, and strides
Public Functions
-
inline shape()
-
inline shape(const migraphx_shape *p)
-
inline shape(migraphx_shape *p, own)
-
inline shape(migraphx_shape *p, borrow)
-
inline shape(migraphx_shape_datatype_t type)
Construct a scalar shape.
-
inline shape(migraphx_shape_datatype_t type, std::vector<size_t> plengths)
Construct a shape with its type and lengths. The strides are automatically computed assumming a packed layout.
-
inline shape(migraphx_shape_datatype_t type, std::vector<size_t> plengths, std::vector<size_t> pstrides)
-
inline std::vector<size_t> lengths() const
-
inline std::vector<size_t> strides() const
-
inline migraphx_shape_datatype_t type() const
-
inline size_t bytes() const
Friends
- inline friend friend bool operator== (const shape &px, const shape &py)
- inline friend friend bool operator!= (const shape &px, const shape &py)
-
inline shape()
argument
-
struct migraphx::argument : public migraphx::handle_base<>
Arguments to be passed to an migraphx arguments.
An
argumentrepresents a raw buffer of data with a shape.Public Functions
-
inline argument()
-
inline argument(migraphx_argument *p, borrow)
-
inline argument(migraphx_argument *p, own)
-
inline argument(const migraphx_argument *p)
-
inline char *data() const
Public Static Functions
Friends
- inline friend friend bool operator== (const argument &px, const argument &py)
- inline friend friend bool operator!= (const argument &px, const argument &py)
-
inline argument()
target
-
struct migraphx::target : public migraphx::handle_base<>
A target for compilation.
program
-
struct migraphx::program_parameter_shapes : public migraphx::handle_base<>
-
struct migraphx::program_parameters : public migraphx::handle_base<>
A class to construct the inputs parameters for a program.
Public Functions
-
inline program_parameters(migraphx_program_parameters *p, own)
-
inline program_parameters(migraphx_program_parameters *p, borrow)
-
inline program_parameters(migraphx_program_parameters *p)
-
inline program_parameters()
-
inline program_parameters(migraphx_program_parameters *p, own)
-
struct migraphx::program : public migraphx::handle_base<>
A program represents the all computation graphs to be compiled and executed.
Public Functions
-
inline program()
-
inline program(migraphx_program *p, own)
-
inline program(migraphx_program *p, borrow)
-
inline void compile(const target &ptarget, const compile_options &poptions) const
Compile the program for a specific target to be ran on.
-
inline void compile(const target &ptarget) const
Compile the program for a specific target to be ran on.
-
inline program_parameter_shapes get_parameter_shapes() const
Return the shapes for the input parameters.
-
inline shapes get_output_shapes() const
Get the shapes of all the outputs returned by this program.
-
inline arguments eval(const program_parameters &pparams) const
Run the program using the inputs passed in.
-
inline void print() const
-
inline module get_main_module()
Friends
- inline friend friend bool operator== (const program &px, const program &py)
- inline friend friend bool operator!= (const program &px, const program &py)
-
inline program()
quantize
-
struct migraphx::quantize_op_names : public migraphx::handle_base<>
-
inline void migraphx::quantize_fp16(const program &prog, const quantize_op_names &names)
Quantize program to use fp16.
-
struct migraphx::quantize_int8_options : public migraphx::handle_base<>
Options to be passed when quantizing for int8.
Public Functions
-
inline quantize_int8_options()
-
inline quantize_int8_options(migraphx_quantize_int8_options *p, own)
-
inline quantize_int8_options(migraphx_quantize_int8_options *p, borrow)
-
inline void add_op_name(const std::string &name)
Add an operator that should be quantized.
-
inline void add_calibration_data(const program_parameters &pp)
Add calibrartion data to be used for quantizing.
-
inline quantize_int8_options()
-
inline void migraphx::quantize_int8(const program &prog, const target &ptarget, const quantize_int8_options &options)
Quantize program to use int8.
parse_onnx
-
struct migraphx::onnx_options : public migraphx::handle_base<>
Options for parsing onnx options.
Public Functions
-
inline onnx_options()
-
inline onnx_options(migraphx_onnx_options *p, own)
-
inline void set_input_parameter_shape(const std::string &name, std::vector<std::size_t> dim)
Make onnx parser treat an inputs with a certain dimensions.
-
inline void set_default_dim_value(unsigned int value)
When there is a dimension parameter, then use this default value.
-
inline void set_default_loop_iterations(int64_t value)
Set default max iteration number for the loop operator.
-
inline onnx_options()
-
inline program migraphx::parse_onnx(const char *filename)
Parse an onnx file into a migraphx program.
-
inline program migraphx::parse_onnx(const char *filename, const migraphx::onnx_options &options)
Parse an onnx file into a migraphx program.
-
inline program migraphx::parse_onnx_buffer(const std::string &buffer)
Parse a buffer of memory as an onnx file.
-
inline program migraphx::parse_onnx_buffer(const std::string &buffer, const migraphx::onnx_options &options)
Parse a buffer of memory as an onnx file.
-
inline program migraphx::parse_onnx_buffer(const void *data, size_t size)
Parse a buffer of memory as an onnx file.
-
inline program migraphx::parse_onnx_buffer(const void *data, size_t size, const migraphx::onnx_options &options)
Parse a buffer of memory as an onnx file.
load
Warning
doxygenfunction: Unable to resolve function “migraphx::load” with arguments (const char*, migraphx_file_options) in doxygen xml output for project “proj” from directory: /code/AMDMIGraphX/build/doc/doxygen/xml. Potential matches:
- program load(const char *filename)
- program load(const char *filename, const file_options &options)
save
Warning
doxygenfunction: Unable to resolve function “migraphx::save” with arguments (const program&, const char*, migraphx_file_options) in doxygen xml output for project “proj” from directory: /code/AMDMIGraphX/build/doc/doxygen/xml. Potential matches:
- void save(const program &p, const char *filename)
- void save(const program &p, const char *filename, const file_options &options)