interface ngraph::snippets::TargetMachine

Overview

Base class Target machine representation. Target derives from this class to provide generator information about supported emitters. More…

#include <generator.hpp>

template TargetMachine
{
    // methods

    virtual bool is_supported() const = 0;
    virtual code get_snippet() const = 0;
    virtual size_t get_lanes() const = 0;
    std::function<std::shared_ptr<Emitter>(std::shared_ptr<ngraph::Node>)> get(const ngraph::DiscreteTypeInfo type) const;
    bool has(const ngraph::DiscreteTypeInfo type) const;
};

Detailed Documentation

Base class Target machine representation. Target derives from this class to provide generator information about supported emitters.

Methods

virtual bool is_supported() const = 0

checks if target is natively supported

Returns:

true, if supported

virtual code get_snippet() const = 0

finalizes code generation

Returns:

generated kernel binary

virtual size_t get_lanes() const = 0

gets number of lanes supported by target’s vector ISA

Returns:

number of lanes

std::function<std::shared_ptr<Emitter>(std::shared_ptr<ngraph::Node>)> get(const ngraph::DiscreteTypeInfo type) const

called by generator to all the emitter for a target machine

Returns:

a map by node’s type info with callbacks to create an instance of emitter for corresponding operation type

bool has(const ngraph::DiscreteTypeInfo type) const

checks if emitter for a specific operation is supported

Returns:

true, if supported