diff --git a/mindspore/core/abstract/abstract_function.h b/mindspore/core/abstract/abstract_function.h index 0d59421155..1e6bce66b9 100644 --- a/mindspore/core/abstract/abstract_function.h +++ b/mindspore/core/abstract/abstract_function.h @@ -28,7 +28,7 @@ namespace mindspore { namespace abstract { -class AbstractFuncAtom : public AbstractFunction { +class MS_CORE_API AbstractFuncAtom : public AbstractFunction { public: AbstractFuncAtom() = default; ~AbstractFuncAtom() override = default; @@ -42,7 +42,7 @@ class AbstractFuncAtom : public AbstractFunction { std::size_t hash() const override { return tid(); } }; -class AbstractFuncUnion : public AbstractFunction { +class MS_CORE_API AbstractFuncUnion : public AbstractFunction { public: explicit AbstractFuncUnion(const AbstractFuncAtomPtrList &func_list); AbstractFuncUnion(const AbstractFunctionPtr &first, const AbstractFunctionPtr &second); @@ -63,7 +63,7 @@ class AbstractFuncUnion : public AbstractFunction { AbstractFuncAtomPtrList func_list_; }; -class PrimitiveAbstractClosure : public AbstractFuncAtom { +class MS_CORE_API PrimitiveAbstractClosure : public AbstractFuncAtom { public: // Represents a Primitive. // prim: The primitive @@ -96,7 +96,7 @@ class PrimitiveAbstractClosure : public AbstractFuncAtom { }; using PrimitiveAbstractClosurePtr = std::shared_ptr; -class FuncGraphAbstractClosure : public AbstractFuncAtom { +class MS_CORE_API FuncGraphAbstractClosure : public AbstractFuncAtom { public: // Represents a Graph in a certain Context. // context: The context, or Context.empty() @@ -140,7 +140,7 @@ class FuncGraphAbstractClosure : public AbstractFuncAtom { }; using FuncGraphAbstractClosurePtr = std::shared_ptr; -class MetaFuncGraphAbstractClosure : public AbstractFuncAtom { +class MS_CORE_API MetaFuncGraphAbstractClosure : public AbstractFuncAtom { public: explicit MetaFuncGraphAbstractClosure(const MetaFuncGraphPtr &meta_func_graph, const AnfNodePtr &tracking_id = nullptr, const ScopePtr &scope = kDefaultScope) @@ -173,7 +173,7 @@ class MetaFuncGraphAbstractClosure : public AbstractFuncAtom { }; using MetaFuncGraphAbstractClosurePtr = std::shared_ptr; -class PartialAbstractClosure : public AbstractFuncAtom { +class MS_CORE_API PartialAbstractClosure : public AbstractFuncAtom { public: // Represents a partial application. // args_spec_list: The first few arguments of that function @@ -204,7 +204,7 @@ class PartialAbstractClosure : public AbstractFuncAtom { }; using PartialAbstractClosurePtr = std::shared_ptr; -class JTransformedAbstractClosure : public AbstractFuncAtom { +class MS_CORE_API JTransformedAbstractClosure : public AbstractFuncAtom { public: // Represents a Function transformed through the application of J. explicit JTransformedAbstractClosure(const AbstractFuncAtomPtr &fn) : fn_(fn) {} @@ -222,7 +222,7 @@ class JTransformedAbstractClosure : public AbstractFuncAtom { AbstractFuncAtomPtr fn_; }; -class VirtualAbstractClosure : public AbstractFuncAtom { +class MS_CORE_API VirtualAbstractClosure : public AbstractFuncAtom { public: // Represents some function with an explicitly fixed type signature. // args_spec_list: The arguments as abstract value given to the function @@ -251,7 +251,7 @@ class VirtualAbstractClosure : public AbstractFuncAtom { }; using VirtualAbstractClosurePtr = std::shared_ptr; -class TypedPrimitiveAbstractClosure : public AbstractFuncAtom { +class MS_CORE_API TypedPrimitiveAbstractClosure : public AbstractFuncAtom { public: // Represents a Primitive with an explicitly fixed type signature. // args_spec_list: The arguments as abstract value given to the Primitive @@ -280,7 +280,7 @@ class TypedPrimitiveAbstractClosure : public AbstractFuncAtom { }; // Represents a function that can't be called. -class DummyAbstractClosure : public AbstractFuncAtom { +class MS_CORE_API DummyAbstractClosure : public AbstractFuncAtom { public: DummyAbstractClosure() = default; ~DummyAbstractClosure() override = default; @@ -292,14 +292,14 @@ class DummyAbstractClosure : public AbstractFuncAtom { std::string ToString() const override { return "DummyAbstractClosure()"; } }; -struct AbstractFunctionHasher { +struct MS_CORE_API AbstractFunctionHasher { std::size_t operator()(const AbstractFunctionPtr &t) const { std::size_t hash = t->hash(); return hash; } }; -struct AbstractFunctionEqual { +struct MS_CORE_API AbstractFunctionEqual { bool operator()(const AbstractFunctionPtr &lhs, const AbstractFunctionPtr &rhs) const { return *lhs == *rhs; } }; } // namespace abstract diff --git a/mindspore/core/abstract/abstract_value.h b/mindspore/core/abstract/abstract_value.h index d3b4355bd9..c34526cf20 100644 --- a/mindspore/core/abstract/abstract_value.h +++ b/mindspore/core/abstract/abstract_value.h @@ -43,7 +43,7 @@ using AbstractBasePtrList = std::vector; // The base class for abstract value. The abstract value is used in evaluating // to express the type, shape, and value of the real value. -class AbstractBase : public Base { +class MS_CORE_API AbstractBase : public Base { public: using TraceNodeProvider = std::function; @@ -101,7 +101,7 @@ class AbstractBase : public Base { std::string value_desc_; // store initial value description for error report }; -class AbstractScalar : public AbstractBase { +class MS_CORE_API AbstractScalar : public AbstractBase { public: AbstractScalar() : AbstractBase(kAnyValue, kAnyType) {} explicit AbstractScalar(const ValuePtr &value, const TypePtr &type) : AbstractBase(value, type) {} @@ -127,7 +127,7 @@ class AbstractScalar : public AbstractBase { }; using AbstractScalarPtr = std::shared_ptr; -class AbstractType : public AbstractBase { +class MS_CORE_API AbstractType : public AbstractBase { public: explicit AbstractType(const TypePtr &type) : AbstractBase(type, kTypeType) { if (type == nullptr) { @@ -146,7 +146,7 @@ class AbstractType : public AbstractBase { }; using AbstractTypePtr = std::shared_ptr; -class AbstractError : public AbstractBase { +class MS_CORE_API AbstractError : public AbstractBase { public: explicit AbstractError(const StringImmPtr &err, const AnfNodePtr &node) : AbstractBase(err), node_(node) { if (err == nullptr || node == nullptr) { @@ -181,7 +181,7 @@ class AbstractFuncAtom; using AbstractFuncAtomPtr = std::shared_ptr; using AbstractFuncAtomPtrList = std::vector; -class AbstractFunction : public AbstractBase { +class MS_CORE_API AbstractFunction : public AbstractBase { public: AbstractFunction() = default; ~AbstractFunction() override = default; @@ -215,7 +215,7 @@ class AbstractFunction : public AbstractBase { using AbstractFunctionPtrList = std::vector; // Represents a key-value pair used in function's parameters. -class AbstractKeywordArg : public AbstractBase { +class MS_CORE_API AbstractKeywordArg : public AbstractBase { public: AbstractKeywordArg(const std::string &key, const AbstractBasePtr &argument) : arg_name_(key), arg_value_(argument) {} ~AbstractKeywordArg() override = default; @@ -242,7 +242,7 @@ class AbstractKeywordArg : public AbstractBase { }; using AbstractKeywordArgPtr = std::shared_ptr; -class AbstractUndetermined : public AbstractBase { +class MS_CORE_API AbstractUndetermined : public AbstractBase { public: // shape and type are all unknown AbstractUndetermined() : AbstractBase(kAnyValue) {} @@ -291,7 +291,7 @@ class AbstractUndetermined : public AbstractBase { AbstractBasePtr element_; }; -class AbstractTensor : public AbstractUndetermined { +class MS_CORE_API AbstractTensor : public AbstractUndetermined { public: // only element_ and value, shape track are valid member, type track are unknown. explicit AbstractTensor(const AbstractBasePtr &element, const BaseShapePtr &shape = std::make_shared()) @@ -340,7 +340,7 @@ class AbstractTensor : public AbstractUndetermined { using AbstractTensorPtr = std::shared_ptr; using AbstractTensorPtrList = std::vector; -class AbstractSequeue : public AbstractBase { +class MS_CORE_API AbstractSequeue : public AbstractBase { public: explicit AbstractSequeue(const AbstractBasePtrList &elements) : elements_(elements) {} ~AbstractSequeue() override = default; @@ -371,7 +371,7 @@ class AbstractSequeue : public AbstractBase { }; using AbstractSequeuePtr = std::shared_ptr; -class AbstractTuple : public AbstractSequeue { +class MS_CORE_API AbstractTuple : public AbstractSequeue { public: explicit AbstractTuple(const AbstractBasePtrList &elements) : AbstractSequeue(elements) {} @@ -400,7 +400,7 @@ class AbstractTuple : public AbstractSequeue { }; using AbstractTuplePtr = std::shared_ptr; -class AbstractList : public AbstractSequeue { +class MS_CORE_API AbstractList : public AbstractSequeue { public: explicit AbstractList(const AbstractBasePtrList &elements) : AbstractSequeue(elements) {} @@ -430,7 +430,7 @@ class AbstractList : public AbstractSequeue { }; using AbstractListPtr = std::shared_ptr; -class AbstractClass : public AbstractBase { +class MS_CORE_API AbstractClass : public AbstractBase { public: AbstractClass(const Named &tag, const std::vector &attributes, const std::unordered_map &methods) @@ -462,7 +462,7 @@ class AbstractClass : public AbstractBase { }; using AbstractClassPtr = std::shared_ptr; -class AbstractDictionary : public AbstractBase { +class MS_CORE_API AbstractDictionary : public AbstractBase { public: explicit AbstractDictionary(const std::vector &key_values) : key_values_(key_values) {} ~AbstractDictionary() override = default; @@ -485,7 +485,7 @@ class AbstractDictionary : public AbstractBase { }; using AbstractDictionaryPtr = std::shared_ptr; -class AbstractSlice : public AbstractBase { +class MS_CORE_API AbstractSlice : public AbstractBase { public: AbstractSlice(const AbstractBasePtr &start, const AbstractBasePtr &stop, const AbstractBasePtr &step) : start_(start), stop_(stop), step_(step) {} @@ -513,7 +513,7 @@ class AbstractSlice : public AbstractBase { }; using AbstractSlicePtr = std::shared_ptr; -class AbstractJTagged : public AbstractBase { +class MS_CORE_API AbstractJTagged : public AbstractBase { public: explicit AbstractJTagged(const AbstractBasePtr &element) : element_(element) {} @@ -536,7 +536,7 @@ class AbstractJTagged : public AbstractBase { }; using AbstractJTaggedPtr = std::shared_ptr; -class AbstractNone : public AbstractBase { +class MS_CORE_API AbstractNone : public AbstractBase { public: AbstractNone() : AbstractBase() { set_type(std::make_shared()); } ~AbstractNone() override = default; @@ -554,7 +554,7 @@ class AbstractNone : public AbstractBase { using AbstractNonePtr = std::shared_ptr; // the un assigned state value for variable, which means the variable is not assigned -class AbstractNull : public AbstractBase { +class MS_CORE_API AbstractNull : public AbstractBase { public: AbstractNull() : AbstractBase(kNull) { set_type(std::make_shared()); } ~AbstractNull() override = default; @@ -569,7 +569,7 @@ class AbstractNull : public AbstractBase { using AbstractNullPtr = std::shared_ptr; // the timeout state value for variable, which means the variable is not assigned because it is timeout -class AbstractTimeOut : public AbstractBase { +class MS_CORE_API AbstractTimeOut : public AbstractBase { public: AbstractTimeOut() : AbstractBase(kNull) { set_type(std::make_shared()); } ~AbstractTimeOut() override = default; @@ -583,7 +583,7 @@ class AbstractTimeOut : public AbstractBase { }; using AbstractTimeOutPtr = std::shared_ptr; -class AbstractEllipsis : public AbstractBase { +class MS_CORE_API AbstractEllipsis : public AbstractBase { public: AbstractEllipsis() : AbstractBase(kEllipsis) { set_type(std::make_shared()); } ~AbstractEllipsis() override = default; @@ -597,7 +597,7 @@ class AbstractEllipsis : public AbstractBase { }; using AbstractEllipsisPtr = std::shared_ptr; -class AbstractRefKey : public AbstractBase { +class MS_CORE_API AbstractRefKey : public AbstractBase { public: AbstractRefKey() : AbstractBase(), ref_key_value_(nullptr) { set_type(std::make_shared()); } ~AbstractRefKey() override = default; @@ -627,7 +627,7 @@ class AbstractRefKey : public AbstractBase { }; using AbstractRefKeyPtr = std::shared_ptr; -class AbstractRef : public AbstractTensor { +class MS_CORE_API AbstractRef : public AbstractTensor { public: AbstractRef(const AbstractBasePtr &ref_key, const AbstractTensorPtr &ref_value); ~AbstractRef() override = default; @@ -669,19 +669,19 @@ class AbstractRef : public AbstractTensor { }; using AbstractRefPtr = std::shared_ptr; -struct AbstractBasePtrListHasher { +struct MS_CORE_API AbstractBasePtrListHasher { std::size_t operator()(const AbstractBasePtrList &args_spec_list) const; }; -struct AbstractBasePtrListEqual { +struct MS_CORE_API AbstractBasePtrListEqual { bool operator()(const AbstractBasePtrList &lhs, const AbstractBasePtrList &rhs) const; }; -std::size_t AbstractBasePtrListHash(const AbstractBasePtrList &args_spec_list); -bool AbstractBasePtrListDeepEqual(const AbstractBasePtrList &lhs, const AbstractBasePtrList &rhs); +MS_CORE_API std::size_t AbstractBasePtrListHash(const AbstractBasePtrList &args_spec_list); +MS_CORE_API bool AbstractBasePtrListDeepEqual(const AbstractBasePtrList &lhs, const AbstractBasePtrList &rhs); // RowTensor -class AbstractRowTensor : public AbstractUndetermined { +class MS_CORE_API AbstractRowTensor : public AbstractUndetermined { public: explicit AbstractRowTensor(const AbstractBasePtr &element, const BaseShapePtr &shape = std::make_shared()) : AbstractUndetermined(element, shape) {} @@ -710,7 +710,7 @@ class AbstractRowTensor : public AbstractUndetermined { }; // SparseTensor -class AbstractSparseTensor : public AbstractUndetermined { +class MS_CORE_API AbstractSparseTensor : public AbstractUndetermined { public: explicit AbstractSparseTensor(const AbstractBasePtr &element, const BaseShapePtr &shape = std::make_shared()) : AbstractUndetermined(element, shape) {} diff --git a/mindspore/core/abstract/dshape.h b/mindspore/core/abstract/dshape.h index 071c3cd1a1..a2d751fd78 100644 --- a/mindspore/core/abstract/dshape.h +++ b/mindspore/core/abstract/dshape.h @@ -37,7 +37,7 @@ class BaseShape; using BaseShapePtr = std::shared_ptr; using BaseShapePtrList = std::vector; -class BaseShape : public Base { +class MS_CORE_API BaseShape : public Base { public: BaseShape() = default; ~BaseShape() override = default; @@ -53,7 +53,7 @@ class BaseShape : public Base { virtual void Broaden() {} }; -class NoShape : public BaseShape { +class MS_CORE_API NoShape : public BaseShape { public: MS_DECLARE_PARENT(NoShape, BaseShape) BaseShapePtr Clone() const override { return std::make_shared(); } @@ -62,7 +62,7 @@ class NoShape : public BaseShape { }; extern const std::shared_ptr kNoShape; -class Shape : public BaseShape { +class MS_CORE_API Shape : public BaseShape { public: static const int64_t SHP_ANY = -1; Shape() : shape_() {} @@ -93,7 +93,7 @@ class Shape : public BaseShape { using ShapePtr = std::shared_ptr; using ShapePtrList = std::vector; -class SequeueShape : public BaseShape { +class MS_CORE_API SequeueShape : public BaseShape { public: SequeueShape() : p_shapes_() {} explicit SequeueShape(const BaseShapePtrList &shapes) : p_shapes_(shapes) {} @@ -118,7 +118,7 @@ class SequeueShape : public BaseShape { }; using SequeueShapePtr = std::shared_ptr; -class TupleShape : public SequeueShape { +class MS_CORE_API TupleShape : public SequeueShape { public: TupleShape() : SequeueShape() {} explicit TupleShape(const BaseShapePtrList &shapes) : SequeueShape(shapes) {} @@ -133,7 +133,7 @@ class TupleShape : public SequeueShape { }; using TupleShapePtr = std::shared_ptr; -class ListShape : public SequeueShape { +class MS_CORE_API ListShape : public SequeueShape { public: ListShape() : SequeueShape() {} explicit ListShape(const BaseShapePtrList &shapes) : SequeueShape(shapes) {} diff --git a/mindspore/core/api/ir/func_graph.h b/mindspore/core/api/ir/func_graph.h index c2fd0d8e8a..d1e9c6bbb0 100644 --- a/mindspore/core/api/ir/func_graph.h +++ b/mindspore/core/api/ir/func_graph.h @@ -21,11 +21,12 @@ #include #include +#include "utils/visible.h" #include "api/ir/func_graph_manager.h" namespace mindspore::api { -class FuncGraph { +class MS_CORE_API FuncGraph { public: FuncGraph() = default; virtual ~FuncGraph() = default; @@ -45,6 +46,8 @@ class FuncGraph { virtual void set_attr(const std::string &key, const ValuePtr &value) = 0; virtual FuncGraphManagerPtr get_manager() const = 0; + + static std::vector TopoSort(const AnfNodePtr &node); }; } // namespace mindspore::api #endif // MINDSPORE_CORE_API_IR_FUNC_GRAPH_H_ diff --git a/mindspore/core/api/ir/func_graph_manager.h b/mindspore/core/api/ir/func_graph_manager.h index e1dbe4952b..f399d4e724 100644 --- a/mindspore/core/api/ir/func_graph_manager.h +++ b/mindspore/core/api/ir/func_graph_manager.h @@ -20,6 +20,7 @@ #include #include +#include "utils/visible.h" #include "utils/ordered_set.h" #include "utils/ordered_map.h" #include "ir/anf.h" @@ -32,13 +33,13 @@ using FuncGraphPtr = std::shared_ptr; class FuncGraphManager; using FuncGraphManagerPtr = std::shared_ptr; -struct AnfNodeIndexPairHasher { +struct MS_CORE_API AnfNodeIndexPairHasher { std::size_t operator()(const std::pair &p1) const { return std::hash{}(p1.first.get()); } }; -struct AnfNodeIndexPairEqual { +struct MS_CORE_API AnfNodeIndexPairEqual { bool operator()(const std::pair &lhs, const std::pair &rhs) const { return lhs == rhs; } @@ -47,7 +48,7 @@ struct AnfNodeIndexPairEqual { using AnfNodeIndexSet = OrderedSet, AnfNodeIndexPairHasher, AnfNodeIndexPairEqual>; using NodeUsersMap = OrderedMap; -class FuncGraphManager { +class MS_CORE_API FuncGraphManager { public: FuncGraphManager() = default; virtual ~FuncGraphManager() = default; diff --git a/mindspore/core/base/base.h b/mindspore/core/base/base.h index 1bc579d620..2ca0c3088b 100644 --- a/mindspore/core/base/base.h +++ b/mindspore/core/base/base.h @@ -37,7 +37,7 @@ struct is_shared_ptr : public std::false_type {}; template struct is_shared_ptr> : public std::true_type {}; -class Base : public std::enable_shared_from_this { +class MS_CORE_API Base : public std::enable_shared_from_this { public: constexpr Base() = default; Base(const Base &other) : std::enable_shared_from_this(other) {} diff --git a/mindspore/core/ir/anf.h b/mindspore/core/ir/anf.h index 7d4a260752..731231394c 100644 --- a/mindspore/core/ir/anf.h +++ b/mindspore/core/ir/anf.h @@ -96,7 +96,7 @@ using ParamInfoPtr = std::shared_ptr; // input of other CNodes, you can get the related info by this method. // debug_info: return the information retrieved from parser. Set it using set_debug_info. // fullname_with_scope: return the detailed debug info. -class AnfNode : public Base { +class MS_CORE_API AnfNode : public Base { public: explicit AnfNode(const FuncGraphPtr &func_graph) : func_graph_(FuncGraphWeakPtr(func_graph)), @@ -234,7 +234,7 @@ class AnfNode : public Base { // stop_gradient_: a flag used to stop gradient. // Using stop_gradient() to get this flag, mainly used in ad. // Using set_stop_gradient() to set this flag. -class CNode : public AnfNode, public EffectInfoHolder { +class MS_CORE_API CNode : public AnfNode, public EffectInfoHolder { public: CNode(const std::vector &inputs, const FuncGraphPtr &func_graph); CNode(const std::vector &inputs, const VarPtr &func_graph_as_var) @@ -365,7 +365,7 @@ class CNode : public AnfNode, public EffectInfoHolder { }; // ANode represents the atomic node. It's derived Parameter and ValueNode. -class ANode : public AnfNode { +class MS_CORE_API ANode : public AnfNode { public: ANode() : AnfNode(nullptr) {} explicit ANode(const FuncGraphPtr &func_graph) : AnfNode(func_graph) {} @@ -377,7 +377,7 @@ class ANode : public AnfNode { // Parameter represents the parameter inputs of a function. They have no value. // Attributes: // default_param_value_: used to hold the inputting tensor of the model. -class Parameter : public ANode { +class MS_CORE_API Parameter : public ANode { public: explicit Parameter(const FuncGraphPtr &func_graph) : ANode(func_graph), name_(""), has_default_(false), default_param_(nullptr), used_graph_count_(0) {} @@ -443,7 +443,7 @@ using ParameterPtr = std::shared_ptr; // Value is used to represent the atomic expression mentioned in BNF. // It mainly be stored in ValueNode. Value and ValueNode is related definition. -class Value : public Base { +class MS_CORE_API Value : public Base { public: Value() = default; explicit Value(const TypePtr t) : type_(t) {} @@ -469,7 +469,7 @@ class Value : public Base { // ValueNode is used to hold value. Unlike CNode and Parameter, ValueNode // does not belong to any particular function graph. -class ValueNode : public ANode { +class MS_CORE_API ValueNode : public ANode { public: explicit ValueNode(const ValuePtr &value) : value_(value) {} ~ValueNode() override = default; diff --git a/mindspore/core/ir/cell.h b/mindspore/core/ir/cell.h index 29fcc93fef..c0d1c655ad 100644 --- a/mindspore/core/ir/cell.h +++ b/mindspore/core/ir/cell.h @@ -31,7 +31,7 @@ using abstract::AbstractBasePtr; using abstract::AbstractBasePtrList; // value for Cell -class Cell : public Named { +class MS_CORE_API Cell : public Named { public: explicit Cell(const std::string &name) : Named(name) {} MS_DECLARE_PARENT(Cell, Named); diff --git a/mindspore/core/ir/dtype.h b/mindspore/core/ir/dtype.h index ad00dde44b..38b798a186 100644 --- a/mindspore/core/ir/dtype.h +++ b/mindspore/core/ir/dtype.h @@ -42,9 +42,9 @@ /* namespace to support intermediate representation definition */ namespace mindspore { // Only few type supported now. -TypePtr TypeIdToType(TypeId id); +MS_CORE_API TypePtr TypeIdToType(TypeId id); -class String : public Object { +class MS_CORE_API String : public Object { public: String() : Object(kObjectTypeString, false) {} ~String() override = default; @@ -59,7 +59,7 @@ class String : public Object { }; using StringPtr = std::shared_ptr; -class Keyword : public Object { +class MS_CORE_API Keyword : public Object { public: Keyword() : Object(kObjectTypeKeyword, false), key_(""), value_(nullptr) {} Keyword(const std::string &key, const TypePtr &value) : Object(kObjectTypeKeyword, false), key_(key), value_(value) {} @@ -83,7 +83,7 @@ class Keyword : public Object { }; using KeywordPtr = std::shared_ptr; -class Slice : public Object { +class MS_CORE_API Slice : public Object { public: Slice() : Object(kObjectTypeSlice), start_(nullptr), stop_(nullptr), step_(nullptr) {} Slice(const TypePtr &start, const TypePtr &stop, const TypePtr &step) @@ -110,7 +110,7 @@ class Slice : public Object { }; using SlicePtr = std::shared_ptr; -class Function : public Object { +class MS_CORE_API Function : public Object { public: Function(); Function(const std::vector &args, const TypePtr retval); @@ -135,7 +135,7 @@ class Function : public Object { }; using FunctionPtr = std::shared_ptr; -class JTagged : public Object { +class MS_CORE_API JTagged : public Object { public: JTagged() : Object(kObjectTypeJTagged) {} explicit JTagged(const TypePtr &subtype) : Object(kObjectTypeJTagged, false), subtype_(subtype) {} @@ -153,7 +153,7 @@ class JTagged : public Object { }; using JTaggedPtr = std::shared_ptr; -class SymbolicKeyType : public Object { +class MS_CORE_API SymbolicKeyType : public Object { public: SymbolicKeyType() : Object(kObjectTypeSymbolicKeyType) {} ~SymbolicKeyType() override = default; @@ -165,7 +165,7 @@ class SymbolicKeyType : public Object { std::string DumpText() const override { return "SymType"; } }; -class EnvType : public Object { +class MS_CORE_API EnvType : public Object { public: EnvType() : Object(kObjectTypeEnvType) {} ~EnvType() override = default; @@ -177,7 +177,7 @@ class EnvType : public Object { }; using EnvTypePtr = std::shared_ptr; -class TypeType : public Type { +class MS_CORE_API TypeType : public Type { public: TypeType() : Type(kMetaTypeTypeType) {} ~TypeType() override = default; @@ -190,7 +190,7 @@ class TypeType : public Type { }; using TypeTypePtr = std::shared_ptr; -class Problem : public Type { +class MS_CORE_API Problem : public Type { public: Problem() : Type(kMetaTypeProblem), kind_(Named("unknown")) {} explicit Problem(const Named &kind) : Type(kMetaTypeProblem), kind_(kind) {} @@ -209,7 +209,7 @@ class Problem : public Type { }; using ProblemPtr = std::shared_ptr; -class External : public Type { +class MS_CORE_API External : public Type { public: External() : Type(kMetaTypeExternal) {} ~External() override = default; @@ -230,39 +230,39 @@ TypePtr Clone(const T &t) { return t.Clone(); } -TypePtr StringToType(const std::string &type_name); +MS_CORE_API TypePtr StringToType(const std::string &type_name); // Judge whether x is predicate or is a subclass of predicate. -bool IsIdentidityOrSubclass(TypePtr const &x, TypePtr const &base_type); +MS_CORE_API bool IsIdentidityOrSubclass(TypePtr const &x, TypePtr const &base_type); // Whether t1 is identity or a subclass of t2. -bool IsSubType(TypePtr const &t1, TypePtr const &t2 = nullptr); +MS_CORE_API bool IsSubType(TypePtr const &t1, TypePtr const &t2 = nullptr); -struct TypeHasher { +struct MS_CORE_API TypeHasher { std::size_t operator()(TypePtr const &type) const; }; -struct TypeListHasher { +struct MS_CORE_API TypeListHasher { std::size_t operator()(const TypePtrList &type_list) const; }; -struct TypeEqual { +struct MS_CORE_API TypeEqual { bool operator()(TypePtr const &t1, TypePtr const &t2) const; }; -struct TypeListEqual { +struct MS_CORE_API TypeListEqual { bool operator()(TypePtrList const &lhs, TypePtrList const &rhs) const; }; -extern const TypePtr kTypeExternal; -extern const TypePtr kTypeEnv; -extern const TypePtr kTypeType; -extern const TypePtr kString; -extern const TypePtr kList; -extern const TypePtr kTuple; -extern const TypePtr kDict; -extern const TypePtr kSlice; -extern const TypePtr kKeyword; -extern const TypePtr kTensorType; -extern const TypePtr kTensorTypeFP16; -extern const TypePtr kTensorTypeFP32; +MS_CORE_API extern const TypePtr kTypeExternal; +MS_CORE_API extern const TypePtr kTypeEnv; +MS_CORE_API extern const TypePtr kTypeType; +MS_CORE_API extern const TypePtr kString; +MS_CORE_API extern const TypePtr kList; +MS_CORE_API extern const TypePtr kTuple; +MS_CORE_API extern const TypePtr kDict; +MS_CORE_API extern const TypePtr kSlice; +MS_CORE_API extern const TypePtr kKeyword; +MS_CORE_API extern const TypePtr kTensorType; +MS_CORE_API extern const TypePtr kTensorTypeFP16; +MS_CORE_API extern const TypePtr kTensorTypeFP32; } // namespace mindspore #endif // MINDSPORE_CORE_IR_DTYPE_H_ diff --git a/mindspore/core/ir/dtype/container.h b/mindspore/core/ir/dtype/container.h index a6aa07e6f7..8ce91bc6df 100644 --- a/mindspore/core/ir/dtype/container.h +++ b/mindspore/core/ir/dtype/container.h @@ -37,7 +37,7 @@ namespace mindspore { // TypeRefKey type // List -class List : public Object { +class MS_CORE_API List : public Object { public: List() : Object(kObjectTypeList) {} List(const std::initializer_list &objs) @@ -65,7 +65,7 @@ using ListPtr = std::shared_ptr; using ClassAttrVector = std::vector>; -class Class : public Object { +class MS_CORE_API Class : public Object { public: Class() : Object(kObjectTypeClass), tag_(Named("Class")) {} Class(const Named &tag, const ClassAttrVector &attributes, const std::unordered_map &methods); @@ -95,7 +95,7 @@ class Class : public Object { }; using ClassPtr = std::shared_ptr; -class Tuple : public Object { +class MS_CORE_API Tuple : public Object { public: Tuple() : Object(kObjectTypeTuple) {} // usage : Tuple t = {std::make_shared(), std::make_shared(32)}; @@ -125,7 +125,7 @@ class Tuple : public Object { }; using TuplePtr = std::shared_ptr; -class Dictionary : public Object { +class MS_CORE_API Dictionary : public Object { public: Dictionary() : Object(kObjectTypeDictionary) {} explicit Dictionary(const std::vector> &key_values) diff --git a/mindspore/core/ir/dtype/empty.h b/mindspore/core/ir/dtype/empty.h index d2422f8fc3..bdbbe5c9c1 100644 --- a/mindspore/core/ir/dtype/empty.h +++ b/mindspore/core/ir/dtype/empty.h @@ -34,7 +34,7 @@ #include "ir/dtype/type.h" namespace mindspore { -class TypeAnything : public Type { +class MS_CORE_API TypeAnything : public Type { public: TypeAnything() : Type(kMetaTypeAnything) {} ~TypeAnything() override {} @@ -46,7 +46,7 @@ class TypeAnything : public Type { }; using TypeAnythingPtr = std::shared_ptr; -class TypeNone : public Type { +class MS_CORE_API TypeNone : public Type { public: TypeNone() : Type(kMetaTypeNone) {} ~TypeNone() override {} @@ -59,7 +59,7 @@ class TypeNone : public Type { }; using TypeNonePtr = std::shared_ptr; -class TypeNull : public Type { +class MS_CORE_API TypeNull : public Type { public: TypeNull() : Type(kMetaTypeNull) {} ~TypeNull() override {} @@ -71,7 +71,7 @@ class TypeNull : public Type { }; using TypeNullPtr = std::shared_ptr; -class TypeEllipsis : public Type { +class MS_CORE_API TypeEllipsis : public Type { public: TypeEllipsis() : Type(kMetaTypeEllipsis) {} ~TypeEllipsis() override {} @@ -84,10 +84,10 @@ class TypeEllipsis : public Type { }; using TypeEllipsisPtr = std::shared_ptr; -extern const TypePtr kTypeNone; -extern const TypePtr kTypeNull; -extern const TypePtr kTypeEllipsis; -extern const TypePtr kAnyType; +MS_CORE_API extern const TypePtr kTypeNone; +MS_CORE_API extern const TypePtr kTypeNull; +MS_CORE_API extern const TypePtr kTypeEllipsis; +MS_CORE_API extern const TypePtr kAnyType; } // namespace mindspore #endif // MINDSPORE_CORE_IR_DTYPE_EMPTY_H_ diff --git a/mindspore/core/ir/dtype/number.h b/mindspore/core/ir/dtype/number.h index d1f1698ae6..a5267269be 100644 --- a/mindspore/core/ir/dtype/number.h +++ b/mindspore/core/ir/dtype/number.h @@ -35,7 +35,7 @@ namespace mindspore { // Number, abstract class. -class Number : public Object { +class MS_CORE_API Number : public Object { public: Number() : Object(kObjectTypeNumber), number_type_(kObjectTypeNumber), nbits_(0) {} Number(const TypeId number_type, const int nbits, bool is_generic = true) @@ -71,7 +71,7 @@ class Number : public Object { using NumberPtr = std::shared_ptr; // Bool -class Bool : public Number { +class MS_CORE_API Bool : public Number { public: Bool() : Number(kNumberTypeBool, 8) {} ~Bool() override = default; @@ -85,7 +85,7 @@ class Bool : public Number { }; // Int -class Int : public Number { +class MS_CORE_API Int : public Number { public: Int() : Number(kNumberTypeInt, 0) {} explicit Int(const int nbits); @@ -106,7 +106,7 @@ class Int : public Number { }; // UInt -class UInt : public Number { +class MS_CORE_API UInt : public Number { public: UInt() : Number(kNumberTypeUInt, 0) {} explicit UInt(const int nbits); @@ -129,7 +129,7 @@ class UInt : public Number { }; // Float -class Float : public Number { +class MS_CORE_API Float : public Number { public: Float() : Number(kNumberTypeFloat, 0) {} explicit Float(const int nbits); @@ -151,7 +151,7 @@ class Float : public Number { }; // Complex64 -class Complex64 : public Number { +class MS_CORE_API Complex64 : public Number { public: Complex64() : Number(kNumberTypeComplex64, 64, false) {} ~Complex64() override {} diff --git a/mindspore/core/ir/dtype/ref.h b/mindspore/core/ir/dtype/ref.h index ccdcb6cf6b..e428c3a6ec 100644 --- a/mindspore/core/ir/dtype/ref.h +++ b/mindspore/core/ir/dtype/ref.h @@ -27,7 +27,7 @@ namespace mindspore { // TypeRefKey type -class RefKeyType : public Object { +class MS_CORE_API RefKeyType : public Object { public: RefKeyType() : Object(kObjectTypeRefKey) {} ~RefKeyType() override {} @@ -40,7 +40,7 @@ class RefKeyType : public Object { }; // TypeRef type -class RefType : public TensorType { +class MS_CORE_API RefType : public TensorType { public: RefType() : TensorType() {} explicit RefType(const TensorTypePtr &subtype) : TensorType(subtype->element()) {} @@ -53,8 +53,8 @@ class RefType : public TensorType { }; using RefTypePtr = std::shared_ptr; -extern const TypePtr kRefKeyType; -extern const TypePtr kRefType; +MS_CORE_API extern const TypePtr kRefKeyType; +MS_CORE_API extern const TypePtr kRefType; } // namespace mindspore #endif // MINDSPORE_CORE_IR_DTYPE_REF_H_ diff --git a/mindspore/core/ir/dtype/tensor_type.h b/mindspore/core/ir/dtype/tensor_type.h index 7fb2b911f7..0c3d48da0f 100644 --- a/mindspore/core/ir/dtype/tensor_type.h +++ b/mindspore/core/ir/dtype/tensor_type.h @@ -34,7 +34,7 @@ #include "ir/dtype/type.h" namespace mindspore { -class UndeterminedType : public Object { +class MS_CORE_API UndeterminedType : public Object { public: UndeterminedType() : Object(kObjectTypeUndeterminedType) {} explicit UndeterminedType(const TypePtr &ele) @@ -57,7 +57,7 @@ class UndeterminedType : public Object { }; using MetaTensorTypePtr = std::shared_ptr; -class TensorType : public Object { +class MS_CORE_API TensorType : public Object { public: TensorType() : Object(kObjectTypeTensorType, kObjectTypeUndeterminedType) {} explicit TensorType(const TypePtr &ele) @@ -80,7 +80,7 @@ class TensorType : public Object { }; using TensorTypePtr = std::shared_ptr; -class RowTensorType : public Object { +class MS_CORE_API RowTensorType : public Object { public: RowTensorType() : Object(kObjectTypeRowTensorType, kObjectTypeUndeterminedType) {} explicit RowTensorType(const TypePtr &ele) @@ -103,7 +103,7 @@ class RowTensorType : public Object { }; using RowTensorTypePtr = std::shared_ptr; -class SparseTensorType : public Object { +class MS_CORE_API SparseTensorType : public Object { public: SparseTensorType() : Object(kObjectTypeSparseTensorType, kObjectTypeUndeterminedType) {} explicit SparseTensorType(const TypePtr &ele) diff --git a/mindspore/core/ir/dtype/type.h b/mindspore/core/ir/dtype/type.h index 6cff3df189..1579a06055 100644 --- a/mindspore/core/ir/dtype/type.h +++ b/mindspore/core/ir/dtype/type.h @@ -49,7 +49,7 @@ size_t GetTypeByte(const TypePtr &type_ptr); // Base class for all types // forward declaration. -class Type : public Value { +class MS_CORE_API Type : public Value { public: Type() : meta_type_(kMetaTypeType), is_generic_(true) {} explicit Type(TypeId t, bool is_generic = true) : meta_type_(t), is_generic_(is_generic) {} @@ -94,7 +94,7 @@ using TypePtrList = std::vector; // // Base class for normal objects // -class Object : public Type { +class MS_CORE_API Object : public Type { public: Object() : Type(kMetaTypeObject), object_type_(kMetaTypeObject), parent_type_(kMetaTypeObject) {} explicit Object(const TypeId object_type, bool is_generic = true) @@ -132,7 +132,7 @@ const std::unordered_map type_priority_map = { {kNumberTypeInt16, 3}, {kNumberTypeInt32, 4}, {kNumberTypeInt64, 5}, {kNumberTypeFloat16, 6}, {kNumberTypeFloat32, 7}, {kNumberTypeFloat64, 8}}; -std::ostream &operator<<(std::ostream &os, const TypePtrList &types); +MS_CORE_API std::ostream &operator<<(std::ostream &os, const TypePtrList &types); } // namespace mindspore #endif // MINDSPORE_CORE_IR_DTYPE_TYPE_H_ diff --git a/mindspore/core/ir/func_graph.cc b/mindspore/core/ir/func_graph.cc index 703b679fe4..1abf10b099 100644 --- a/mindspore/core/ir/func_graph.cc +++ b/mindspore/core/ir/func_graph.cc @@ -632,7 +632,7 @@ std::list FuncGraph::GetOrderedCnodes() { auto SuccDepends = std::bind(SuccIncludeFV, this_ptr, std::placeholders::_1); std::list cnodes; - auto nodes = TopoSort(get_return(), SuccDepends, BelongSameGraph); + auto nodes = mindspore::TopoSort(get_return(), SuccDepends, BelongSameGraph); for (const auto &node : nodes) { auto cnode = dyn_cast(node); if (cnode) { @@ -727,7 +727,7 @@ bool FuncGraph::ContainMultiTarget() const { MS_EXCEPTION_IF_NULL(graph_manager); FuncGraphSet graphs = graph_manager->func_graphs(); for (auto &g : graphs) { - auto nodes = TopoSort(g->get_return()); + auto nodes = mindspore::TopoSort(g->get_return()); if (mindspore::ContainMultiTarget(nodes)) { return true; } @@ -740,5 +740,8 @@ size_t NewFgSeenGeneration() { return ++fg_seen_generation; } +// Implement TopoSort api. +std::vector api::FuncGraph::TopoSort(const AnfNodePtr &node) { return mindspore::TopoSort(node); } + const PrimitivePtr FuncGraphTransform::func_graph_prim_ = std::make_shared("FuncGraph"); } // namespace mindspore diff --git a/mindspore/core/ir/meta_tensor.h b/mindspore/core/ir/meta_tensor.h index f542baca86..96c860855c 100644 --- a/mindspore/core/ir/meta_tensor.h +++ b/mindspore/core/ir/meta_tensor.h @@ -55,7 +55,7 @@ struct DeviceInfo { // // Includes the metadata information of a tensor, such as data type, shape // and so on. But it does not contain values of a tensor. -class MetaTensor : public Value { +class MS_CORE_API MetaTensor : public Value { public: // Construction MetaTensor(); diff --git a/mindspore/core/ir/named.h b/mindspore/core/ir/named.h index 041bef12b0..62855a502d 100644 --- a/mindspore/core/ir/named.h +++ b/mindspore/core/ir/named.h @@ -24,7 +24,7 @@ #include "ir/anf.h" namespace mindspore { -class Named : public Value { +class MS_CORE_API Named : public Value { public: explicit Named(const std::string &name) : name_(name) { hash_id_ = std::hash{}(name); } Named(const Named &other) : Value(other) { @@ -62,14 +62,14 @@ class Named : public Value { }; using NamedPtr = std::shared_ptr; -struct NamedHasher { +struct MS_CORE_API NamedHasher { std::size_t operator()(NamedPtr const &name) const { std::size_t hash = name->Hash(); return hash; } }; -struct NamedEqual { +struct MS_CORE_API NamedEqual { bool operator()(NamedPtr const &t1, NamedPtr const &t2) const { MS_EXCEPTION_IF_NULL(t1); MS_EXCEPTION_IF_NULL(t2); @@ -77,31 +77,31 @@ struct NamedEqual { } }; -class None : public Named { +class MS_CORE_API None : public Named { public: None() : Named("None") {} ~None() override = default; MS_DECLARE_PARENT(None, Named); abstract::AbstractBasePtr ToAbstract() override; }; -extern const NamedPtr kNone; +MS_CORE_API extern const NamedPtr kNone; -class Null : public Named { +class MS_CORE_API Null : public Named { public: Null() : Named("Null") {} ~Null() override = default; MS_DECLARE_PARENT(Null, Named); abstract::AbstractBasePtr ToAbstract() override; }; -extern const NamedPtr kNull; +MS_CORE_API extern const NamedPtr kNull; -class Ellipsis : public Named { +class MS_CORE_API Ellipsis : public Named { public: Ellipsis() : Named("Ellipsis") {} ~Ellipsis() override = default; MS_DECLARE_PARENT(Ellipsis, Named); abstract::AbstractBasePtr ToAbstract() override; }; -extern const NamedPtr kEllipsis; +MS_CORE_API extern const NamedPtr kEllipsis; } // namespace mindspore #endif // MINDSPORE_CORE_IR_NAMED_H_ diff --git a/mindspore/core/ir/primitive.h b/mindspore/core/ir/primitive.h index d875fe53eb..c1d47d20fa 100644 --- a/mindspore/core/ir/primitive.h +++ b/mindspore/core/ir/primitive.h @@ -38,7 +38,7 @@ enum PrimType { kPrimTypePyCheck // Primitive operator with input args checking method }; -class Primitive : public Named { +class MS_CORE_API Primitive : public Named { public: explicit Primitive(const std::string &name, const bool is_base = true, const PrimType prim_type = kPrimTypeBuiltIn); Primitive(const std::string &name, const std::unordered_map &attrs); @@ -142,7 +142,7 @@ inline std::ostream &operator<<(std::ostream &os, const PrimitivePtr &p) { return os; } -struct PrimitiveEqual { +struct MS_CORE_API PrimitiveEqual { bool operator()(PrimitivePtr const &t1, PrimitivePtr const &t2) const { MS_EXCEPTION_IF_NULL(t1); MS_EXCEPTION_IF_NULL(t2); @@ -150,14 +150,14 @@ struct PrimitiveEqual { } }; -struct PrimitiveHasher { +struct MS_CORE_API PrimitiveHasher { std::size_t operator()(PrimitivePtr const &prim) const { MS_EXCEPTION_IF_NULL(prim); return prim->Hash(); } }; -struct PrimitiveTotalEqual { +struct MS_CORE_API PrimitiveTotalEqual { bool operator()(PrimitivePtr const &t1, PrimitivePtr const &t2) const { MS_EXCEPTION_IF_NULL(t1); MS_EXCEPTION_IF_NULL(t2); diff --git a/mindspore/core/ir/scalar.h b/mindspore/core/ir/scalar.h index 7d76bcc1c5..200b366497 100644 --- a/mindspore/core/ir/scalar.h +++ b/mindspore/core/ir/scalar.h @@ -35,7 +35,7 @@ using std::fabs; namespace mindspore { -class Scalar : public Value { +class MS_CORE_API Scalar : public Value { public: Scalar() = default; explicit Scalar(const TypePtr t) : Value(t) {} @@ -50,7 +50,7 @@ class Scalar : public Value { }; using ScalarPtr = std::shared_ptr; -class BoolImm : public Scalar { +class MS_CORE_API BoolImm : public Scalar { public: explicit BoolImm(bool b) : Scalar(kBool), v_(b) { hash_ = hash_combine({tid(), std::hash{}(v_)}); } ~BoolImm() override = default; @@ -81,7 +81,7 @@ class BoolImm : public Scalar { using BoolImmPtr = std::shared_ptr; IMM_TRAITS(BoolImmPtr, bool) -class IntergerImm : public Scalar { +class MS_CORE_API IntergerImm : public Scalar { public: IntergerImm() = default; explicit IntergerImm(const TypePtr &t) : Scalar(t) {} @@ -89,7 +89,7 @@ class IntergerImm : public Scalar { MS_DECLARE_PARENT(IntergerImm, Scalar) }; -class Int8Imm : public IntergerImm { +class MS_CORE_API Int8Imm : public IntergerImm { public: Int8Imm() : IntergerImm(kInt8), v_(0) {} explicit Int8Imm(int8_t v) : IntergerImm(kInt8), v_(v) { hash_ = hash_combine({tid(), std::hash{}(v_)}); } @@ -115,7 +115,7 @@ class Int8Imm : public IntergerImm { using Int8ImmPtr = std::shared_ptr; IMM_TRAITS(Int8ImmPtr, int8_t) -class Int16Imm : public IntergerImm { +class MS_CORE_API Int16Imm : public IntergerImm { public: Int16Imm() : IntergerImm(kInt16), v_(0) {} explicit Int16Imm(int16_t v) : IntergerImm(kInt16), v_(v) { hash_ = hash_combine({tid(), std::hash{}(v_)}); } @@ -141,7 +141,7 @@ class Int16Imm : public IntergerImm { using Int16ImmPtr = std::shared_ptr; IMM_TRAITS(Int16ImmPtr, int16_t) -class Int32Imm : public IntergerImm { +class MS_CORE_API Int32Imm : public IntergerImm { public: Int32Imm() : IntergerImm(kInt32), v_(0) {} explicit Int32Imm(int v) : IntergerImm(kInt32), v_(v) { hash_ = hash_combine({tid(), std::hash{}(v_)}); } @@ -167,7 +167,7 @@ class Int32Imm : public IntergerImm { using Int32ImmPtr = std::shared_ptr; IMM_TRAITS(Int32ImmPtr, int32_t) -class Int64Imm : public IntergerImm { +class MS_CORE_API Int64Imm : public IntergerImm { public: Int64Imm() : IntergerImm(kInt64), v_(0) {} explicit Int64Imm(int64_t v) : IntergerImm(kInt64), v_(v) { hash_ = hash_combine({tid(), std::hash{}(v_)}); } @@ -193,7 +193,7 @@ class Int64Imm : public IntergerImm { using Int64ImmPtr = std::shared_ptr; IMM_TRAITS(Int64ImmPtr, int64_t) -class UInt8Imm : public IntergerImm { +class MS_CORE_API UInt8Imm : public IntergerImm { public: UInt8Imm() : IntergerImm(kUInt8), v_(0) {} explicit UInt8Imm(uint8_t v) : IntergerImm(kUInt8), v_(v) { @@ -221,7 +221,7 @@ class UInt8Imm : public IntergerImm { using UInt8ImmPtr = std::shared_ptr; IMM_TRAITS(UInt8ImmPtr, uint8_t); -class UInt16Imm : public IntergerImm { +class MS_CORE_API UInt16Imm : public IntergerImm { public: UInt16Imm() : IntergerImm(kUInt16), v_(0) {} explicit UInt16Imm(uint16_t v) : IntergerImm(kUInt16), v_(v) { @@ -249,7 +249,7 @@ class UInt16Imm : public IntergerImm { using UInt16ImmPtr = std::shared_ptr; IMM_TRAITS(UInt16ImmPtr, uint16_t); -class UInt32Imm : public IntergerImm { +class MS_CORE_API UInt32Imm : public IntergerImm { public: UInt32Imm() : IntergerImm(kUInt32), v_(0) {} explicit UInt32Imm(uint32_t v) : IntergerImm(kUInt32), v_(v) { @@ -277,7 +277,7 @@ class UInt32Imm : public IntergerImm { using UInt32ImmPtr = std::shared_ptr; IMM_TRAITS(UInt32ImmPtr, uint32_t); -class UInt64Imm : public IntergerImm { +class MS_CORE_API UInt64Imm : public IntergerImm { public: UInt64Imm() : IntergerImm(kUInt64), v_(0) {} explicit UInt64Imm(uint64_t v) : IntergerImm(kUInt64), v_(v) { @@ -305,7 +305,7 @@ class UInt64Imm : public IntergerImm { using UInt64ImmPtr = std::shared_ptr; IMM_TRAITS(UInt64ImmPtr, uint64_t); -class FloatImm : public Scalar { +class MS_CORE_API FloatImm : public Scalar { public: FloatImm() = default; explicit FloatImm(const TypePtr &t) : Scalar(t) {} @@ -314,7 +314,7 @@ class FloatImm : public Scalar { }; using FloatImmPtr = std::shared_ptr; -class FP32Imm : public FloatImm { +class MS_CORE_API FP32Imm : public FloatImm { public: FP32Imm() : FloatImm(kFloat32), v_(0.0) {} explicit FP32Imm(float v) : FloatImm(kFloat32), v_(v) { hash_ = hash_combine({tid(), std::hash{}(v_)}); } @@ -340,7 +340,7 @@ class FP32Imm : public FloatImm { using FP32ImmPtr = std::shared_ptr; IMM_TRAITS(FP32ImmPtr, float) -class FP64Imm : public FloatImm { +class MS_CORE_API FP64Imm : public FloatImm { public: FP64Imm() : FloatImm(kFloat64), v_(0.0) {} explicit FP64Imm(double v) : FloatImm(kFloat64), v_(v) { hash_ = hash_combine({tid(), std::hash{}(v_)}); } diff --git a/mindspore/core/ir/scope.h b/mindspore/core/ir/scope.h index c66949867d..5e0302770a 100644 --- a/mindspore/core/ir/scope.h +++ b/mindspore/core/ir/scope.h @@ -19,6 +19,7 @@ #include #include #include + namespace mindspore { class Scope; using ScopePtr = std::shared_ptr; diff --git a/mindspore/core/ir/tensor.h b/mindspore/core/ir/tensor.h index b94757ea40..ef194e3bf6 100644 --- a/mindspore/core/ir/tensor.h +++ b/mindspore/core/ir/tensor.h @@ -42,7 +42,7 @@ enum TensorSyncStatus { kNoNeedSync, kNeedSyncHostToDevice, kNeedSyncDeviceToHos // A sub namespace in ME to support tensor related definition. namespace tensor { // Tensor data interface. -class TensorData { +class MS_CORE_API TensorData { public: /// virtual destructor is required for base classes. virtual ~TensorData() = default; @@ -111,7 +111,7 @@ class WaitEvent : public ExceptionListener { }; // Tensor entity class -class Tensor : public MetaTensor { +class MS_CORE_API Tensor : public MetaTensor { public: abstract::AbstractBasePtr ToAbstract() override; diff --git a/mindspore/core/ir/value.h b/mindspore/core/ir/value.h index c2db08c7a0..4da4474b00 100644 --- a/mindspore/core/ir/value.h +++ b/mindspore/core/ir/value.h @@ -34,7 +34,7 @@ #include "utils/ms_utils.h" namespace mindspore { -class ValueSequeue : public Value { +class MS_CORE_API ValueSequeue : public Value { public: explicit ValueSequeue(const ValuePtrList &elements) : elements_(elements) { TypePtrList t_list; @@ -69,7 +69,7 @@ class ValueSequeue : public Value { }; using ValueSequeuePtr = std::shared_ptr; -class ValueTuple : public ValueSequeue { +class MS_CORE_API ValueTuple : public ValueSequeue { public: explicit ValueTuple(const std::vector &elements) : ValueSequeue(elements) {} ValueTuple(const std::initializer_list &elements) : ValueSequeue(elements) {} @@ -82,7 +82,7 @@ class ValueTuple : public ValueSequeue { }; using ValueTuplePtr = std::shared_ptr; -class ValueList : public ValueSequeue { +class MS_CORE_API ValueList : public ValueSequeue { public: explicit ValueList(const std::vector &elements) : ValueSequeue(elements) {} ValueList(const std::initializer_list &elements) : ValueSequeue(elements) {} @@ -110,7 +110,7 @@ ValuePtr MakeValue(const T &vec) { return std::make_shared(list); } -class ValueSlice : public Value { +class MS_CORE_API ValueSlice : public Value { public: ValueSlice(const ValuePtr &start, const ValuePtr &stop, const ValuePtr &step) : start_(start), stop_(stop), step_(step) {} @@ -135,7 +135,7 @@ class ValueSlice : public Value { }; using ValueSlicePtr = std::shared_ptr; -class KeywordArg : public Value { +class MS_CORE_API KeywordArg : public Value { public: KeywordArg(const std::string &key, const ValuePtr &value) : key_(key), value_(value) {} ~KeywordArg() override = default; @@ -156,7 +156,7 @@ class KeywordArg : public Value { }; using KeywordArgPtr = std::shared_ptr; -class ValueDictionary : public Value { +class MS_CORE_API ValueDictionary : public Value { public: explicit ValueDictionary(const std::vector> &key_values) : key_values_(key_values) {} ~ValueDictionary() override = default; @@ -197,7 +197,7 @@ class ValueDictionary : public Value { }; using ValueDictionaryPtr = std::shared_ptr; -class StringImm : public Value { +class MS_CORE_API StringImm : public Value { public: explicit StringImm(const std::string &str) : Value(kString), str_(str), hash_(std::hash{}(str_)) {} @@ -224,7 +224,7 @@ using StringImmPtr = std::shared_ptr; IMM_TRAITS(StringImmPtr, std::string) IMM_TRAITS(StringImmPtr, const char *) -class RefKey : public Named { +class MS_CORE_API RefKey : public Named { public: explicit RefKey(const std::string &tag) : Named(tag) {} @@ -242,7 +242,7 @@ class RefKey : public Named { }; using RefKeyPtr = std::shared_ptr; -class AnyValue : public Value { +class MS_CORE_API AnyValue : public Value { public: AnyValue() = default; ~AnyValue() override = default; @@ -253,7 +253,7 @@ class AnyValue : public Value { }; extern const ValuePtr kAnyValue; -class Monad : public Value { +class MS_CORE_API Monad : public Value { public: ~Monad() override = default; MS_DECLARE_PARENT(Monad, Value) @@ -263,7 +263,7 @@ class Monad : public Value { explicit Monad(TypePtr type) : Value(type) {} }; -class UMonad : public Monad { +class MS_CORE_API UMonad : public Monad { public: UMonad() : Monad(kUMonadType) {} ~UMonad() override = default; @@ -276,7 +276,7 @@ class UMonad : public Monad { using UMonadPtr = std::shared_ptr; extern const ValuePtr kUMonad; -class IOMonad : public Monad { +class MS_CORE_API IOMonad : public Monad { public: IOMonad() : Monad(kIOMonadType) {} ~IOMonad() override = default; diff --git a/mindspore/core/ops/LayerNormBetaGammaBackprop.h b/mindspore/core/ops/LayerNormBetaGammaBackprop.h index 456a281cb0..8385149595 100644 --- a/mindspore/core/ops/LayerNormBetaGammaBackprop.h +++ b/mindspore/core/ops/LayerNormBetaGammaBackprop.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { -class LayerNormBetaGammaBackprop : public PrimitiveC { +class MS_CORE_API LayerNormBetaGammaBackprop : public PrimitiveC { public: LayerNormBetaGammaBackprop() : PrimitiveC(prim::kPrimLayerNormBetaGammaBackprop->name()) {} ~LayerNormBetaGammaBackprop() = default; diff --git a/mindspore/core/ops/LayerNormXBackprop.h b/mindspore/core/ops/LayerNormXBackprop.h index d5029db666..f6ab576df3 100644 --- a/mindspore/core/ops/LayerNormXBackprop.h +++ b/mindspore/core/ops/LayerNormXBackprop.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { -class LayerNormXBackprop : public PrimitiveC { +class MS_CORE_API LayerNormXBackprop : public PrimitiveC { public: LayerNormXBackprop() : PrimitiveC(prim::kPrimLayerNormXBackprop->name()) {} ~LayerNormXBackprop() = default; diff --git a/mindspore/core/ops/abs.h b/mindspore/core/ops/abs.h index 1e8a1683d0..f9aad08073 100644 --- a/mindspore/core/ops/abs.h +++ b/mindspore/core/ops/abs.h @@ -26,7 +26,7 @@ namespace mindspore { namespace ops { constexpr auto kNameAbs = "Abs"; -class Abs : public PrimitiveC { +class MS_CORE_API Abs : public PrimitiveC { public: Abs() : PrimitiveC(kNameAbs) { InitIOName({"input_x"}, {"output"}); } ~Abs() = default; diff --git a/mindspore/core/ops/adam.h b/mindspore/core/ops/adam.h index 1767b7e342..ed2c707314 100644 --- a/mindspore/core/ops/adam.h +++ b/mindspore/core/ops/adam.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { constexpr auto kNameAdam = "Adam"; -class Adam : public PrimitiveC { +class MS_CORE_API Adam : public PrimitiveC { public: Adam() : PrimitiveC(kNameAdam) {} ~Adam() = default; diff --git a/mindspore/core/ops/add.h b/mindspore/core/ops/add.h index cc334e2e54..5dbc35679c 100644 --- a/mindspore/core/ops/add.h +++ b/mindspore/core/ops/add.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { constexpr auto kNameAdd = prim::kAdd; -class Add : public PrimitiveC { +class MS_CORE_API Add : public PrimitiveC { public: Add() : PrimitiveC(kNameAdd) { InitIOName({"x", "y"}, {"output"}); } explicit Add(const std::string k_name) : PrimitiveC(k_name) { InitIOName({"x", "y"}, {"output"}); } diff --git a/mindspore/core/ops/adder.h b/mindspore/core/ops/adder.h index 4fe36cb596..6f0ffd21d8 100644 --- a/mindspore/core/ops/adder.h +++ b/mindspore/core/ops/adder.h @@ -28,7 +28,7 @@ namespace mindspore { namespace ops { constexpr auto kNameAdder = "Adder"; -class Adder : public PrimitiveC { +class MS_CORE_API Adder : public PrimitiveC { public: explicit Adder(const std::string &k_name = kNameAdder) : PrimitiveC(k_name) {} ~Adder() = default; diff --git a/mindspore/core/ops/addn.h b/mindspore/core/ops/addn.h index 7459ac2806..dd17a51851 100644 --- a/mindspore/core/ops/addn.h +++ b/mindspore/core/ops/addn.h @@ -25,7 +25,7 @@ namespace mindspore { namespace ops { constexpr auto kNameAddN = "AddN"; -class AddN : public PrimitiveC { +class MS_CORE_API AddN : public PrimitiveC { public: AddN() : PrimitiveC(kNameAddN) { InitIOName({"inputs"}, {"sum"}); } ~AddN() = default; diff --git a/mindspore/core/ops/affine.h b/mindspore/core/ops/affine.h index 30b800b8a9..7568252eb4 100644 --- a/mindspore/core/ops/affine.h +++ b/mindspore/core/ops/affine.h @@ -29,7 +29,7 @@ constexpr auto kNameAffine = "Affine"; constexpr auto kAffineContext = "context"; constexpr auto kAffineOutputDim = "output_dim"; -class Affine : public PrimitiveC { +class MS_CORE_API Affine : public PrimitiveC { public: Affine() : PrimitiveC(kNameAffine) { InitIOName({"x1", "x2"}, {"outputs"}); } ~Affine() = default; diff --git a/mindspore/core/ops/all.h b/mindspore/core/ops/all.h index c8035874c8..f34bb519f2 100644 --- a/mindspore/core/ops/all.h +++ b/mindspore/core/ops/all.h @@ -23,7 +23,7 @@ namespace mindspore { namespace ops { constexpr auto kNameAll = "All"; -class All : public PrimitiveC { +class MS_CORE_API All : public PrimitiveC { public: All() : PrimitiveC(kNameAll) {} ~All() = default; diff --git a/mindspore/core/ops/apply_momentum.h b/mindspore/core/ops/apply_momentum.h index 388bec9dd8..3a8fc42033 100644 --- a/mindspore/core/ops/apply_momentum.h +++ b/mindspore/core/ops/apply_momentum.h @@ -26,7 +26,7 @@ namespace mindspore { namespace ops { constexpr auto kNameApplyMomentum = "ApplyMomentum"; -class ApplyMomentum : public PrimitiveC { +class MS_CORE_API ApplyMomentum : public PrimitiveC { public: ApplyMomentum() : PrimitiveC(kNameApplyMomentum) { InitIOName({"variable", "accumulation", "learning_rate", "gradient", "momentum"}, {"output"}); diff --git a/mindspore/core/ops/arg_max.h b/mindspore/core/ops/arg_max.h index 75440f0b0a..969fb497fb 100644 --- a/mindspore/core/ops/arg_max.h +++ b/mindspore/core/ops/arg_max.h @@ -28,7 +28,7 @@ namespace mindspore { namespace ops { constexpr auto kNameArgMax = "Argmax"; -class ArgMax : public PrimitiveC { +class MS_CORE_API ArgMax : public PrimitiveC { public: ArgMax() : PrimitiveC(kNameArgMax) { InitIOName({"x"}, {"output"}); } explicit ArgMax(const std::string k_name) : PrimitiveC(k_name) { InitIOName({"x"}, {"output"}); } diff --git a/mindspore/core/ops/arg_min.h b/mindspore/core/ops/arg_min.h index 6872d7f0db..90dc47c7bf 100644 --- a/mindspore/core/ops/arg_min.h +++ b/mindspore/core/ops/arg_min.h @@ -28,7 +28,7 @@ namespace mindspore { namespace ops { constexpr auto kNameArgMin = "ArgMin"; -class ArgMin : public PrimitiveC { +class MS_CORE_API ArgMin : public PrimitiveC { public: ArgMin() : PrimitiveC(kNameArgMin) { InitIOName({"x"}, {"output"}); } explicit ArgMin(const std::string k_name) : PrimitiveC(k_name) { InitIOName({"x"}, {"output"}); } diff --git a/mindspore/core/ops/asin.h b/mindspore/core/ops/asin.h index ebed63649b..e4a79af2c1 100644 --- a/mindspore/core/ops/asin.h +++ b/mindspore/core/ops/asin.h @@ -26,7 +26,7 @@ namespace mindspore { namespace ops { constexpr auto kNameAsin = "Asin"; -class Asin : public PrimitiveC { +class MS_CORE_API Asin : public PrimitiveC { public: Asin() : PrimitiveC(kNameAsin) {} ~Asin() = default; diff --git a/mindspore/core/ops/assert.h b/mindspore/core/ops/assert.h index c4488bde7a..19470a6be0 100644 --- a/mindspore/core/ops/assert.h +++ b/mindspore/core/ops/assert.h @@ -25,7 +25,7 @@ namespace mindspore { namespace ops { constexpr auto kNameAssert = "Assert"; -class Assert : public PrimitiveC { +class MS_CORE_API Assert : public PrimitiveC { public: Assert() : PrimitiveC(kNameAssert) {} ~Assert() = default; diff --git a/mindspore/core/ops/assign.h b/mindspore/core/ops/assign.h index a0072725a3..e088f826f9 100644 --- a/mindspore/core/ops/assign.h +++ b/mindspore/core/ops/assign.h @@ -26,7 +26,7 @@ namespace mindspore { namespace ops { constexpr auto kNameAssign = "Assign"; -class Assign : public PrimitiveC { +class MS_CORE_API Assign : public PrimitiveC { public: Assign() : PrimitiveC(kNameAssign) { InitIOName({"ref", "value"}, {"output"}); } ~Assign() = default; diff --git a/mindspore/core/ops/assign_add.h b/mindspore/core/ops/assign_add.h index 645d39bb38..2936c75eb2 100644 --- a/mindspore/core/ops/assign_add.h +++ b/mindspore/core/ops/assign_add.h @@ -26,7 +26,7 @@ namespace mindspore { namespace ops { constexpr auto kNameAssignAdd = "AssignAdd"; -class AssignAdd : public PrimitiveC { +class MS_CORE_API AssignAdd : public PrimitiveC { public: AssignAdd() : PrimitiveC(kNameAssignAdd) { InitIOName({"ref", "value"}, {"output"}); } ~AssignAdd() = default; diff --git a/mindspore/core/ops/atan.h b/mindspore/core/ops/atan.h index cf72661126..dfb5ed4c83 100644 --- a/mindspore/core/ops/atan.h +++ b/mindspore/core/ops/atan.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { constexpr auto kNameAtan = "Atan"; -class Atan : public PrimitiveC { +class MS_CORE_API Atan : public PrimitiveC { public: Atan() : PrimitiveC(kNameAtan) {} ~Atan() = default; diff --git a/mindspore/core/ops/attention.h b/mindspore/core/ops/attention.h index 1d74fe0dfc..5e204f3b00 100644 --- a/mindspore/core/ops/attention.h +++ b/mindspore/core/ops/attention.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { constexpr auto kNameAttention = "Attention"; // Attention MultiHeadAttention -class Attention : public PrimitiveC { +class MS_CORE_API Attention : public PrimitiveC { public: Attention() : PrimitiveC(kNameAttention) { InitIOName( diff --git a/mindspore/core/ops/audio_spectrogram.h b/mindspore/core/ops/audio_spectrogram.h index 54173ccc3e..031134b464 100644 --- a/mindspore/core/ops/audio_spectrogram.h +++ b/mindspore/core/ops/audio_spectrogram.h @@ -29,7 +29,7 @@ namespace ops { constexpr auto kNameAudioSpectrogram = "AudioSpectrogram"; int64_t Log2Ceil(int64_t length); int64_t GetFftLength(int64_t length); -class AudioSpectrogram : public PrimitiveC { +class MS_CORE_API AudioSpectrogram : public PrimitiveC { public: AudioSpectrogram() : PrimitiveC(kNameAudioSpectrogram) {} ~AudioSpectrogram() = default; diff --git a/mindspore/core/ops/avg_pool.h b/mindspore/core/ops/avg_pool.h index 4985519938..ac429594a9 100644 --- a/mindspore/core/ops/avg_pool.h +++ b/mindspore/core/ops/avg_pool.h @@ -28,7 +28,7 @@ namespace mindspore { namespace ops { constexpr auto kNameAvgPool = "AvgPool"; -class AvgPool : public PrimitiveC { +class MS_CORE_API AvgPool : public PrimitiveC { public: AvgPool() : PrimitiveC(kNameAvgPool) { InitIOName({"x"}, {"output"}); } explicit AvgPool(const std::string k_name) : PrimitiveC(k_name) { InitIOName({"x"}, {"output"}); } diff --git a/mindspore/core/ops/avg_pool_3d.h b/mindspore/core/ops/avg_pool_3d.h index ea68327a29..105858edfd 100644 --- a/mindspore/core/ops/avg_pool_3d.h +++ b/mindspore/core/ops/avg_pool_3d.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { -class AvgPool3D : public PrimitiveC { +class MS_CORE_API AvgPool3D : public PrimitiveC { public: AvgPool3D() : PrimitiveC(prim::kPrimAvgPool3D->name()) { InitIOName({"input"}, {"output"}); } ~AvgPool3D() = default; diff --git a/mindspore/core/ops/batch_matmul.h b/mindspore/core/ops/batch_matmul.h index ad7cef3d42..a3c6dab7af 100644 --- a/mindspore/core/ops/batch_matmul.h +++ b/mindspore/core/ops/batch_matmul.h @@ -24,7 +24,7 @@ namespace mindspore { namespace ops { -class BatchMatmul : public PrimitiveC { +class MS_CORE_API BatchMatmul : public PrimitiveC { public: BatchMatmul() : PrimitiveC(prim::kPrimBatchMatMul->name()) { InitIOName({"x1", "x2"}, {"output"}); } ~BatchMatmul() = default; diff --git a/mindspore/core/ops/batch_norm.h b/mindspore/core/ops/batch_norm.h index 06aa5cae59..a4937f647f 100644 --- a/mindspore/core/ops/batch_norm.h +++ b/mindspore/core/ops/batch_norm.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { constexpr auto kNameBatchNorm = "BatchNorm"; -class BatchNorm : public PrimitiveC { +class MS_CORE_API BatchNorm : public PrimitiveC { public: BatchNorm() : PrimitiveC(kNameBatchNorm) { InitIOName({"x", "scale", "offset", "mean", "variance"}, diff --git a/mindspore/core/ops/batch_to_space.h b/mindspore/core/ops/batch_to_space.h index 8812999e02..0d776389b6 100644 --- a/mindspore/core/ops/batch_to_space.h +++ b/mindspore/core/ops/batch_to_space.h @@ -26,7 +26,7 @@ namespace mindspore { namespace ops { constexpr auto kNameBatchToSpace = "BatchToSpace"; -class BatchToSpace : public PrimitiveC { +class MS_CORE_API BatchToSpace : public PrimitiveC { public: BatchToSpace() : PrimitiveC(kNameBatchToSpace) {} ~BatchToSpace() = default; diff --git a/mindspore/core/ops/batch_to_space_nd.h b/mindspore/core/ops/batch_to_space_nd.h index 99df67a6ba..8c1d4bf62d 100644 --- a/mindspore/core/ops/batch_to_space_nd.h +++ b/mindspore/core/ops/batch_to_space_nd.h @@ -28,7 +28,7 @@ namespace mindspore { namespace ops { constexpr auto kNameBatchToSpaceND = "BatchToSpaceND"; -class BatchToSpaceND : public PrimitiveC { +class MS_CORE_API BatchToSpaceND : public PrimitiveC { public: BatchToSpaceND() : PrimitiveC(kNameBatchToSpaceND) {} ~BatchToSpaceND() = default; diff --git a/mindspore/core/ops/bias_add.h b/mindspore/core/ops/bias_add.h index 7a89b46a85..dbaf3518bd 100644 --- a/mindspore/core/ops/bias_add.h +++ b/mindspore/core/ops/bias_add.h @@ -29,7 +29,7 @@ namespace mindspore { namespace ops { constexpr auto kNameBiasAdd = prim::kBiasAdd; -class BiasAdd : public PrimitiveC { +class MS_CORE_API BiasAdd : public PrimitiveC { public: BiasAdd() : PrimitiveC(prim::kPrimBiasAdd->name()) { InitIOName({"x", "b"}, {"output"}); } ~BiasAdd() = default; diff --git a/mindspore/core/ops/binary_cross_entropy.h b/mindspore/core/ops/binary_cross_entropy.h index ce7a771d68..74e5416f5d 100644 --- a/mindspore/core/ops/binary_cross_entropy.h +++ b/mindspore/core/ops/binary_cross_entropy.h @@ -28,7 +28,7 @@ namespace mindspore { namespace ops { constexpr auto kNameBinaryCrossEntropy = "BinaryCrossEntropy"; -class BinaryCrossEntropy : public PrimitiveC { +class MS_CORE_API BinaryCrossEntropy : public PrimitiveC { public: BinaryCrossEntropy() : PrimitiveC(kNameBinaryCrossEntropy) {} ~BinaryCrossEntropy() = default; diff --git a/mindspore/core/ops/broadcast.h b/mindspore/core/ops/broadcast.h index e124b1e95e..080881ebbd 100644 --- a/mindspore/core/ops/broadcast.h +++ b/mindspore/core/ops/broadcast.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { constexpr auto kNameBroadcast = "Broadcast"; -class Broadcast : public PrimitiveC { +class MS_CORE_API Broadcast : public PrimitiveC { public: Broadcast() : PrimitiveC(kNameBroadcast) {} ~Broadcast() = default; diff --git a/mindspore/core/ops/broadcast_to.h b/mindspore/core/ops/broadcast_to.h index eff8abdcd0..dba6dd12f1 100644 --- a/mindspore/core/ops/broadcast_to.h +++ b/mindspore/core/ops/broadcast_to.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { -class BroadcastTo : public PrimitiveC { +class MS_CORE_API BroadcastTo : public PrimitiveC { public: BroadcastTo() : PrimitiveC(prim::kPrimBroadcastTo->name()) {} ~BroadcastTo() = default; diff --git a/mindspore/core/ops/call.h b/mindspore/core/ops/call.h index a316b5dd0b..68134d407b 100644 --- a/mindspore/core/ops/call.h +++ b/mindspore/core/ops/call.h @@ -23,7 +23,7 @@ namespace mindspore { namespace ops { constexpr auto kNameCall = "call"; -class Call : public PrimitiveC { +class MS_CORE_API Call : public PrimitiveC { public: Call() : PrimitiveC(kNameCall) {} ~Call() = default; diff --git a/mindspore/core/ops/cast.h b/mindspore/core/ops/cast.h index d543c5dcf1..b941fc1712 100644 --- a/mindspore/core/ops/cast.h +++ b/mindspore/core/ops/cast.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { constexpr auto kNameCast = "Cast"; -class Cast : public PrimitiveC { +class MS_CORE_API Cast : public PrimitiveC { public: Cast() : PrimitiveC(kNameCast) { InitIOName({"x", "dst_type"}, {"output"}); } ~Cast() = default; diff --git a/mindspore/core/ops/ceil.h b/mindspore/core/ops/ceil.h index 2b6df01ab0..9a7c51c2e4 100644 --- a/mindspore/core/ops/ceil.h +++ b/mindspore/core/ops/ceil.h @@ -26,7 +26,7 @@ namespace mindspore { namespace ops { constexpr auto kNameCeil = "Ceil"; -class Ceil : public PrimitiveC { +class MS_CORE_API Ceil : public PrimitiveC { public: Ceil() : PrimitiveC(kNameCeil) { InitIOName({"x"}, {"y"}); } ~Ceil() = default; diff --git a/mindspore/core/ops/clip.h b/mindspore/core/ops/clip.h index a62768643f..f0fb3a7b7d 100644 --- a/mindspore/core/ops/clip.h +++ b/mindspore/core/ops/clip.h @@ -24,7 +24,7 @@ namespace mindspore { namespace ops { constexpr auto kNameClip = "Clip"; -class Clip : public PrimitiveC { +class MS_CORE_API Clip : public PrimitiveC { public: Clip() : PrimitiveC(kNameClip) {} ~Clip() = default; diff --git a/mindspore/core/ops/concat.h b/mindspore/core/ops/concat.h index 1a13537905..4570dcccf8 100644 --- a/mindspore/core/ops/concat.h +++ b/mindspore/core/ops/concat.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { constexpr auto kNameConcat = "Concat"; -class Concat : public PrimitiveC { +class MS_CORE_API Concat : public PrimitiveC { public: Concat() : PrimitiveC(kNameConcat) {} ~Concat() = default; diff --git a/mindspore/core/ops/constant_of_shape.h b/mindspore/core/ops/constant_of_shape.h index 71e7e02fe8..537d2f3700 100644 --- a/mindspore/core/ops/constant_of_shape.h +++ b/mindspore/core/ops/constant_of_shape.h @@ -25,7 +25,7 @@ namespace mindspore { namespace ops { constexpr auto kNameConstantOfShape = "ConstantOfShape"; -class ConstantOfShape : public PrimitiveC { +class MS_CORE_API ConstantOfShape : public PrimitiveC { public: ConstantOfShape() : PrimitiveC(kNameConstantOfShape) {} ~ConstantOfShape() = default; diff --git a/mindspore/core/ops/control_depend.h b/mindspore/core/ops/control_depend.h index 91feede28b..f6cd375506 100644 --- a/mindspore/core/ops/control_depend.h +++ b/mindspore/core/ops/control_depend.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { constexpr auto kNameControlDepend = "ControlDepend"; -class ControlDepend : public PrimitiveC { +class MS_CORE_API ControlDepend : public PrimitiveC { public: ControlDepend() : PrimitiveC(kNameControlDepend) {} ~ControlDepend() = default; diff --git a/mindspore/core/ops/conv2d.h b/mindspore/core/ops/conv2d.h index 9639d8383d..13446a96e4 100644 --- a/mindspore/core/ops/conv2d.h +++ b/mindspore/core/ops/conv2d.h @@ -28,7 +28,7 @@ namespace mindspore { namespace ops { constexpr auto kNameConv2D = "Conv2D"; -class Conv2D : public PrimitiveC { +class MS_CORE_API Conv2D : public PrimitiveC { public: Conv2D() : PrimitiveC(kNameConv2D) { InitIOName({"x", "w"}, {"output"}); } explicit Conv2D(const std::string k_name) : PrimitiveC(k_name) { InitIOName({"x", "w"}, {"output"}); } diff --git a/mindspore/core/ops/conv2d_transpose.h b/mindspore/core/ops/conv2d_transpose.h index a88e50a3a9..2c4720efee 100644 --- a/mindspore/core/ops/conv2d_transpose.h +++ b/mindspore/core/ops/conv2d_transpose.h @@ -28,7 +28,7 @@ namespace mindspore { namespace ops { constexpr auto kNameConv2DTranspose = "Conv2DTranspose"; -class Conv2DTranspose : public PrimitiveC { +class MS_CORE_API Conv2DTranspose : public PrimitiveC { public: Conv2DTranspose() : PrimitiveC(kNameConv2DTranspose) { InitIOName({"out_backprop", "filter", "input_sizes"}, {"output"}); diff --git a/mindspore/core/ops/cos.h b/mindspore/core/ops/cos.h index 136e4f96e5..4430947fc9 100644 --- a/mindspore/core/ops/cos.h +++ b/mindspore/core/ops/cos.h @@ -26,7 +26,7 @@ namespace mindspore { namespace ops { constexpr auto kNameCos = "Cos"; -class Cos : public PrimitiveC { +class MS_CORE_API Cos : public PrimitiveC { public: Cos() : PrimitiveC(kNameCos) {} ~Cos() = default; diff --git a/mindspore/core/ops/crop.h b/mindspore/core/ops/crop.h index 676df602cc..af48b4c8a0 100644 --- a/mindspore/core/ops/crop.h +++ b/mindspore/core/ops/crop.h @@ -26,7 +26,7 @@ namespace mindspore { namespace ops { constexpr auto kNameCrop = "Crop"; -class Crop : public PrimitiveC { +class MS_CORE_API Crop : public PrimitiveC { public: Crop() : PrimitiveC(kNameCrop) {} ~Crop() = default; diff --git a/mindspore/core/ops/crop_and_resize.h b/mindspore/core/ops/crop_and_resize.h index 18c7d6c751..04d712209e 100644 --- a/mindspore/core/ops/crop_and_resize.h +++ b/mindspore/core/ops/crop_and_resize.h @@ -25,7 +25,7 @@ namespace mindspore { namespace ops { constexpr auto kNameCropAndResize = "CropAndResize"; -class CropAndResize : public PrimitiveC { +class MS_CORE_API CropAndResize : public PrimitiveC { public: CropAndResize() : PrimitiveC(kNameCropAndResize) { InitIOName({"x", "boxes", "box_index", "crop_size"}, {"y"}); } ~CropAndResize() = default; diff --git a/mindspore/core/ops/ctc_loss_v2.h b/mindspore/core/ops/ctc_loss_v2.h index 0be3a7fb46..4c331da78c 100644 --- a/mindspore/core/ops/ctc_loss_v2.h +++ b/mindspore/core/ops/ctc_loss_v2.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { constexpr auto kNameCTCLossV2 = "CTCLossV2"; -class CTCLossV2 : public PrimitiveC { +class MS_CORE_API CTCLossV2 : public PrimitiveC { public: CTCLossV2() : PrimitiveC(kNameCTCLossV2) { InitIOName({"log_probs", "targets", "input_lengths", "target_lengths"}, {"neg_log_likelihood", "log_alpha"}); diff --git a/mindspore/core/ops/ctc_loss_v2_grad.h b/mindspore/core/ops/ctc_loss_v2_grad.h index d7fa4446ec..7ab2519225 100644 --- a/mindspore/core/ops/ctc_loss_v2_grad.h +++ b/mindspore/core/ops/ctc_loss_v2_grad.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { constexpr auto kNameCTCLossV2Grad = "CTCLossV2Grad"; -class CTCLossV2Grad : public PrimitiveC { +class MS_CORE_API CTCLossV2Grad : public PrimitiveC { public: CTCLossV2Grad() : PrimitiveC(kNameCTCLossV2Grad) { InitIOName( diff --git a/mindspore/core/ops/ctcloss.h b/mindspore/core/ops/ctcloss.h index ae251df463..4e24a95b0c 100644 --- a/mindspore/core/ops/ctcloss.h +++ b/mindspore/core/ops/ctcloss.h @@ -24,7 +24,7 @@ namespace mindspore { namespace ops { -class CTCLoss : public PrimitiveC { +class MS_CORE_API CTCLoss : public PrimitiveC { public: CTCLoss() : PrimitiveC(prim::kPrimCTCLoss->name()) {} ~CTCLoss() = default; diff --git a/mindspore/core/ops/cumsum.h b/mindspore/core/ops/cumsum.h index d458187e3d..f84dc72d92 100644 --- a/mindspore/core/ops/cumsum.h +++ b/mindspore/core/ops/cumsum.h @@ -26,7 +26,7 @@ namespace mindspore { namespace ops { constexpr auto kNameCumSum = "CumSum"; -class CumSum : public PrimitiveC { +class MS_CORE_API CumSum : public PrimitiveC { public: CumSum() : PrimitiveC(kNameCumSum) {} ~CumSum() = default; diff --git a/mindspore/core/ops/custom.h b/mindspore/core/ops/custom.h index 52a5204945..8dc62efd9a 100644 --- a/mindspore/core/ops/custom.h +++ b/mindspore/core/ops/custom.h @@ -29,7 +29,7 @@ namespace mindspore { namespace ops { constexpr auto kNameCustom = "Custom"; -class Custom : public PrimitiveC { +class MS_CORE_API Custom : public PrimitiveC { public: Custom() : PrimitiveC(kNameCustom) {} ~Custom() override = default; diff --git a/mindspore/core/ops/custom_extract_features.h b/mindspore/core/ops/custom_extract_features.h index f9976cdea4..f2ec0b3814 100644 --- a/mindspore/core/ops/custom_extract_features.h +++ b/mindspore/core/ops/custom_extract_features.h @@ -25,7 +25,7 @@ namespace mindspore { namespace ops { constexpr auto kNameCustomExtractFeatures = "CustomExtractFeatures"; -class CustomExtractFeatures : public PrimitiveC { +class MS_CORE_API CustomExtractFeatures : public PrimitiveC { public: CustomExtractFeatures() : PrimitiveC(kNameCustomExtractFeatures) {} ~CustomExtractFeatures() = default; diff --git a/mindspore/core/ops/custom_normalize.h b/mindspore/core/ops/custom_normalize.h index 21256921c2..5348c572fd 100644 --- a/mindspore/core/ops/custom_normalize.h +++ b/mindspore/core/ops/custom_normalize.h @@ -25,7 +25,7 @@ namespace mindspore { namespace ops { constexpr auto kNameCustomNormalize = "CustomNormalize"; -class CustomNormalize : public PrimitiveC { +class MS_CORE_API CustomNormalize : public PrimitiveC { public: CustomNormalize() : PrimitiveC(kNameCustomNormalize) {} ~CustomNormalize() = default; diff --git a/mindspore/core/ops/custom_predict.h b/mindspore/core/ops/custom_predict.h index aadb72b260..6b22a01bea 100644 --- a/mindspore/core/ops/custom_predict.h +++ b/mindspore/core/ops/custom_predict.h @@ -26,7 +26,7 @@ namespace mindspore { namespace ops { constexpr auto kNameCustomPredict = "CustomPredict"; -class CustomPredict : public PrimitiveC { +class MS_CORE_API CustomPredict : public PrimitiveC { public: CustomPredict() : PrimitiveC(kNameCustomPredict) {} ~CustomPredict() = default; diff --git a/mindspore/core/ops/depend.h b/mindspore/core/ops/depend.h index 8d13812455..97232aabaa 100644 --- a/mindspore/core/ops/depend.h +++ b/mindspore/core/ops/depend.h @@ -26,7 +26,7 @@ namespace mindspore { namespace ops { constexpr auto kNameDepend = "Depend"; -class Depend : public PrimitiveC { +class MS_CORE_API Depend : public PrimitiveC { public: Depend() : PrimitiveC(kNameDepend) {} ~Depend() = default; diff --git a/mindspore/core/ops/depth_to_space.h b/mindspore/core/ops/depth_to_space.h index c8cb0263ff..35db7f015c 100644 --- a/mindspore/core/ops/depth_to_space.h +++ b/mindspore/core/ops/depth_to_space.h @@ -28,7 +28,7 @@ namespace mindspore { namespace ops { constexpr auto kNameDepthToSpace = "DepthToSpace"; -class DepthToSpace : public PrimitiveC { +class MS_CORE_API DepthToSpace : public PrimitiveC { public: DepthToSpace() : PrimitiveC(kNameDepthToSpace) { InitIOName({"x"}, {"y"}); } ~DepthToSpace() = default; diff --git a/mindspore/core/ops/detection_post_process.h b/mindspore/core/ops/detection_post_process.h index e6308858ce..fc31dce688 100644 --- a/mindspore/core/ops/detection_post_process.h +++ b/mindspore/core/ops/detection_post_process.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { constexpr auto kNameDetectionPostProcess = "DetectionPostProcess"; -class DetectionPostProcess : public PrimitiveC { +class MS_CORE_API DetectionPostProcess : public PrimitiveC { public: DetectionPostProcess() : PrimitiveC(kNameDetectionPostProcess) {} ~DetectionPostProcess() = default; diff --git a/mindspore/core/ops/diag.h b/mindspore/core/ops/diag.h index 916b8ad50d..11a8479e81 100644 --- a/mindspore/core/ops/diag.h +++ b/mindspore/core/ops/diag.h @@ -24,7 +24,7 @@ namespace mindspore { namespace ops { -class Diag : public PrimitiveC { +class MS_CORE_API Diag : public PrimitiveC { public: Diag() : PrimitiveC(prim::kPrimDiag->name()) { InitIOName({"input_x"}, {"output"}); } ~Diag() = default; diff --git a/mindspore/core/ops/diag_part.h b/mindspore/core/ops/diag_part.h index 393b232916..cdd5f00241 100644 --- a/mindspore/core/ops/diag_part.h +++ b/mindspore/core/ops/diag_part.h @@ -24,7 +24,7 @@ namespace mindspore { namespace ops { -class DiagPart : public PrimitiveC { +class MS_CORE_API DiagPart : public PrimitiveC { public: DiagPart() : PrimitiveC(prim::kPrimDiagPart->name()) { InitIOName({"input_x"}, {"output"}); } ~DiagPart() = default; diff --git a/mindspore/core/ops/div.h b/mindspore/core/ops/div.h index 5ee3ebf57c..d89ecf6c16 100644 --- a/mindspore/core/ops/div.h +++ b/mindspore/core/ops/div.h @@ -26,7 +26,7 @@ namespace mindspore { namespace ops { constexpr auto kNameDiv = "Div"; -class Div : public PrimitiveC { +class MS_CORE_API Div : public PrimitiveC { public: Div() : PrimitiveC(kNameDiv) { InitIOName({"x", "y"}, {"output"}); } explicit Div(const std::string k_name) : PrimitiveC(k_name) { InitIOName({"x", "y"}, {"output"}); } diff --git a/mindspore/core/ops/dropout.h b/mindspore/core/ops/dropout.h index e8e19400c1..f7c8285aff 100644 --- a/mindspore/core/ops/dropout.h +++ b/mindspore/core/ops/dropout.h @@ -26,7 +26,7 @@ namespace mindspore { namespace ops { constexpr auto kNameDropout = "Dropout"; -class Dropout : public PrimitiveC { +class MS_CORE_API Dropout : public PrimitiveC { public: Dropout() : PrimitiveC(kNameDropout) {} ~Dropout() = default; diff --git a/mindspore/core/ops/dropout_do_mask.h b/mindspore/core/ops/dropout_do_mask.h index b728b116ff..188686dc13 100644 --- a/mindspore/core/ops/dropout_do_mask.h +++ b/mindspore/core/ops/dropout_do_mask.h @@ -25,7 +25,7 @@ namespace mindspore { namespace ops { -class DropoutDoMask : public PrimitiveC { +class MS_CORE_API DropoutDoMask : public PrimitiveC { public: DropoutDoMask() : PrimitiveC(prim::kPrimDropoutDoMask->name()) {} ~DropoutDoMask() = default; diff --git a/mindspore/core/ops/dropout_gen_mask.h b/mindspore/core/ops/dropout_gen_mask.h index 7f485d24cf..d466dee4d8 100644 --- a/mindspore/core/ops/dropout_gen_mask.h +++ b/mindspore/core/ops/dropout_gen_mask.h @@ -25,7 +25,7 @@ namespace mindspore { namespace ops { -class DropoutGenMask : public PrimitiveC { +class MS_CORE_API DropoutGenMask : public PrimitiveC { public: DropoutGenMask() : PrimitiveC(prim::kPrimDropoutGenMask->name()) {} ~DropoutGenMask() = default; diff --git a/mindspore/core/ops/dtype.h b/mindspore/core/ops/dtype.h index e7029a6676..e2818a8e73 100644 --- a/mindspore/core/ops/dtype.h +++ b/mindspore/core/ops/dtype.h @@ -26,7 +26,7 @@ namespace mindspore { namespace ops { -class DType : public PrimitiveC { +class MS_CORE_API DType : public PrimitiveC { public: DType() : PrimitiveC(prim::kPrimDType->name()) { InitIOName({"x"}, {"output"}); } ~DType() = default; diff --git a/mindspore/core/ops/dynamic_broadcast_gradient_args.h b/mindspore/core/ops/dynamic_broadcast_gradient_args.h index ce1d1863d0..37b1d14aee 100644 --- a/mindspore/core/ops/dynamic_broadcast_gradient_args.h +++ b/mindspore/core/ops/dynamic_broadcast_gradient_args.h @@ -23,7 +23,7 @@ namespace mindspore { namespace ops { -class DynamicBroadcastGradientArgs : public PrimitiveC { +class MS_CORE_API DynamicBroadcastGradientArgs : public PrimitiveC { public: DynamicBroadcastGradientArgs() : PrimitiveC(prim::kPrimDynamicBroadcastGradientArgs->name()) {} ~DynamicBroadcastGradientArgs() = default; diff --git a/mindspore/core/ops/eltwise.h b/mindspore/core/ops/eltwise.h index ec0347a9f2..1de61eff97 100644 --- a/mindspore/core/ops/eltwise.h +++ b/mindspore/core/ops/eltwise.h @@ -23,7 +23,7 @@ namespace mindspore { namespace ops { constexpr auto kNameEltwise = "Eltwise"; -class Eltwise : public PrimitiveC { +class MS_CORE_API Eltwise : public PrimitiveC { public: Eltwise() : PrimitiveC(kNameEltwise) {} ~Eltwise() = default; diff --git a/mindspore/core/ops/elu.h b/mindspore/core/ops/elu.h index 3da8c1b202..39d1126aec 100644 --- a/mindspore/core/ops/elu.h +++ b/mindspore/core/ops/elu.h @@ -26,7 +26,7 @@ namespace mindspore { namespace ops { constexpr auto kNameElu = "Elu"; -class Elu : public PrimitiveC { +class MS_CORE_API Elu : public PrimitiveC { public: Elu() : PrimitiveC(kNameElu) {} ~Elu() = default; diff --git a/mindspore/core/ops/embedding_lookup.h b/mindspore/core/ops/embedding_lookup.h index 9997232fc1..6a742a1d8f 100644 --- a/mindspore/core/ops/embedding_lookup.h +++ b/mindspore/core/ops/embedding_lookup.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { constexpr auto kNameEmbeddingLookup = "EmbeddingLookup"; -class EmbeddingLookup : public PrimitiveC { +class MS_CORE_API EmbeddingLookup : public PrimitiveC { public: EmbeddingLookup() : PrimitiveC(kNameEmbeddingLookup) { InitIOName({"params", "indices", "offset"}, {"output"}); } ~EmbeddingLookup() = default; diff --git a/mindspore/core/ops/equal.h b/mindspore/core/ops/equal.h index aebeae317b..22382505a3 100644 --- a/mindspore/core/ops/equal.h +++ b/mindspore/core/ops/equal.h @@ -26,7 +26,7 @@ namespace mindspore { namespace ops { constexpr auto kNameEqual = prim::kEqual; -class Equal : public PrimitiveC { +class MS_CORE_API Equal : public PrimitiveC { public: Equal() : PrimitiveC(prim::kPrimEqual->name()) { InitIOName({"x", "y"}, {"output"}); } ~Equal() = default; diff --git a/mindspore/core/ops/erf.h b/mindspore/core/ops/erf.h index 75b7d18c2e..b186515f7d 100644 --- a/mindspore/core/ops/erf.h +++ b/mindspore/core/ops/erf.h @@ -25,7 +25,7 @@ namespace mindspore { namespace ops { constexpr auto kNameErf = "Erf"; -class Erf : public PrimitiveC { +class MS_CORE_API Erf : public PrimitiveC { public: Erf() : PrimitiveC(kNameErf) { InitIOName({"x"}, {"y"}); } ~Erf() = default; diff --git a/mindspore/core/ops/exp.h b/mindspore/core/ops/exp.h index 84bf600e32..299d3e6b3b 100644 --- a/mindspore/core/ops/exp.h +++ b/mindspore/core/ops/exp.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { constexpr auto kNameExp = prim::kExp; -class Exp : public PrimitiveC { +class MS_CORE_API Exp : public PrimitiveC { public: Exp() : PrimitiveC(prim::kPrimExp->name()) { InitIOName({"x"}, {"y"}); } explicit Exp(const std::string k_name) : PrimitiveC(k_name) { InitIOName({"x"}, {"y"}); } diff --git a/mindspore/core/ops/expand_dims.h b/mindspore/core/ops/expand_dims.h index 084d38d7b8..ce0a20f716 100644 --- a/mindspore/core/ops/expand_dims.h +++ b/mindspore/core/ops/expand_dims.h @@ -25,7 +25,7 @@ namespace mindspore { namespace ops { constexpr auto kNameExpandDims = "ExpandDims"; -class ExpandDims : public PrimitiveC { +class MS_CORE_API ExpandDims : public PrimitiveC { public: ExpandDims() : PrimitiveC(kNameExpandDims) { InitIOName({"x", "axis"}, {"output"}); } ~ExpandDims() = default; diff --git a/mindspore/core/ops/fake_quant_with_min_max_vars.h b/mindspore/core/ops/fake_quant_with_min_max_vars.h index fb7091a69d..d69c06b65d 100644 --- a/mindspore/core/ops/fake_quant_with_min_max_vars.h +++ b/mindspore/core/ops/fake_quant_with_min_max_vars.h @@ -25,7 +25,7 @@ namespace mindspore { namespace ops { constexpr auto kNameFakeQuantWithMinMaxVars = "FakeQuantWithMinMaxVars"; -class FakeQuantWithMinMaxVars : public PrimitiveC { +class MS_CORE_API FakeQuantWithMinMaxVars : public PrimitiveC { public: FakeQuantWithMinMaxVars() : PrimitiveC(kNameFakeQuantWithMinMaxVars) {} ~FakeQuantWithMinMaxVars() = default; diff --git a/mindspore/core/ops/fake_quant_with_min_max_vars_per_channel.h b/mindspore/core/ops/fake_quant_with_min_max_vars_per_channel.h index ebfae11f5c..95ae325618 100644 --- a/mindspore/core/ops/fake_quant_with_min_max_vars_per_channel.h +++ b/mindspore/core/ops/fake_quant_with_min_max_vars_per_channel.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { constexpr auto kNameFakeQuantWithMinMaxVarsPerChannel = "FakeQuantWithMinMaxVarsPerChannel"; -class FakeQuantWithMinMaxVarsPerChannel : public PrimitiveC { +class MS_CORE_API FakeQuantWithMinMaxVarsPerChannel : public PrimitiveC { public: FakeQuantWithMinMaxVarsPerChannel() : PrimitiveC(kNameFakeQuantWithMinMaxVarsPerChannel) {} ~FakeQuantWithMinMaxVarsPerChannel() = default; diff --git a/mindspore/core/ops/fft_imag.h b/mindspore/core/ops/fft_imag.h index c0a3d2301a..c72a60cbb0 100644 --- a/mindspore/core/ops/fft_imag.h +++ b/mindspore/core/ops/fft_imag.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { constexpr auto kNameFftImag = "FftImag"; -class FftImag : public PrimitiveC { +class MS_CORE_API FftImag : public PrimitiveC { public: FftImag() : PrimitiveC(kNameFftImag) {} ~FftImag() = default; diff --git a/mindspore/core/ops/fft_real.h b/mindspore/core/ops/fft_real.h index 5aee608219..ffae2ea236 100644 --- a/mindspore/core/ops/fft_real.h +++ b/mindspore/core/ops/fft_real.h @@ -26,7 +26,7 @@ namespace mindspore { namespace ops { constexpr auto kNameFftReal = "FftReal"; -class FftReal : public PrimitiveC { +class MS_CORE_API FftReal : public PrimitiveC { public: FftReal() : PrimitiveC(kNameFftReal) {} ~FftReal() = default; diff --git a/mindspore/core/ops/fill.h b/mindspore/core/ops/fill.h index c983c5a54d..79db0a55a6 100644 --- a/mindspore/core/ops/fill.h +++ b/mindspore/core/ops/fill.h @@ -26,7 +26,7 @@ namespace mindspore { namespace ops { constexpr auto kNameFill = "Fill"; -class Fill : public PrimitiveC { +class MS_CORE_API Fill : public PrimitiveC { public: Fill() : PrimitiveC(kNameFill) {} ~Fill() = default; diff --git a/mindspore/core/ops/flatten.h b/mindspore/core/ops/flatten.h index 164e7ccda6..da6cb8233f 100644 --- a/mindspore/core/ops/flatten.h +++ b/mindspore/core/ops/flatten.h @@ -26,7 +26,7 @@ namespace mindspore { namespace ops { constexpr auto kNameFlatten = "Flatten"; -class Flatten : public PrimitiveC { +class MS_CORE_API Flatten : public PrimitiveC { public: Flatten() : PrimitiveC(kNameFlatten) {} ~Flatten() = default; diff --git a/mindspore/core/ops/floor.h b/mindspore/core/ops/floor.h index 67f8c222f7..eae5d79141 100644 --- a/mindspore/core/ops/floor.h +++ b/mindspore/core/ops/floor.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { constexpr auto kNameFloor = "Floor"; -class Floor : public PrimitiveC { +class MS_CORE_API Floor : public PrimitiveC { public: Floor() : PrimitiveC(kNameFloor) { InitIOName({"x"}, {"y"}); } ~Floor() = default; diff --git a/mindspore/core/ops/floor_div.h b/mindspore/core/ops/floor_div.h index 66a0ed9432..052947b831 100644 --- a/mindspore/core/ops/floor_div.h +++ b/mindspore/core/ops/floor_div.h @@ -23,7 +23,7 @@ namespace mindspore { namespace ops { constexpr auto kNameFloorDiv = "FloorDiv"; -class FloorDiv : public PrimitiveC { +class MS_CORE_API FloorDiv : public PrimitiveC { public: FloorDiv() : PrimitiveC(kNameFloorDiv) { InitIOName({"x", "y"}, {"output"}); } ~FloorDiv() = default; diff --git a/mindspore/core/ops/floor_mod.h b/mindspore/core/ops/floor_mod.h index 0410873412..3b7561663e 100644 --- a/mindspore/core/ops/floor_mod.h +++ b/mindspore/core/ops/floor_mod.h @@ -23,7 +23,7 @@ namespace mindspore { namespace ops { constexpr auto kNameFloorMod = "FloorMod"; -class FloorMod : public PrimitiveC { +class MS_CORE_API FloorMod : public PrimitiveC { public: FloorMod() : PrimitiveC(kNameFloorMod) { InitIOName({"x", "y"}, {"output"}); } ~FloorMod() = default; diff --git a/mindspore/core/ops/fused_batch_norm.h b/mindspore/core/ops/fused_batch_norm.h index 0642ab7319..bce3246487 100644 --- a/mindspore/core/ops/fused_batch_norm.h +++ b/mindspore/core/ops/fused_batch_norm.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { constexpr auto kNameFusedBatchNorm = "FusedBatchNorm"; -class FusedBatchNorm : public PrimitiveC { +class MS_CORE_API FusedBatchNorm : public PrimitiveC { public: FusedBatchNorm() : PrimitiveC(kNameFusedBatchNorm) { InitIOName({"x", "scale", "b", "mean", "variance"}, diff --git a/mindspore/core/ops/fusion/activation.h b/mindspore/core/ops/fusion/activation.h index b153197b9e..b893e4b313 100644 --- a/mindspore/core/ops/fusion/activation.h +++ b/mindspore/core/ops/fusion/activation.h @@ -23,7 +23,7 @@ namespace mindspore { namespace ops { constexpr auto kNameActivation = "Activation"; -class Activation : public PrimitiveC { +class MS_CORE_API Activation : public PrimitiveC { public: Activation() : PrimitiveC(kNameActivation) {} ~Activation() = default; diff --git a/mindspore/core/ops/fusion/add_fusion.h b/mindspore/core/ops/fusion/add_fusion.h index 2131549dc8..f52a6717ab 100644 --- a/mindspore/core/ops/fusion/add_fusion.h +++ b/mindspore/core/ops/fusion/add_fusion.h @@ -26,7 +26,7 @@ namespace mindspore { namespace ops { constexpr auto kNameAddFusion = "AddFusion"; -class AddFusion : public Add { +class MS_CORE_API AddFusion : public Add { public: AddFusion() : Add(kNameAddFusion) { InitIOName({"x", "y"}, {"output"}); } ~AddFusion() = default; diff --git a/mindspore/core/ops/fusion/adder_fusion.h b/mindspore/core/ops/fusion/adder_fusion.h index 1d01ff4ccf..633aecc705 100644 --- a/mindspore/core/ops/fusion/adder_fusion.h +++ b/mindspore/core/ops/fusion/adder_fusion.h @@ -28,7 +28,7 @@ namespace mindspore { namespace ops { constexpr auto kNameAdderFusion = "AdderFusion"; -class AdderFusion : public Adder { +class MS_CORE_API AdderFusion : public Adder { public: AdderFusion() : Adder(kNameAdderFusion) {} ~AdderFusion() = default; diff --git a/mindspore/core/ops/fusion/arg_max_fusion.h b/mindspore/core/ops/fusion/arg_max_fusion.h index 8ccf011914..25edea542d 100644 --- a/mindspore/core/ops/fusion/arg_max_fusion.h +++ b/mindspore/core/ops/fusion/arg_max_fusion.h @@ -24,7 +24,7 @@ namespace mindspore { namespace ops { constexpr auto kNameArgMaxFusion = "ArgMaxFusion"; -class ArgMaxFusion : public ArgMax { +class MS_CORE_API ArgMaxFusion : public ArgMax { public: ArgMaxFusion() : ArgMax(kNameArgMaxFusion) { InitIOName({"x"}, {"output"}); } ~ArgMaxFusion() = default; diff --git a/mindspore/core/ops/fusion/arg_min_fusion.h b/mindspore/core/ops/fusion/arg_min_fusion.h index f165cd530c..10e18e9b33 100644 --- a/mindspore/core/ops/fusion/arg_min_fusion.h +++ b/mindspore/core/ops/fusion/arg_min_fusion.h @@ -24,7 +24,7 @@ namespace mindspore { namespace ops { constexpr auto kNameArgMinFusion = "ArgMinFusion"; -class ArgMinFusion : public ArgMin { +class MS_CORE_API ArgMinFusion : public ArgMin { public: ArgMinFusion() : ArgMin(kNameArgMinFusion) { InitIOName({"x"}, {"output"}); } ~ArgMinFusion() = default; diff --git a/mindspore/core/ops/fusion/avg_pool_fusion.h b/mindspore/core/ops/fusion/avg_pool_fusion.h index 04f2e929dd..c6e3e679c3 100644 --- a/mindspore/core/ops/fusion/avg_pool_fusion.h +++ b/mindspore/core/ops/fusion/avg_pool_fusion.h @@ -26,7 +26,7 @@ namespace mindspore { namespace ops { constexpr auto kNameAvgPoolFusion = "AvgPoolFusion"; -class AvgPoolFusion : public AvgPool { +class MS_CORE_API AvgPoolFusion : public AvgPool { public: AvgPoolFusion() : AvgPool(kNameAvgPoolFusion) { InitIOName({"x"}, {"output"}); } ~AvgPoolFusion() = default; diff --git a/mindspore/core/ops/fusion/conv2d_backprop_filter_fusion.h b/mindspore/core/ops/fusion/conv2d_backprop_filter_fusion.h index de8c7851bb..c68b3c313d 100644 --- a/mindspore/core/ops/fusion/conv2d_backprop_filter_fusion.h +++ b/mindspore/core/ops/fusion/conv2d_backprop_filter_fusion.h @@ -26,7 +26,7 @@ namespace mindspore { namespace ops { constexpr auto kNameConv2DBackpropFilterFusion = "Conv2DBackpropFilterFusion"; -class Conv2DBackpropFilterFusion : public Conv2DBackpropFilter { +class MS_CORE_API Conv2DBackpropFilterFusion : public Conv2DBackpropFilter { public: Conv2DBackpropFilterFusion() : Conv2DBackpropFilter(kNameConv2DBackpropFilterFusion) { InitIOName({"out_backprop", "input", "filter_sizes"}, {"output"}); diff --git a/mindspore/core/ops/fusion/conv2d_backprop_input_fusion.h b/mindspore/core/ops/fusion/conv2d_backprop_input_fusion.h index f76858e3f3..3bec6953bd 100644 --- a/mindspore/core/ops/fusion/conv2d_backprop_input_fusion.h +++ b/mindspore/core/ops/fusion/conv2d_backprop_input_fusion.h @@ -24,7 +24,7 @@ namespace mindspore { namespace ops { constexpr auto kNameConv2DBackpropInputFusion = "Conv2DBackpropInputFusion"; -class Conv2DBackpropInputFusion : public Conv2DBackpropInput { +class MS_CORE_API Conv2DBackpropInputFusion : public Conv2DBackpropInput { public: Conv2DBackpropInputFusion() : Conv2DBackpropInput(kNameConv2DBackpropInputFusion) {} ~Conv2DBackpropInputFusion() = default; diff --git a/mindspore/core/ops/fusion/conv2d_fusion.h b/mindspore/core/ops/fusion/conv2d_fusion.h index 9d4a4561de..60fbfb628b 100644 --- a/mindspore/core/ops/fusion/conv2d_fusion.h +++ b/mindspore/core/ops/fusion/conv2d_fusion.h @@ -25,7 +25,7 @@ namespace mindspore { namespace ops { constexpr auto kNameConv2DFusion = "Conv2DFusion"; -class Conv2DFusion : public Conv2D { +class MS_CORE_API Conv2DFusion : public Conv2D { public: Conv2DFusion() : Conv2D(kNameConv2DFusion) {} ~Conv2DFusion() = default; diff --git a/mindspore/core/ops/fusion/conv2d_transpose_fusion.h b/mindspore/core/ops/fusion/conv2d_transpose_fusion.h index daec73ccee..2d5c3f58d6 100644 --- a/mindspore/core/ops/fusion/conv2d_transpose_fusion.h +++ b/mindspore/core/ops/fusion/conv2d_transpose_fusion.h @@ -25,7 +25,7 @@ namespace mindspore { namespace ops { constexpr auto kNameConv2dTransposeFusion = "Conv2dTransposeFusion"; -class Conv2dTransposeFusion : public Conv2DTranspose { +class MS_CORE_API Conv2dTransposeFusion : public Conv2DTranspose { public: Conv2dTransposeFusion() : Conv2DTranspose(kNameConv2dTransposeFusion) { InitIOName({"out_backprop", "filter", "input_sizes"}, {"output"}); diff --git a/mindspore/core/ops/fusion/div_fusion.h b/mindspore/core/ops/fusion/div_fusion.h index c04ec4c0ed..8e2b63ee2f 100644 --- a/mindspore/core/ops/fusion/div_fusion.h +++ b/mindspore/core/ops/fusion/div_fusion.h @@ -23,7 +23,7 @@ namespace mindspore { namespace ops { constexpr auto kNameDivFusion = "DivFusion"; -class DivFusion : public Div { +class MS_CORE_API DivFusion : public Div { public: DivFusion() : Div(kNameDivFusion) {} ~DivFusion() = default; diff --git a/mindspore/core/ops/fusion/embedding_lookup_fusion.h b/mindspore/core/ops/fusion/embedding_lookup_fusion.h index a88c9e05aa..62e686361a 100644 --- a/mindspore/core/ops/fusion/embedding_lookup_fusion.h +++ b/mindspore/core/ops/fusion/embedding_lookup_fusion.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { constexpr auto kNameEmbeddingLookupFusion = "EmbeddingLookupFusion"; -class EmbeddingLookupFusion : public PrimitiveC { +class MS_CORE_API EmbeddingLookupFusion : public PrimitiveC { public: EmbeddingLookupFusion() : PrimitiveC(kNameEmbeddingLookupFusion) { InitIOName({"params", "indices", "offset"}, {"output"}); diff --git a/mindspore/core/ops/fusion/exp_fusion.h b/mindspore/core/ops/fusion/exp_fusion.h index be0b7bb313..21a0675311 100644 --- a/mindspore/core/ops/fusion/exp_fusion.h +++ b/mindspore/core/ops/fusion/exp_fusion.h @@ -23,7 +23,7 @@ namespace mindspore { namespace ops { constexpr auto kNameExpFusion = "ExpFusion"; -class ExpFusion : public Exp { +class MS_CORE_API ExpFusion : public Exp { public: ExpFusion() : Exp(kNameExpFusion) { InitIOName({"x"}, {"y"}); } ~ExpFusion() = default; diff --git a/mindspore/core/ops/fusion/full_connection.h b/mindspore/core/ops/fusion/full_connection.h index 80984b03a8..ea9ce4b083 100644 --- a/mindspore/core/ops/fusion/full_connection.h +++ b/mindspore/core/ops/fusion/full_connection.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { constexpr auto kNameFullConnection = "FullConnection"; -class FullConnection : public PrimitiveC { +class MS_CORE_API FullConnection : public PrimitiveC { public: FullConnection() : PrimitiveC(kNameFullConnection) { InitIOName({"x1", "x2", "b"}, {"output"}); } ~FullConnection() = default; diff --git a/mindspore/core/ops/fusion/l2_normalize_fusion.h b/mindspore/core/ops/fusion/l2_normalize_fusion.h index 6afa60b77d..430ebe4489 100644 --- a/mindspore/core/ops/fusion/l2_normalize_fusion.h +++ b/mindspore/core/ops/fusion/l2_normalize_fusion.h @@ -25,7 +25,7 @@ namespace mindspore { namespace ops { constexpr auto kNameL2NormalizeFusion = "L2NormalizeFusion"; -class L2NormalizeFusion : public L2Normalize { +class MS_CORE_API L2NormalizeFusion : public L2Normalize { public: L2NormalizeFusion() : L2Normalize(kNameL2NormalizeFusion) {} ~L2NormalizeFusion() = default; diff --git a/mindspore/core/ops/fusion/layer_norm_fusion.h b/mindspore/core/ops/fusion/layer_norm_fusion.h index f83f1721cc..0c256074e2 100644 --- a/mindspore/core/ops/fusion/layer_norm_fusion.h +++ b/mindspore/core/ops/fusion/layer_norm_fusion.h @@ -26,7 +26,7 @@ namespace mindspore { namespace ops { constexpr auto kNameLayerNormFusion = "LayerNormFusion"; -class LayerNormFusion : public LayerNorm { +class MS_CORE_API LayerNormFusion : public LayerNorm { public: LayerNormFusion() : LayerNorm(kNameLayerNormFusion) {} ~LayerNormFusion() = default; diff --git a/mindspore/core/ops/fusion/max_pool_fusion.h b/mindspore/core/ops/fusion/max_pool_fusion.h index bf2ea3db28..6397a9817e 100644 --- a/mindspore/core/ops/fusion/max_pool_fusion.h +++ b/mindspore/core/ops/fusion/max_pool_fusion.h @@ -26,7 +26,7 @@ namespace mindspore { namespace ops { constexpr auto kNameMaxPoolFusion = "MaxPoolFusion"; -class MaxPoolFusion : public MaxPool { +class MS_CORE_API MaxPoolFusion : public MaxPool { public: MaxPoolFusion() : MaxPool(kNameMaxPoolFusion) { InitIOName({"x"}, {"output"}); } ~MaxPoolFusion() = default; diff --git a/mindspore/core/ops/fusion/mul_fusion.h b/mindspore/core/ops/fusion/mul_fusion.h index 592865978c..106d0b6c0f 100644 --- a/mindspore/core/ops/fusion/mul_fusion.h +++ b/mindspore/core/ops/fusion/mul_fusion.h @@ -23,7 +23,7 @@ namespace mindspore { namespace ops { constexpr auto kNameMulFusion = "MulFusion"; -class MulFusion : public Mul { +class MS_CORE_API MulFusion : public Mul { public: MulFusion() : Mul(kNameMulFusion) { InitIOName({"x", "y"}, {"output"}); } ~MulFusion() = default; diff --git a/mindspore/core/ops/fusion/pad_fusion.h b/mindspore/core/ops/fusion/pad_fusion.h index e64e2cf346..96707868b9 100644 --- a/mindspore/core/ops/fusion/pad_fusion.h +++ b/mindspore/core/ops/fusion/pad_fusion.h @@ -23,7 +23,7 @@ namespace mindspore { namespace ops { constexpr auto kNamePadFusion = "PadFusion"; -class PadFusion : public Pad { +class MS_CORE_API PadFusion : public Pad { public: PadFusion() : Pad(kNamePadFusion) { InitIOName({"x"}, {"y"}); } ~PadFusion() = default; diff --git a/mindspore/core/ops/fusion/partial_fusion.h b/mindspore/core/ops/fusion/partial_fusion.h index 4acbf776d6..e7d0b52103 100644 --- a/mindspore/core/ops/fusion/partial_fusion.h +++ b/mindspore/core/ops/fusion/partial_fusion.h @@ -23,7 +23,7 @@ namespace mindspore { namespace ops { constexpr auto kNamePartialFusion = "PartialFusion"; -class PartialFusion : public PrimitiveC { +class MS_CORE_API PartialFusion : public PrimitiveC { public: PartialFusion() : PrimitiveC(kNamePartialFusion) {} ~PartialFusion() = default; diff --git a/mindspore/core/ops/fusion/pow_fusion.h b/mindspore/core/ops/fusion/pow_fusion.h index 695f46a74e..a06d5560e0 100644 --- a/mindspore/core/ops/fusion/pow_fusion.h +++ b/mindspore/core/ops/fusion/pow_fusion.h @@ -23,7 +23,7 @@ namespace mindspore { namespace ops { constexpr auto kNamePowFusion = "PowFusion"; -class PowFusion : public Pow { +class MS_CORE_API PowFusion : public Pow { public: PowFusion() : Pow(kNamePowFusion) {} ~PowFusion() = default; diff --git a/mindspore/core/ops/fusion/prelu_fusion.h b/mindspore/core/ops/fusion/prelu_fusion.h index 8f4243c6e1..a054ea639c 100644 --- a/mindspore/core/ops/fusion/prelu_fusion.h +++ b/mindspore/core/ops/fusion/prelu_fusion.h @@ -25,7 +25,7 @@ namespace mindspore { namespace ops { constexpr auto kNamePReLUFusion = "PReLUFusion"; -class PReLUFusion : public PReLU { +class MS_CORE_API PReLUFusion : public PReLU { public: PReLUFusion() : PReLU(kNamePReLUFusion) {} ~PReLUFusion() = default; diff --git a/mindspore/core/ops/fusion/reduce_fusion.h b/mindspore/core/ops/fusion/reduce_fusion.h index 18657ae964..81793fb7a5 100644 --- a/mindspore/core/ops/fusion/reduce_fusion.h +++ b/mindspore/core/ops/fusion/reduce_fusion.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { constexpr auto kNameReduceFusion = "ReduceFusion"; -class ReduceFusion : public Reduce { +class MS_CORE_API ReduceFusion : public Reduce { public: ReduceFusion() : Reduce(kNameReduceFusion) {} ~ReduceFusion() = default; diff --git a/mindspore/core/ops/fusion/scale_fusion.h b/mindspore/core/ops/fusion/scale_fusion.h index f9571c7f2f..fd5282aaed 100644 --- a/mindspore/core/ops/fusion/scale_fusion.h +++ b/mindspore/core/ops/fusion/scale_fusion.h @@ -23,7 +23,7 @@ namespace mindspore { namespace ops { constexpr auto kNameScaleFusion = "ScaleFusion"; -class ScaleFusion : public Scale { +class MS_CORE_API ScaleFusion : public Scale { public: ScaleFusion() : Scale(kNameScaleFusion) {} ~ScaleFusion() = default; diff --git a/mindspore/core/ops/fusion/slice_fusion.h b/mindspore/core/ops/fusion/slice_fusion.h index 61155136cb..e924e285e5 100644 --- a/mindspore/core/ops/fusion/slice_fusion.h +++ b/mindspore/core/ops/fusion/slice_fusion.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { constexpr auto kNameSliceFusion = "SliceFusion"; -class SliceFusion : public PrimitiveC { +class MS_CORE_API SliceFusion : public PrimitiveC { public: SliceFusion() : PrimitiveC(kNameSliceFusion) { InitIOName({"x", "begin", "size"}, {"output"}); } ~SliceFusion() = default; diff --git a/mindspore/core/ops/fusion/sub_fusion.h b/mindspore/core/ops/fusion/sub_fusion.h index 9bbb797689..07d060409a 100644 --- a/mindspore/core/ops/fusion/sub_fusion.h +++ b/mindspore/core/ops/fusion/sub_fusion.h @@ -23,7 +23,7 @@ namespace mindspore { namespace ops { constexpr auto kNameSubFusion = "SubFusion"; -class SubFusion : public Sub { +class MS_CORE_API SubFusion : public Sub { public: SubFusion() : Sub(kNameSubFusion) {} ~SubFusion() = default; diff --git a/mindspore/core/ops/fusion/tile_fusion.h b/mindspore/core/ops/fusion/tile_fusion.h index def292c62d..0233881010 100644 --- a/mindspore/core/ops/fusion/tile_fusion.h +++ b/mindspore/core/ops/fusion/tile_fusion.h @@ -25,7 +25,7 @@ namespace mindspore { namespace ops { constexpr auto kNameTileFusion = "TileFusion"; -class TileFusion : public Tile { +class MS_CORE_API TileFusion : public Tile { public: TileFusion() : Tile(kNameTileFusion) {} ~TileFusion() = default; diff --git a/mindspore/core/ops/fusion/topk_fusion.h b/mindspore/core/ops/fusion/topk_fusion.h index 03d7801d19..47e953b12b 100644 --- a/mindspore/core/ops/fusion/topk_fusion.h +++ b/mindspore/core/ops/fusion/topk_fusion.h @@ -25,7 +25,7 @@ namespace mindspore { namespace ops { constexpr auto kNameTopKFusion = "TopKFusion"; -class TopKFusion : public TopK { +class MS_CORE_API TopKFusion : public TopK { public: TopKFusion() : TopK(kNameTopKFusion) {} ~TopKFusion() = default; diff --git a/mindspore/core/ops/gather.h b/mindspore/core/ops/gather.h index ea46370cf3..89e31321d1 100644 --- a/mindspore/core/ops/gather.h +++ b/mindspore/core/ops/gather.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { constexpr auto kNameGather = "Gather"; -class Gather : public PrimitiveC { +class MS_CORE_API Gather : public PrimitiveC { public: Gather() : PrimitiveC(kNameGather) { InitIOName({"param", "indices", "axis"}, {"output"}); } ~Gather() = default; diff --git a/mindspore/core/ops/gather_d.h b/mindspore/core/ops/gather_d.h index 76021af100..dacc2c26f6 100644 --- a/mindspore/core/ops/gather_d.h +++ b/mindspore/core/ops/gather_d.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { -class GatherD : public PrimitiveC { +class MS_CORE_API GatherD : public PrimitiveC { public: GatherD() : PrimitiveC(prim::kPrimGatherD->name()) { InitIOName({"x", "dim", "index"}, {"output"}); } ~GatherD() = default; diff --git a/mindspore/core/ops/gather_nd.h b/mindspore/core/ops/gather_nd.h index 413c9d8f4e..834ce4404f 100644 --- a/mindspore/core/ops/gather_nd.h +++ b/mindspore/core/ops/gather_nd.h @@ -25,7 +25,7 @@ namespace mindspore { namespace ops { constexpr auto kNameGatherNd = "GatherNd"; -class GatherNd : public PrimitiveC { +class MS_CORE_API GatherNd : public PrimitiveC { public: GatherNd() : PrimitiveC(kNameGatherNd) { InitIOName({"input_x", "indices"}, {"y"}); } ~GatherNd() = default; diff --git a/mindspore/core/ops/gelu.h b/mindspore/core/ops/gelu.h index 17d83ac7e4..2a00410b31 100644 --- a/mindspore/core/ops/gelu.h +++ b/mindspore/core/ops/gelu.h @@ -25,7 +25,7 @@ namespace mindspore { namespace ops { constexpr auto kNameGeLU = prim::kGeLU; -class GeLU : public PrimitiveC { +class MS_CORE_API GeLU : public PrimitiveC { public: GeLU() : PrimitiveC(kNameGeLU) { InitIOName({"x"}, {"output"}); } ~GeLU() = default; diff --git a/mindspore/core/ops/getnext.h b/mindspore/core/ops/getnext.h index 78acd30f76..582ce34873 100644 --- a/mindspore/core/ops/getnext.h +++ b/mindspore/core/ops/getnext.h @@ -28,7 +28,7 @@ namespace mindspore { namespace ops { constexpr auto kNameGetNext = prim::kGetNext; -class GetNext : public PrimitiveC { +class MS_CORE_API GetNext : public PrimitiveC { public: GetNext() : PrimitiveC(prim::kPrimGetNext->name()) {} ~GetNext() = default; diff --git a/mindspore/core/ops/glu.h b/mindspore/core/ops/glu.h index f8929d7b9b..8a55d864ff 100644 --- a/mindspore/core/ops/glu.h +++ b/mindspore/core/ops/glu.h @@ -26,7 +26,7 @@ namespace mindspore { namespace ops { constexpr auto kNameGLU = prim::kGLU; -class GLU : public PrimitiveC { +class MS_CORE_API GLU : public PrimitiveC { public: GLU() : PrimitiveC(kNameGLU) { InitIOName({"x"}, {"output"}); } ~GLU() = default; diff --git a/mindspore/core/ops/grad/abs_grad.h b/mindspore/core/ops/grad/abs_grad.h index 82c7ed1357..7439158c91 100644 --- a/mindspore/core/ops/grad/abs_grad.h +++ b/mindspore/core/ops/grad/abs_grad.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { constexpr auto kNameAbsGrad = "AbsGrad"; -class AbsGrad : public PrimitiveC { +class MS_CORE_API AbsGrad : public PrimitiveC { public: AbsGrad() : PrimitiveC(kNameAbsGrad) {} ~AbsGrad() = default; diff --git a/mindspore/core/ops/grad/activation_grad.h b/mindspore/core/ops/grad/activation_grad.h index d1f71b5b73..9ef3709198 100644 --- a/mindspore/core/ops/grad/activation_grad.h +++ b/mindspore/core/ops/grad/activation_grad.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { constexpr auto kNameActivationGrad = "ActivationGrad"; -class ActivationGrad : public PrimitiveC { +class MS_CORE_API ActivationGrad : public PrimitiveC { public: ActivationGrad() : PrimitiveC(kNameActivationGrad) {} ~ActivationGrad() = default; diff --git a/mindspore/core/ops/grad/add_grad.h b/mindspore/core/ops/grad/add_grad.h index ff5afd99c3..ebe8ff71cb 100644 --- a/mindspore/core/ops/grad/add_grad.h +++ b/mindspore/core/ops/grad/add_grad.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { constexpr auto kNameAddGrad = "AddGrad"; -class AddGrad : public PrimitiveC { +class MS_CORE_API AddGrad : public PrimitiveC { public: AddGrad() : PrimitiveC(kNameAddGrad) {} ~AddGrad() = default; diff --git a/mindspore/core/ops/grad/avg_pool_3d_grad.h b/mindspore/core/ops/grad/avg_pool_3d_grad.h index 697cd26ee0..c25df35262 100644 --- a/mindspore/core/ops/grad/avg_pool_3d_grad.h +++ b/mindspore/core/ops/grad/avg_pool_3d_grad.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { -class AvgPool3DGrad : public PrimitiveC { +class MS_CORE_API AvgPool3DGrad : public PrimitiveC { public: AvgPool3DGrad() : PrimitiveC(prim::kPrimAvgPool3DGrad->name()) { InitIOName({"origin_input_size", "grad"}, {"output"}); diff --git a/mindspore/core/ops/grad/avg_pool_grad.h b/mindspore/core/ops/grad/avg_pool_grad.h index b408aa84e0..8f2abd5fe3 100644 --- a/mindspore/core/ops/grad/avg_pool_grad.h +++ b/mindspore/core/ops/grad/avg_pool_grad.h @@ -28,7 +28,7 @@ namespace mindspore { namespace ops { constexpr auto kNameAvgPoolGrad = "AvgPoolGrad"; -class AvgPoolGrad : public PoolGrad { +class MS_CORE_API AvgPoolGrad : public PoolGrad { public: AvgPoolGrad() : PoolGrad(kNameAvgPoolGrad) { InitIOName({"x_origin", "out_origin", "grad"}, {"output"}); } ~AvgPoolGrad() = default; diff --git a/mindspore/core/ops/grad/batch_norm_grad.h b/mindspore/core/ops/grad/batch_norm_grad.h index adc1a157f6..e92dbb678a 100644 --- a/mindspore/core/ops/grad/batch_norm_grad.h +++ b/mindspore/core/ops/grad/batch_norm_grad.h @@ -25,7 +25,7 @@ namespace mindspore { namespace ops { constexpr auto kNameBatchNormGrad = "BatchNormGrad"; -class BatchNormGrad : public PrimitiveC { +class MS_CORE_API BatchNormGrad : public PrimitiveC { public: BatchNormGrad() : PrimitiveC(kNameBatchNormGrad) {} ~BatchNormGrad() = default; diff --git a/mindspore/core/ops/grad/bias_add_grad.h b/mindspore/core/ops/grad/bias_add_grad.h index b1df50986d..f49e2daecd 100644 --- a/mindspore/core/ops/grad/bias_add_grad.h +++ b/mindspore/core/ops/grad/bias_add_grad.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { constexpr auto kNameBiasAddGrad = prim::kBiasAddGrad; -class BiasAddGrad : public PrimitiveC { +class MS_CORE_API BiasAddGrad : public PrimitiveC { public: BiasAddGrad() : PrimitiveC(prim::kPrimBiasAddGrad->name()) { InitIOName({"x"}, {"output"}); } ~BiasAddGrad() = default; diff --git a/mindspore/core/ops/grad/binary_cross_entropy_grad.h b/mindspore/core/ops/grad/binary_cross_entropy_grad.h index 3378febfb1..7bce73a760 100644 --- a/mindspore/core/ops/grad/binary_cross_entropy_grad.h +++ b/mindspore/core/ops/grad/binary_cross_entropy_grad.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { constexpr auto kNameBinaryCrossEntropyGrad = "BinaryCrossEntropyGrad"; -class BinaryCrossEntropyGrad : public PrimitiveC { +class MS_CORE_API BinaryCrossEntropyGrad : public PrimitiveC { public: BinaryCrossEntropyGrad() : PrimitiveC(kNameBinaryCrossEntropyGrad) {} ~BinaryCrossEntropyGrad() = default; diff --git a/mindspore/core/ops/grad/bn_grad.h b/mindspore/core/ops/grad/bn_grad.h index 2dee03a8b0..38ce31f6bd 100644 --- a/mindspore/core/ops/grad/bn_grad.h +++ b/mindspore/core/ops/grad/bn_grad.h @@ -24,7 +24,7 @@ namespace mindspore { namespace ops { constexpr auto kNameBNGrad = "BNGrad"; -class BNGrad : public PrimitiveC { +class MS_CORE_API BNGrad : public PrimitiveC { public: BNGrad() : PrimitiveC(kNameBNGrad) {} ~BNGrad() = default; diff --git a/mindspore/core/ops/grad/conv2d_backprop_filter.h b/mindspore/core/ops/grad/conv2d_backprop_filter.h index 3dac2274aa..51c80dff9e 100644 --- a/mindspore/core/ops/grad/conv2d_backprop_filter.h +++ b/mindspore/core/ops/grad/conv2d_backprop_filter.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { constexpr auto kNameConv2DBackpropFilter = "Conv2DBackpropFilter"; -class Conv2DBackpropFilter : public PrimitiveC { +class MS_CORE_API Conv2DBackpropFilter : public PrimitiveC { public: Conv2DBackpropFilter() : PrimitiveC(kNameConv2DBackpropFilter) { InitIOName({"out_backprop", "input", "filter_sizes"}, {"output"}); diff --git a/mindspore/core/ops/grad/conv2d_backprop_input.h b/mindspore/core/ops/grad/conv2d_backprop_input.h index 1889c2d5b2..b7ff96627c 100644 --- a/mindspore/core/ops/grad/conv2d_backprop_input.h +++ b/mindspore/core/ops/grad/conv2d_backprop_input.h @@ -28,7 +28,7 @@ namespace mindspore { namespace ops { constexpr auto kNameConv2DBackpropInput = "Conv2DBackpropInput"; -class Conv2DBackpropInput : public PrimitiveC { +class MS_CORE_API Conv2DBackpropInput : public PrimitiveC { public: explicit Conv2DBackpropInput(const std::string &k_name = kNameConv2DBackpropInput) : PrimitiveC(k_name) { InitIOName({"out_backprop", "filter", "input_sizes"}, {"output"}); diff --git a/mindspore/core/ops/grad/de_conv2d_grad_filter.h b/mindspore/core/ops/grad/de_conv2d_grad_filter.h index 24ee57084f..9c9be83281 100644 --- a/mindspore/core/ops/grad/de_conv2d_grad_filter.h +++ b/mindspore/core/ops/grad/de_conv2d_grad_filter.h @@ -25,7 +25,7 @@ namespace mindspore { namespace ops { constexpr auto kNameDeConv2DGradFilter = "DeConv2DGradFilter"; -class DeConv2DGradFilter : public PrimitiveC { +class MS_CORE_API DeConv2DGradFilter : public PrimitiveC { public: DeConv2DGradFilter() : PrimitiveC(kNameDeConv2DGradFilter) {} ~DeConv2DGradFilter() = default; diff --git a/mindspore/core/ops/grad/div_grad.h b/mindspore/core/ops/grad/div_grad.h index 1ec463808a..dd79e0c79d 100644 --- a/mindspore/core/ops/grad/div_grad.h +++ b/mindspore/core/ops/grad/div_grad.h @@ -23,7 +23,7 @@ namespace mindspore { namespace ops { constexpr auto kNameDivGrad = "DivGrad"; -class DivGrad : public PrimitiveC { +class MS_CORE_API DivGrad : public PrimitiveC { public: DivGrad() : PrimitiveC(kNameDivGrad) {} ~DivGrad() = default; diff --git a/mindspore/core/ops/grad/dropout_grad.h b/mindspore/core/ops/grad/dropout_grad.h index dcdd5fb6ee..c7edff172a 100644 --- a/mindspore/core/ops/grad/dropout_grad.h +++ b/mindspore/core/ops/grad/dropout_grad.h @@ -26,7 +26,7 @@ namespace mindspore { namespace ops { constexpr auto kNameDropoutGrad = "DropoutGrad"; -class DropoutGrad : public PrimitiveC { +class MS_CORE_API DropoutGrad : public PrimitiveC { public: DropoutGrad() : PrimitiveC(kNameDropoutGrad) {} ~DropoutGrad() = default; diff --git a/mindspore/core/ops/grad/flatten_grad.h b/mindspore/core/ops/grad/flatten_grad.h index 1a28b9213e..f492a53efb 100644 --- a/mindspore/core/ops/grad/flatten_grad.h +++ b/mindspore/core/ops/grad/flatten_grad.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { constexpr auto kNameFlattenGrad = "FlattenGrad"; -class FlattenGrad : public PrimitiveC { +class MS_CORE_API FlattenGrad : public PrimitiveC { public: FlattenGrad() : PrimitiveC(kNameFlattenGrad) { InitIOName({"x", "shape"}, {"output"}); } ~FlattenGrad() = default; diff --git a/mindspore/core/ops/grad/group_conv2d_grad_input.h b/mindspore/core/ops/grad/group_conv2d_grad_input.h index 998228e188..bb95f977ac 100644 --- a/mindspore/core/ops/grad/group_conv2d_grad_input.h +++ b/mindspore/core/ops/grad/group_conv2d_grad_input.h @@ -26,7 +26,7 @@ namespace mindspore { namespace ops { constexpr auto kNameGroupConv2DGradInput = "GroupConv2DGradInput"; -class GroupConv2DGradInput : public PrimitiveC { +class MS_CORE_API GroupConv2DGradInput : public PrimitiveC { public: GroupConv2DGradInput() : PrimitiveC(kNameGroupConv2DGradInput) {} ~GroupConv2DGradInput() = default; diff --git a/mindspore/core/ops/grad/hshrink_grad.h b/mindspore/core/ops/grad/hshrink_grad.h index 210b8b4796..45e92b79b3 100644 --- a/mindspore/core/ops/grad/hshrink_grad.h +++ b/mindspore/core/ops/grad/hshrink_grad.h @@ -25,7 +25,7 @@ namespace mindspore { namespace ops { constexpr auto kNameHShrinkGrad = "HShrinkGrad"; -class HShrinkGrad : public PrimitiveC { +class MS_CORE_API HShrinkGrad : public PrimitiveC { public: HShrinkGrad() : PrimitiveC(kNameHShrinkGrad) { InitIOName({"gradients", "features"}, {"backprops"}); } ~HShrinkGrad() = default; diff --git a/mindspore/core/ops/grad/hsigmoid_grad.h b/mindspore/core/ops/grad/hsigmoid_grad.h index eb1ec65a41..076fa64206 100644 --- a/mindspore/core/ops/grad/hsigmoid_grad.h +++ b/mindspore/core/ops/grad/hsigmoid_grad.h @@ -28,7 +28,7 @@ namespace mindspore { namespace ops { constexpr auto kNameHSigmoidGrad = "HSigmoidGrad"; -class HSigmoidGrad : public PrimitiveC { +class MS_CORE_API HSigmoidGrad : public PrimitiveC { public: HSigmoidGrad() : PrimitiveC(kNameHSigmoidGrad) { InitIOName({"grads", "input_x"}, {"output"}); } ~HSigmoidGrad() = default; diff --git a/mindspore/core/ops/grad/layer_norm_grad.h b/mindspore/core/ops/grad/layer_norm_grad.h index 0008ce2eb9..b99b0c681b 100644 --- a/mindspore/core/ops/grad/layer_norm_grad.h +++ b/mindspore/core/ops/grad/layer_norm_grad.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { constexpr auto kNameLayerNormGrad = prim::kLayerNormGrad; -class LayerNormGrad : public PrimitiveC { +class MS_CORE_API LayerNormGrad : public PrimitiveC { public: LayerNormGrad() : PrimitiveC(kNameLayerNormGrad) {} explicit LayerNormGrad(const std::string k_name) : PrimitiveC(k_name) {} diff --git a/mindspore/core/ops/grad/log_grad.h b/mindspore/core/ops/grad/log_grad.h index 0c8223e5fb..2c62cf814c 100644 --- a/mindspore/core/ops/grad/log_grad.h +++ b/mindspore/core/ops/grad/log_grad.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { constexpr auto kNameLogGrad = "LogGrad"; -class LogGrad : public PrimitiveC { +class MS_CORE_API LogGrad : public PrimitiveC { public: LogGrad() : PrimitiveC(kNameLogGrad) {} ~LogGrad() = default; diff --git a/mindspore/core/ops/grad/lstm_grad.h b/mindspore/core/ops/grad/lstm_grad.h index f91323d2c2..0c5402e4e1 100644 --- a/mindspore/core/ops/grad/lstm_grad.h +++ b/mindspore/core/ops/grad/lstm_grad.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { constexpr auto kNameLSTMGrad = "LSTMGrad"; -class LSTMGrad : public PrimitiveC { +class MS_CORE_API LSTMGrad : public PrimitiveC { public: LSTMGrad() : PrimitiveC(kNameLSTMGrad) {} ~LSTMGrad() = default; diff --git a/mindspore/core/ops/grad/max_pool_grad.h b/mindspore/core/ops/grad/max_pool_grad.h index 9ce85f601c..3cefec3db0 100644 --- a/mindspore/core/ops/grad/max_pool_grad.h +++ b/mindspore/core/ops/grad/max_pool_grad.h @@ -28,7 +28,7 @@ namespace mindspore { namespace ops { constexpr auto kNameMaxPoolGrad = "MaxPoolGrad"; -class MaxPoolGrad : public PoolGrad { +class MS_CORE_API MaxPoolGrad : public PoolGrad { public: MaxPoolGrad() : PoolGrad(kNameMaxPoolGrad) { InitIOName({"x_origin", "out_origin", "grad"}, {"output"}); } ~MaxPoolGrad() = default; diff --git a/mindspore/core/ops/grad/maximum_grad.h b/mindspore/core/ops/grad/maximum_grad.h index 149f925a7b..944324e45d 100644 --- a/mindspore/core/ops/grad/maximum_grad.h +++ b/mindspore/core/ops/grad/maximum_grad.h @@ -23,7 +23,7 @@ namespace mindspore { namespace ops { constexpr auto kNameMaximumGrad = "MaximumGrad"; -class MaximumGrad : public PrimitiveC { +class MS_CORE_API MaximumGrad : public PrimitiveC { public: MaximumGrad() : PrimitiveC(kNameMaximumGrad) {} ~MaximumGrad() = default; diff --git a/mindspore/core/ops/grad/minimum_grad.h b/mindspore/core/ops/grad/minimum_grad.h index c07b84ae10..0be842c255 100644 --- a/mindspore/core/ops/grad/minimum_grad.h +++ b/mindspore/core/ops/grad/minimum_grad.h @@ -23,7 +23,7 @@ namespace mindspore { namespace ops { constexpr auto kNameMinimumGrad = "MinimumGrad"; -class MinimumGrad : public PrimitiveC { +class MS_CORE_API MinimumGrad : public PrimitiveC { public: MinimumGrad() : PrimitiveC(kNameMinimumGrad) {} ~MinimumGrad() = default; diff --git a/mindspore/core/ops/grad/mul_grad.h b/mindspore/core/ops/grad/mul_grad.h index 879492e1de..92e41d76b8 100644 --- a/mindspore/core/ops/grad/mul_grad.h +++ b/mindspore/core/ops/grad/mul_grad.h @@ -24,7 +24,7 @@ namespace mindspore { namespace ops { constexpr auto kNameMulGrad = "MulGrad"; -class MulGrad : public PrimitiveC { +class MS_CORE_API MulGrad : public PrimitiveC { public: MulGrad() : PrimitiveC(kNameMulGrad) {} ~MulGrad() = default; diff --git a/mindspore/core/ops/grad/neg_grad.h b/mindspore/core/ops/grad/neg_grad.h index a46a70f5fb..f2d8c656a9 100644 --- a/mindspore/core/ops/grad/neg_grad.h +++ b/mindspore/core/ops/grad/neg_grad.h @@ -31,7 +31,7 @@ namespace mindspore { namespace ops { constexpr auto kNameNegGrad = "NegGrad"; -class NegGrad : public PrimitiveC { +class MS_CORE_API NegGrad : public PrimitiveC { public: NegGrad() : PrimitiveC(kNameNegGrad) {} ~NegGrad() = default; diff --git a/mindspore/core/ops/grad/pool_grad.h b/mindspore/core/ops/grad/pool_grad.h index 40bf1fec2f..3ceb81927d 100644 --- a/mindspore/core/ops/grad/pool_grad.h +++ b/mindspore/core/ops/grad/pool_grad.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { constexpr auto kNamePoolGrad = "PoolGrad"; -class PoolGrad : public PrimitiveC { +class MS_CORE_API PoolGrad : public PrimitiveC { public: PoolGrad() : PrimitiveC(kNamePoolGrad) { InitIOName({"x_origin", "out_origin", "grad"}, {"output"}); } explicit PoolGrad(const std::string k_name) : PrimitiveC(k_name) { diff --git a/mindspore/core/ops/grad/pooling_grad.h b/mindspore/core/ops/grad/pooling_grad.h index f6e542950e..b54feee1e2 100644 --- a/mindspore/core/ops/grad/pooling_grad.h +++ b/mindspore/core/ops/grad/pooling_grad.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { constexpr auto kNamePoolingGrad = "PoolingGrad"; -class PoolingGrad : public PrimitiveC { +class MS_CORE_API PoolingGrad : public PrimitiveC { public: PoolingGrad() : PrimitiveC(kNamePoolingGrad) {} ~PoolingGrad() = default; diff --git a/mindspore/core/ops/grad/power_grad.h b/mindspore/core/ops/grad/power_grad.h index 719a3d9aec..8581203786 100644 --- a/mindspore/core/ops/grad/power_grad.h +++ b/mindspore/core/ops/grad/power_grad.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { constexpr auto kNamePowerGrad = "PowerGrad"; -class PowerGrad : public PrimitiveC { +class MS_CORE_API PowerGrad : public PrimitiveC { public: PowerGrad() : PrimitiveC(kNamePowerGrad) {} ~PowerGrad() = default; diff --git a/mindspore/core/ops/grad/relu_grad.h b/mindspore/core/ops/grad/relu_grad.h index e8195c4788..24c53be664 100644 --- a/mindspore/core/ops/grad/relu_grad.h +++ b/mindspore/core/ops/grad/relu_grad.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { constexpr auto kNameReLUGrad = prim::kReLUGrad; -class ReLUGrad : public PrimitiveC { +class MS_CORE_API ReLUGrad : public PrimitiveC { public: ReLUGrad() : PrimitiveC(prim::kPrimReluGrad->name()) { InitIOName({"x"}, {"output"}); } ~ReLUGrad() = default; diff --git a/mindspore/core/ops/grad/relu_grad_v2.h b/mindspore/core/ops/grad/relu_grad_v2.h index 9117cdbd5f..3ab9f6f905 100644 --- a/mindspore/core/ops/grad/relu_grad_v2.h +++ b/mindspore/core/ops/grad/relu_grad_v2.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { constexpr auto kNameReLUGradV2 = prim::kReLUGradV2; -class ReLUGradV2 : public PrimitiveC { +class MS_CORE_API ReLUGradV2 : public PrimitiveC { public: ReLUGradV2() : PrimitiveC(prim::kPrimReluGradV2->name()) { InitIOName({"x"}, {"output"}); } ~ReLUGradV2() = default; diff --git a/mindspore/core/ops/grad/resize_grad.h b/mindspore/core/ops/grad/resize_grad.h index da41b61f0d..f3b8e536f5 100644 --- a/mindspore/core/ops/grad/resize_grad.h +++ b/mindspore/core/ops/grad/resize_grad.h @@ -25,7 +25,7 @@ namespace mindspore { namespace ops { constexpr auto kNameResizeGrad = "ResizeGrad"; -class ResizeGrad : public PrimitiveC { +class MS_CORE_API ResizeGrad : public PrimitiveC { public: ResizeGrad() : PrimitiveC(kNameResizeGrad) {} ~ResizeGrad() = default; diff --git a/mindspore/core/ops/grad/rsqrt_grad.h b/mindspore/core/ops/grad/rsqrt_grad.h index df6f9795fb..718ab0f51e 100644 --- a/mindspore/core/ops/grad/rsqrt_grad.h +++ b/mindspore/core/ops/grad/rsqrt_grad.h @@ -23,7 +23,7 @@ namespace mindspore { namespace ops { constexpr auto kNameRsqrtGrad = "RsqrtGrad"; -class RsqrtGrad : public PrimitiveC { +class MS_CORE_API RsqrtGrad : public PrimitiveC { public: RsqrtGrad() : PrimitiveC(kNameRsqrtGrad) { InitIOName({"out_backprop", "input"}, {"output"}); } ~RsqrtGrad() = default; diff --git a/mindspore/core/ops/grad/sigmoid_cross_entropy_with_logits_grad.h b/mindspore/core/ops/grad/sigmoid_cross_entropy_with_logits_grad.h index d25440ab07..36cc693e3c 100644 --- a/mindspore/core/ops/grad/sigmoid_cross_entropy_with_logits_grad.h +++ b/mindspore/core/ops/grad/sigmoid_cross_entropy_with_logits_grad.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { constexpr auto kNameSigmoidCrossEntropyWithLogitsGrad = "SigmoidCrossEntropyWithLogitsGrad"; -class SigmoidCrossEntropyWithLogitsGrad : public PrimitiveC { +class MS_CORE_API SigmoidCrossEntropyWithLogitsGrad : public PrimitiveC { public: SigmoidCrossEntropyWithLogitsGrad() : PrimitiveC(kNameSigmoidCrossEntropyWithLogitsGrad) { InitIOName({"x", "y", "dout"}, {"x_grad"}); diff --git a/mindspore/core/ops/grad/smooth_l1_loss_grad.h b/mindspore/core/ops/grad/smooth_l1_loss_grad.h index 4f87218a0c..50b907134e 100644 --- a/mindspore/core/ops/grad/smooth_l1_loss_grad.h +++ b/mindspore/core/ops/grad/smooth_l1_loss_grad.h @@ -26,7 +26,7 @@ namespace mindspore { namespace ops { constexpr auto kNameSmoothL1LossGrad = "SmoothL1LossGrad"; -class SmoothL1LossGrad : public PrimitiveC { +class MS_CORE_API SmoothL1LossGrad : public PrimitiveC { public: SmoothL1LossGrad() : PrimitiveC(kNameSmoothL1LossGrad) {} ~SmoothL1LossGrad() = default; diff --git a/mindspore/core/ops/grad/soft_margin_loss_grad.h b/mindspore/core/ops/grad/soft_margin_loss_grad.h index 152ff646fe..e5a47350ab 100644 --- a/mindspore/core/ops/grad/soft_margin_loss_grad.h +++ b/mindspore/core/ops/grad/soft_margin_loss_grad.h @@ -28,7 +28,7 @@ namespace mindspore { namespace ops { constexpr auto kNameSoftMarginLossGrad = "SoftMarginLossGrad"; -class SoftMarginLossGrad : public PrimitiveC { +class MS_CORE_API SoftMarginLossGrad : public PrimitiveC { public: SoftMarginLossGrad() : PrimitiveC(kNameSoftMarginLossGrad) { InitIOName({"predict", "label", "dout"}, {"gradient"}); } ~SoftMarginLossGrad() = default; diff --git a/mindspore/core/ops/grad/soft_shrink_grad.h b/mindspore/core/ops/grad/soft_shrink_grad.h index 248e698316..2629727343 100644 --- a/mindspore/core/ops/grad/soft_shrink_grad.h +++ b/mindspore/core/ops/grad/soft_shrink_grad.h @@ -28,7 +28,7 @@ namespace mindspore { namespace ops { constexpr auto kNameSoftShrinkGrad = "SoftShrinkGrad"; -class SoftShrinkGrad : public PrimitiveC { +class MS_CORE_API SoftShrinkGrad : public PrimitiveC { public: SoftShrinkGrad() : PrimitiveC(kNameSoftShrinkGrad) { InitIOName({"input_grad", "input_x"}, {"output"}); } ~SoftShrinkGrad() = default; diff --git a/mindspore/core/ops/grad/sqrt_grad.h b/mindspore/core/ops/grad/sqrt_grad.h index 4ff484fc8b..443a5121d0 100644 --- a/mindspore/core/ops/grad/sqrt_grad.h +++ b/mindspore/core/ops/grad/sqrt_grad.h @@ -23,7 +23,7 @@ namespace mindspore { namespace ops { constexpr auto kNameSqrtGrad = "SqrtGrad"; -class SqrtGrad : public PrimitiveC { +class MS_CORE_API SqrtGrad : public PrimitiveC { public: SqrtGrad() : PrimitiveC(kNameSqrtGrad) { InitIOName({"out_backprop", "input"}, {"output"}); } ~SqrtGrad() = default; diff --git a/mindspore/core/ops/grad/strided_slice_grad.h b/mindspore/core/ops/grad/strided_slice_grad.h index 0cbedd43f8..521696cee5 100644 --- a/mindspore/core/ops/grad/strided_slice_grad.h +++ b/mindspore/core/ops/grad/strided_slice_grad.h @@ -28,7 +28,7 @@ namespace mindspore { namespace ops { constexpr auto kNameStridedSliceGrad = "StridedSliceGrad"; -class StridedSliceGrad : public PrimitiveC { +class MS_CORE_API StridedSliceGrad : public PrimitiveC { public: StridedSliceGrad() : PrimitiveC(kNameStridedSliceGrad) {} ~StridedSliceGrad() = default; diff --git a/mindspore/core/ops/grad/sub_grad.h b/mindspore/core/ops/grad/sub_grad.h index c7b0f93f0d..282e12aac2 100644 --- a/mindspore/core/ops/grad/sub_grad.h +++ b/mindspore/core/ops/grad/sub_grad.h @@ -24,7 +24,7 @@ namespace mindspore { namespace ops { constexpr auto kNameSubGrad = "SubGrad"; -class SubGrad : public PrimitiveC { +class MS_CORE_API SubGrad : public PrimitiveC { public: SubGrad() : PrimitiveC(kNameSubGrad) {} ~SubGrad() = default; diff --git a/mindspore/core/ops/greater.h b/mindspore/core/ops/greater.h index 06751f9401..cff59d18df 100644 --- a/mindspore/core/ops/greater.h +++ b/mindspore/core/ops/greater.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { constexpr auto kNameGreater = "Greater"; -class Greater : public PrimitiveC { +class MS_CORE_API Greater : public PrimitiveC { public: Greater() : PrimitiveC(kNameGreater) { InitIOName({"x", "y"}, {"output"}); } ~Greater() = default; diff --git a/mindspore/core/ops/greater_equal.h b/mindspore/core/ops/greater_equal.h index d8151d3983..30adfe4276 100644 --- a/mindspore/core/ops/greater_equal.h +++ b/mindspore/core/ops/greater_equal.h @@ -26,7 +26,7 @@ namespace mindspore { namespace ops { constexpr auto kNameGreaterEqual = "GreaterEqual"; -class GreaterEqual : public PrimitiveC { +class MS_CORE_API GreaterEqual : public PrimitiveC { public: GreaterEqual() : PrimitiveC(kNameGreaterEqual) {} ~GreaterEqual() = default; diff --git a/mindspore/core/ops/gru.h b/mindspore/core/ops/gru.h index 5fcf49fc8a..2e953358fa 100644 --- a/mindspore/core/ops/gru.h +++ b/mindspore/core/ops/gru.h @@ -31,7 +31,7 @@ namespace mindspore { namespace ops { constexpr auto kNameGRU = "GRU"; -class GRU : public PrimitiveC { +class MS_CORE_API GRU : public PrimitiveC { public: GRU() : PrimitiveC(kNameGRU) { InitIOName({"x", "weight_input", "weight_hidden", "bias_input", "bias_hidden", "seq_length", "init_h"}, diff --git a/mindspore/core/ops/hashtable_lookup.h b/mindspore/core/ops/hashtable_lookup.h index 6ab20abb44..ae017be8c8 100644 --- a/mindspore/core/ops/hashtable_lookup.h +++ b/mindspore/core/ops/hashtable_lookup.h @@ -25,7 +25,7 @@ namespace mindspore { namespace ops { constexpr auto kNameHashtableLookup = "HashtableLookup"; -class HashtableLookup : public PrimitiveC { +class MS_CORE_API HashtableLookup : public PrimitiveC { public: HashtableLookup() : PrimitiveC(kNameHashtableLookup) {} ~HashtableLookup() = default; diff --git a/mindspore/core/ops/hshrink.h b/mindspore/core/ops/hshrink.h index 582e8847de..5bff01a831 100644 --- a/mindspore/core/ops/hshrink.h +++ b/mindspore/core/ops/hshrink.h @@ -26,7 +26,7 @@ namespace mindspore { namespace ops { constexpr auto kNameHShrink = "HShrink"; -class HShrink : public PrimitiveC { +class MS_CORE_API HShrink : public PrimitiveC { public: HShrink() : PrimitiveC(kNameHShrink) { InitIOName({"input_x"}, {"output"}); } ~HShrink() = default; diff --git a/mindspore/core/ops/hsigmoid.h b/mindspore/core/ops/hsigmoid.h index e6615c6c93..3ce1312c9f 100644 --- a/mindspore/core/ops/hsigmoid.h +++ b/mindspore/core/ops/hsigmoid.h @@ -26,7 +26,7 @@ namespace mindspore { namespace ops { constexpr auto kNameHSigmoid = "HSigmoid"; -class HSigmoid : public PrimitiveC { +class MS_CORE_API HSigmoid : public PrimitiveC { public: HSigmoid() : PrimitiveC(kNameHSigmoid) { InitIOName({"input_x"}, {"output"}); } ~HSigmoid() = default; diff --git a/mindspore/core/ops/identity.h b/mindspore/core/ops/identity.h index 164b9d805b..a973cad1ee 100644 --- a/mindspore/core/ops/identity.h +++ b/mindspore/core/ops/identity.h @@ -25,7 +25,7 @@ namespace mindspore { namespace ops { constexpr auto kNameIdentity = "Identity"; -class Identity : public PrimitiveC { +class MS_CORE_API Identity : public PrimitiveC { public: Identity() : PrimitiveC(kNameIdentity) {} ~Identity() = default; diff --git a/mindspore/core/ops/instance_norm.h b/mindspore/core/ops/instance_norm.h index d1cd8cc63b..7382826f2f 100644 --- a/mindspore/core/ops/instance_norm.h +++ b/mindspore/core/ops/instance_norm.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { constexpr auto kNameInstanceNorm = "InstanceNorm"; -class InstanceNorm : public PrimitiveC { +class MS_CORE_API InstanceNorm : public PrimitiveC { public: InstanceNorm() : PrimitiveC(kNameInstanceNorm) {} ~InstanceNorm() = default; diff --git a/mindspore/core/ops/invert_permutation.h b/mindspore/core/ops/invert_permutation.h index 6507e9f0ac..6b133ea0c3 100644 --- a/mindspore/core/ops/invert_permutation.h +++ b/mindspore/core/ops/invert_permutation.h @@ -25,7 +25,7 @@ namespace mindspore { namespace ops { constexpr auto kNameInvertPermutation = "InvertPermutation"; -class InvertPermutation : public PrimitiveC { +class MS_CORE_API InvertPermutation : public PrimitiveC { public: InvertPermutation() : PrimitiveC(kNameInvertPermutation) {} ~InvertPermutation() = default; diff --git a/mindspore/core/ops/is_finite.h b/mindspore/core/ops/is_finite.h index 8f73b7c24a..eb32ce0b09 100644 --- a/mindspore/core/ops/is_finite.h +++ b/mindspore/core/ops/is_finite.h @@ -24,7 +24,7 @@ namespace mindspore { namespace ops { constexpr auto kNameIsFinite = "IsFinite"; -class IsFinite : public PrimitiveC { +class MS_CORE_API IsFinite : public PrimitiveC { public: IsFinite() : PrimitiveC(kNameIsFinite) {} ~IsFinite() = default; diff --git a/mindspore/core/ops/l2_normalize.h b/mindspore/core/ops/l2_normalize.h index 0f9cd207d9..3219ac01e9 100644 --- a/mindspore/core/ops/l2_normalize.h +++ b/mindspore/core/ops/l2_normalize.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { constexpr auto kNameL2Normalize = "L2Normalize"; -class L2Normalize : public PrimitiveC { +class MS_CORE_API L2Normalize : public PrimitiveC { public: explicit L2Normalize(const std::string &name = kNameL2Normalize) : PrimitiveC(name) {} ~L2Normalize() = default; diff --git a/mindspore/core/ops/layer_norm.h b/mindspore/core/ops/layer_norm.h index 7ba475e502..3852fe3407 100644 --- a/mindspore/core/ops/layer_norm.h +++ b/mindspore/core/ops/layer_norm.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { constexpr auto kNameLayerNorm = prim::kLayerNorm; -class LayerNorm : public PrimitiveC { +class MS_CORE_API LayerNorm : public PrimitiveC { public: LayerNorm() : PrimitiveC(kNameLayerNorm) {} explicit LayerNorm(const std::string k_name) : PrimitiveC(k_name) {} diff --git a/mindspore/core/ops/leaky_relu.h b/mindspore/core/ops/leaky_relu.h index 09dc63915b..a907b8b326 100644 --- a/mindspore/core/ops/leaky_relu.h +++ b/mindspore/core/ops/leaky_relu.h @@ -28,7 +28,7 @@ namespace mindspore { namespace ops { constexpr auto kNameLeakyRelu = "LeakyRelu"; -class LeakyRelu : public PrimitiveC { +class MS_CORE_API LeakyRelu : public PrimitiveC { public: LeakyRelu() : PrimitiveC(kNameLeakyRelu) {} ~LeakyRelu() = default; diff --git a/mindspore/core/ops/less.h b/mindspore/core/ops/less.h index c5dd51835d..db2dfb7a56 100644 --- a/mindspore/core/ops/less.h +++ b/mindspore/core/ops/less.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { constexpr auto kNameLess = "Less"; -class Less : public PrimitiveC { +class MS_CORE_API Less : public PrimitiveC { public: Less() : PrimitiveC(kNameLess) { InitIOName({"x", "y"}, {"output"}); } ~Less() = default; diff --git a/mindspore/core/ops/less_equal.h b/mindspore/core/ops/less_equal.h index 70f228b6c5..71d40bfb8d 100644 --- a/mindspore/core/ops/less_equal.h +++ b/mindspore/core/ops/less_equal.h @@ -26,7 +26,7 @@ namespace mindspore { namespace ops { constexpr auto kNameLessEqual = "LessEqual"; -class LessEqual : public PrimitiveC { +class MS_CORE_API LessEqual : public PrimitiveC { public: LessEqual() : PrimitiveC(kNameLessEqual) { InitIOName({"x", "y"}, {"output"}); } ~LessEqual() = default; diff --git a/mindspore/core/ops/lin_space.h b/mindspore/core/ops/lin_space.h index 43b9bdf936..fa042a2440 100644 --- a/mindspore/core/ops/lin_space.h +++ b/mindspore/core/ops/lin_space.h @@ -26,7 +26,7 @@ namespace mindspore { namespace ops { constexpr auto kNameLinSpace = "LinSpace"; -class LinSpace : public PrimitiveC { +class MS_CORE_API LinSpace : public PrimitiveC { public: LinSpace() : PrimitiveC(kNameLinSpace) { InitIOName({"start", "stop", "num"}, {"output"}); } ~LinSpace() = default; diff --git a/mindspore/core/ops/log.h b/mindspore/core/ops/log.h index 43c1ea7415..19f955a10b 100644 --- a/mindspore/core/ops/log.h +++ b/mindspore/core/ops/log.h @@ -26,7 +26,7 @@ namespace mindspore { namespace ops { constexpr auto kNameLog = prim::kLog; -class Log : public PrimitiveC { +class MS_CORE_API Log : public PrimitiveC { public: Log() : PrimitiveC(prim::kPrimLog->name()) { InitIOName({"x"}, {"y"}); } ~Log() = default; diff --git a/mindspore/core/ops/log1p.h b/mindspore/core/ops/log1p.h index 58a8a0004e..dfc7daa237 100644 --- a/mindspore/core/ops/log1p.h +++ b/mindspore/core/ops/log1p.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { -class Log1p : public PrimitiveC { +class MS_CORE_API Log1p : public PrimitiveC { public: Log1p() : PrimitiveC(prim::kPrimLog1p->name()) { InitIOName({"x"}, {"y"}); } ~Log1p() = default; diff --git a/mindspore/core/ops/log_softmax.h b/mindspore/core/ops/log_softmax.h index 4815dbaf07..5b3238fca9 100644 --- a/mindspore/core/ops/log_softmax.h +++ b/mindspore/core/ops/log_softmax.h @@ -28,7 +28,7 @@ namespace mindspore { namespace ops { constexpr auto kNameLogSoftmax = "LogSoftmax"; -class LogSoftmax : public PrimitiveC { +class MS_CORE_API LogSoftmax : public PrimitiveC { public: LogSoftmax() : PrimitiveC(kNameLogSoftmax) { InitIOName({"x"}, {"output"}); } ~LogSoftmax() = default; diff --git a/mindspore/core/ops/logical_and.h b/mindspore/core/ops/logical_and.h index e05099afdb..325bf9b440 100644 --- a/mindspore/core/ops/logical_and.h +++ b/mindspore/core/ops/logical_and.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { constexpr auto kNameLogicalAnd = "LogicalAnd"; -class LogicalAnd : public PrimitiveC { +class MS_CORE_API LogicalAnd : public PrimitiveC { public: LogicalAnd() : PrimitiveC(kNameLogicalAnd) { InitIOName({"x", "y"}, {"output"}); } ~LogicalAnd() = default; diff --git a/mindspore/core/ops/logical_not.h b/mindspore/core/ops/logical_not.h index 8fea01be8b..9b70e49b78 100644 --- a/mindspore/core/ops/logical_not.h +++ b/mindspore/core/ops/logical_not.h @@ -25,7 +25,7 @@ namespace mindspore { namespace ops { constexpr auto kNameLogicalNot = "LogicalNot"; -class LogicalNot : public PrimitiveC { +class MS_CORE_API LogicalNot : public PrimitiveC { public: LogicalNot() : PrimitiveC(kNameLogicalNot) { InitIOName({"x"}, {"output"}); } ~LogicalNot() = default; diff --git a/mindspore/core/ops/logical_or.h b/mindspore/core/ops/logical_or.h index 0e3fc4b8c1..a687f4d7bb 100644 --- a/mindspore/core/ops/logical_or.h +++ b/mindspore/core/ops/logical_or.h @@ -25,7 +25,7 @@ namespace mindspore { namespace ops { constexpr auto kNameLogicalOr = "LogicalOr"; -class LogicalOr : public PrimitiveC { +class MS_CORE_API LogicalOr : public PrimitiveC { public: LogicalOr() : PrimitiveC(kNameLogicalOr) { InitIOName({"x", "y"}, {"output"}); } ~LogicalOr() = default; diff --git a/mindspore/core/ops/logical_xor.h b/mindspore/core/ops/logical_xor.h index c765f7b3c6..020e314e58 100644 --- a/mindspore/core/ops/logical_xor.h +++ b/mindspore/core/ops/logical_xor.h @@ -23,7 +23,7 @@ namespace mindspore { namespace ops { constexpr auto kNameLogicalXor = "LogicalXor"; -class LogicalXor : public PrimitiveC { +class MS_CORE_API LogicalXor : public PrimitiveC { public: LogicalXor() : PrimitiveC(kNameLogicalXor) {} ~LogicalXor() = default; diff --git a/mindspore/core/ops/lp_normalization.h b/mindspore/core/ops/lp_normalization.h index f3851233de..73e3c2a649 100644 --- a/mindspore/core/ops/lp_normalization.h +++ b/mindspore/core/ops/lp_normalization.h @@ -25,7 +25,7 @@ namespace mindspore { namespace ops { constexpr auto kNameLpNormalization = "LpNormalization"; -class LpNormalization : public PrimitiveC { +class MS_CORE_API LpNormalization : public PrimitiveC { public: LpNormalization() : PrimitiveC(kNameLpNormalization) {} ~LpNormalization() = default; diff --git a/mindspore/core/ops/lrn.h b/mindspore/core/ops/lrn.h index 460ea584e0..1ccbba332e 100644 --- a/mindspore/core/ops/lrn.h +++ b/mindspore/core/ops/lrn.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { constexpr auto kNameLRN = "LRN"; -class LRN : public PrimitiveC { +class MS_CORE_API LRN : public PrimitiveC { public: LRN() : PrimitiveC(kNameLRN) { InitIOName({"x"}, {"y"}); } ~LRN() = default; diff --git a/mindspore/core/ops/lsh_projection.h b/mindspore/core/ops/lsh_projection.h index a122f7001d..55656d43c3 100644 --- a/mindspore/core/ops/lsh_projection.h +++ b/mindspore/core/ops/lsh_projection.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { constexpr auto kNameLshProjection = "LshProjection"; -class LshProjection : public PrimitiveC { +class MS_CORE_API LshProjection : public PrimitiveC { public: LshProjection() : PrimitiveC(kNameLshProjection) {} ~LshProjection() = default; diff --git a/mindspore/core/ops/lstm.h b/mindspore/core/ops/lstm.h index 4d128e8896..106a891aa5 100644 --- a/mindspore/core/ops/lstm.h +++ b/mindspore/core/ops/lstm.h @@ -31,7 +31,7 @@ namespace mindspore { namespace ops { constexpr auto kNameLSTM = "LSTM"; -class LSTM : public PrimitiveC { +class MS_CORE_API LSTM : public PrimitiveC { public: LSTM() : PrimitiveC(kNameLSTM) {} ~LSTM() = default; diff --git a/mindspore/core/ops/mat_mul.h b/mindspore/core/ops/mat_mul.h index d1c8a04fd2..0371c7ce22 100644 --- a/mindspore/core/ops/mat_mul.h +++ b/mindspore/core/ops/mat_mul.h @@ -28,7 +28,7 @@ namespace mindspore { namespace ops { constexpr auto kNameMatMul = "MatMul"; -class MatMul : public PrimitiveC { +class MS_CORE_API MatMul : public PrimitiveC { public: MatMul() : PrimitiveC(kNameMatMul) { InitIOName({"x1", "x2"}, {"output"}); } ~MatMul() = default; diff --git a/mindspore/core/ops/max_pool.h b/mindspore/core/ops/max_pool.h index c0c6e93e24..3355d03602 100644 --- a/mindspore/core/ops/max_pool.h +++ b/mindspore/core/ops/max_pool.h @@ -28,7 +28,7 @@ namespace mindspore { namespace ops { constexpr auto kNameMaxPool = "MaxPool"; -class MaxPool : public PrimitiveC { +class MS_CORE_API MaxPool : public PrimitiveC { public: MaxPool() : PrimitiveC(kNameMaxPool) { InitIOName({"x"}, {"output"}); } explicit MaxPool(const std::string k_name) : PrimitiveC(k_name) { InitIOName({"x"}, {"output"}); } diff --git a/mindspore/core/ops/maximum.h b/mindspore/core/ops/maximum.h index 3550d80b90..0b026f0722 100644 --- a/mindspore/core/ops/maximum.h +++ b/mindspore/core/ops/maximum.h @@ -25,7 +25,7 @@ namespace mindspore { namespace ops { constexpr auto kNameMaximum = "Maximum"; -class Maximum : public PrimitiveC { +class MS_CORE_API Maximum : public PrimitiveC { public: Maximum() : PrimitiveC(kNameMaximum) { InitIOName({"x", "y"}, {"output"}); } ~Maximum() = default; diff --git a/mindspore/core/ops/merge.h b/mindspore/core/ops/merge.h index 7268e36fa4..d0f0264644 100644 --- a/mindspore/core/ops/merge.h +++ b/mindspore/core/ops/merge.h @@ -25,7 +25,7 @@ namespace mindspore { namespace ops { constexpr auto kNameMerge = "Merge"; -class Merge : public PrimitiveC { +class MS_CORE_API Merge : public PrimitiveC { public: Merge() : PrimitiveC(kNameMerge) {} ~Merge() = default; diff --git a/mindspore/core/ops/mfcc.h b/mindspore/core/ops/mfcc.h index 0975fd61f6..0791ab2478 100644 --- a/mindspore/core/ops/mfcc.h +++ b/mindspore/core/ops/mfcc.h @@ -25,7 +25,7 @@ namespace mindspore { namespace ops { constexpr auto kNameMfcc = "Mfcc"; -class Mfcc : public PrimitiveC { +class MS_CORE_API Mfcc : public PrimitiveC { public: Mfcc() : PrimitiveC(kNameMfcc) {} ~Mfcc() = default; diff --git a/mindspore/core/ops/minimum.h b/mindspore/core/ops/minimum.h index 4dccb391bb..29446abcea 100644 --- a/mindspore/core/ops/minimum.h +++ b/mindspore/core/ops/minimum.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { constexpr auto kNameMinimum = "Minimum"; -class Minimum : public PrimitiveC { +class MS_CORE_API Minimum : public PrimitiveC { public: Minimum() : PrimitiveC(kNameMinimum) { InitIOName({"x", "y"}, {"output"}); } ~Minimum() = default; diff --git a/mindspore/core/ops/mod.h b/mindspore/core/ops/mod.h index 1b2af25513..921ac34cab 100644 --- a/mindspore/core/ops/mod.h +++ b/mindspore/core/ops/mod.h @@ -23,7 +23,7 @@ namespace mindspore { namespace ops { constexpr auto kNameMod = "Mod"; -class Mod : public PrimitiveC { +class MS_CORE_API Mod : public PrimitiveC { public: Mod() : PrimitiveC(kNameMod) { InitIOName({"x", "y"}, {"output"}); } ~Mod() = default; diff --git a/mindspore/core/ops/mul.h b/mindspore/core/ops/mul.h index d12e72e0d0..7067a0ac95 100644 --- a/mindspore/core/ops/mul.h +++ b/mindspore/core/ops/mul.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { constexpr auto kNameMul = prim::kMul; -class Mul : public PrimitiveC { +class MS_CORE_API Mul : public PrimitiveC { public: Mul() : PrimitiveC(kNameMul) { InitIOName({"x", "y"}, {"output"}); } explicit Mul(const std::string k_name) : PrimitiveC(k_name) { InitIOName({"x", "y"}, {"output"}); } diff --git a/mindspore/core/ops/neg.h b/mindspore/core/ops/neg.h index f9a8c8c344..8b7a009828 100644 --- a/mindspore/core/ops/neg.h +++ b/mindspore/core/ops/neg.h @@ -25,7 +25,7 @@ namespace mindspore { namespace ops { constexpr auto kNameNeg = prim::kNeg; -class Neg : public PrimitiveC { +class MS_CORE_API Neg : public PrimitiveC { public: Neg() : PrimitiveC(prim::kPrimNeg->name()) { InitIOName({"x"}, {"y"}); } ~Neg() = default; diff --git a/mindspore/core/ops/neighborexchange.h b/mindspore/core/ops/neighborexchange.h index 58f1e53da4..40900667ba 100644 --- a/mindspore/core/ops/neighborexchange.h +++ b/mindspore/core/ops/neighborexchange.h @@ -27,7 +27,7 @@ namespace ops { constexpr auto kNameNeighborExchange = "NeighborExchange"; constexpr auto RecvShapes = "recv_shapes"; constexpr auto RecvType = "recv_type"; -class NeighborExchange : public PrimitiveC { +class MS_CORE_API NeighborExchange : public PrimitiveC { public: NeighborExchange() : PrimitiveC(kNameNeighborExchange) {} ~NeighborExchange() = default; diff --git a/mindspore/core/ops/non_max_suppression.h b/mindspore/core/ops/non_max_suppression.h index fac7d7261d..b8ef1953d5 100644 --- a/mindspore/core/ops/non_max_suppression.h +++ b/mindspore/core/ops/non_max_suppression.h @@ -31,7 +31,7 @@ namespace mindspore { namespace ops { constexpr auto kNameNonMaxSuppression = "NonMaxSuppression"; -class NonMaxSuppression : public PrimitiveC { +class MS_CORE_API NonMaxSuppression : public PrimitiveC { public: NonMaxSuppression() : PrimitiveC(kNameNonMaxSuppression) {} ~NonMaxSuppression() = default; diff --git a/mindspore/core/ops/non_zero.h b/mindspore/core/ops/non_zero.h index 0900d7b652..a0cd982e1e 100644 --- a/mindspore/core/ops/non_zero.h +++ b/mindspore/core/ops/non_zero.h @@ -24,7 +24,7 @@ namespace mindspore { namespace ops { constexpr auto kNameNonZero = "NonZero"; -class NonZero : public PrimitiveC { +class MS_CORE_API NonZero : public PrimitiveC { public: NonZero() : PrimitiveC(kNameNonZero) {} ~NonZero() = default; diff --git a/mindspore/core/ops/not_equal.h b/mindspore/core/ops/not_equal.h index 852dc3ecc3..89c28a51a4 100644 --- a/mindspore/core/ops/not_equal.h +++ b/mindspore/core/ops/not_equal.h @@ -26,7 +26,7 @@ namespace mindspore { namespace ops { constexpr auto kNameNotEqual = prim::kNotEqual; -class NotEqual : public PrimitiveC { +class MS_CORE_API NotEqual : public PrimitiveC { public: NotEqual() : PrimitiveC(prim::kPrimNotEqual->name()) { InitIOName({"x", "y"}, {"output"}); } ~NotEqual() = default; diff --git a/mindspore/core/ops/one_hot.h b/mindspore/core/ops/one_hot.h index b953224bb6..f33b2013d5 100644 --- a/mindspore/core/ops/one_hot.h +++ b/mindspore/core/ops/one_hot.h @@ -25,7 +25,7 @@ namespace mindspore { namespace ops { -class OneHot : public PrimitiveC { +class MS_CORE_API OneHot : public PrimitiveC { public: OneHot() : PrimitiveC(prim::kPrimOneHot->name()) { InitIOName({"indices", "depth", "on_value", "off_value"}, {"output"}); diff --git a/mindspore/core/ops/ones_like.h b/mindspore/core/ops/ones_like.h index cff0b8650a..989f9320f6 100644 --- a/mindspore/core/ops/ones_like.h +++ b/mindspore/core/ops/ones_like.h @@ -24,7 +24,7 @@ namespace mindspore { namespace ops { -class OnesLike : public PrimitiveC { +class MS_CORE_API OnesLike : public PrimitiveC { public: OnesLike() : PrimitiveC(prim::kPrimOnesLike->name()) {} ~OnesLike() = default; diff --git a/mindspore/core/ops/pack.h b/mindspore/core/ops/pack.h index 732311616e..3ce7c8d38a 100644 --- a/mindspore/core/ops/pack.h +++ b/mindspore/core/ops/pack.h @@ -31,7 +31,7 @@ namespace mindspore { namespace ops { constexpr auto kNamePack = "Pack"; -class Pack : public PrimitiveC { +class MS_CORE_API Pack : public PrimitiveC { public: Pack() : PrimitiveC(kNamePack) {} ~Pack() = default; diff --git a/mindspore/core/ops/pad.h b/mindspore/core/ops/pad.h index 5337371fa4..d294bdbd38 100644 --- a/mindspore/core/ops/pad.h +++ b/mindspore/core/ops/pad.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { constexpr auto kNamePad = "Pad"; -class Pad : public PrimitiveC { +class MS_CORE_API Pad : public PrimitiveC { public: Pad() : PrimitiveC(kNamePad) { InitIOName({"x"}, {"y"}); } explicit Pad(const std::string k_name) : PrimitiveC(k_name) { InitIOName({"x"}, {"y"}); } diff --git a/mindspore/core/ops/partial.h b/mindspore/core/ops/partial.h index 66d2da58a6..f0dd2856d2 100644 --- a/mindspore/core/ops/partial.h +++ b/mindspore/core/ops/partial.h @@ -23,7 +23,7 @@ namespace mindspore { namespace ops { constexpr auto kNamePartial = "Partial"; -class Partial : public PrimitiveC { +class MS_CORE_API Partial : public PrimitiveC { public: Partial() : PrimitiveC(kNamePartial) {} ~Partial() = default; diff --git a/mindspore/core/ops/pow.h b/mindspore/core/ops/pow.h index bea006585b..088f43469e 100644 --- a/mindspore/core/ops/pow.h +++ b/mindspore/core/ops/pow.h @@ -28,7 +28,7 @@ namespace mindspore { namespace ops { constexpr auto kNamePow = "Pow"; -class Pow : public PrimitiveC { +class MS_CORE_API Pow : public PrimitiveC { public: explicit Pow(const std::string &k_name = kNamePow) : PrimitiveC(k_name) { InitIOName({"x", "y"}, {"output"}); } ~Pow() = default; diff --git a/mindspore/core/ops/prelu.h b/mindspore/core/ops/prelu.h index deae1b6034..8b467318f8 100644 --- a/mindspore/core/ops/prelu.h +++ b/mindspore/core/ops/prelu.h @@ -26,7 +26,7 @@ namespace mindspore { namespace ops { constexpr auto kNamePReLU = "PReLU"; -class PReLU : public PrimitiveC { +class MS_CORE_API PReLU : public PrimitiveC { public: PReLU() : PrimitiveC(kNamePReLU) { InitIOName({"x"}, {"y"}); } explicit PReLU(const std::string k_name) : PrimitiveC(k_name) { InitIOName({"x"}, {"y"}); } diff --git a/mindspore/core/ops/primitive_c.h b/mindspore/core/ops/primitive_c.h index ad7ec8c1a6..0334aa25fc 100644 --- a/mindspore/core/ops/primitive_c.h +++ b/mindspore/core/ops/primitive_c.h @@ -25,7 +25,7 @@ #include "ir/value.h" namespace mindspore { namespace ops { -class PrimitiveC : public Primitive { +class MS_CORE_API PrimitiveC : public Primitive { public: explicit PrimitiveC(const std::string &name) : Primitive(name) {} MS_DECLARE_PARENT(PrimitiveC, Primitive); @@ -37,7 +37,7 @@ class PrimitiveC : public Primitive { }; using OpPrimCDefineFunc = std::function()>; -class OpPrimCRegister { +class MS_CORE_API OpPrimCRegister { public: ~OpPrimCRegister() {} static OpPrimCRegister &GetInstance(); @@ -49,7 +49,7 @@ class OpPrimCRegister { std::map op_primc_fns_; }; -class OpPrimCRegisterHelper { +class MS_CORE_API OpPrimCRegisterHelper { public: OpPrimCRegisterHelper(const std::string &kname, const OpPrimCDefineFunc &fn) { OpPrimCRegister::GetInstance().SetPrimCMap(kname, fn); diff --git a/mindspore/core/ops/prior_box.h b/mindspore/core/ops/prior_box.h index a40b267118..09971d3d65 100644 --- a/mindspore/core/ops/prior_box.h +++ b/mindspore/core/ops/prior_box.h @@ -26,7 +26,7 @@ namespace mindspore { namespace ops { constexpr auto kNamePriorBox = "PriorBox"; -class PriorBox : public PrimitiveC { +class MS_CORE_API PriorBox : public PrimitiveC { public: PriorBox() : PrimitiveC(kNamePriorBox) {} ~PriorBox() = default; diff --git a/mindspore/core/ops/proposal.h b/mindspore/core/ops/proposal.h index 462bd2fb67..e5ae7c2228 100644 --- a/mindspore/core/ops/proposal.h +++ b/mindspore/core/ops/proposal.h @@ -25,7 +25,7 @@ namespace mindspore { namespace ops { constexpr auto kNameProposal = "Proposal"; -class Proposal : public PrimitiveC { +class MS_CORE_API Proposal : public PrimitiveC { public: Proposal() : PrimitiveC(kNameProposal) {} ~Proposal() = default; diff --git a/mindspore/core/ops/quant_dtype_cast.h b/mindspore/core/ops/quant_dtype_cast.h index 3b1631b27a..b3afc7039c 100644 --- a/mindspore/core/ops/quant_dtype_cast.h +++ b/mindspore/core/ops/quant_dtype_cast.h @@ -31,7 +31,7 @@ namespace mindspore { namespace ops { constexpr auto kNameQuantDTypeCast = "QuantDTypeCast"; -class QuantDTypeCast : public PrimitiveC { +class MS_CORE_API QuantDTypeCast : public PrimitiveC { public: QuantDTypeCast() : PrimitiveC(kNameQuantDTypeCast) {} ~QuantDTypeCast() = default; diff --git a/mindspore/core/ops/ragged_range.h b/mindspore/core/ops/ragged_range.h index cfafa9ece8..896d097a21 100644 --- a/mindspore/core/ops/ragged_range.h +++ b/mindspore/core/ops/ragged_range.h @@ -26,7 +26,7 @@ namespace mindspore { namespace ops { constexpr auto kNameRaggedRange = "RaggedRange"; -class RaggedRange : public PrimitiveC { +class MS_CORE_API RaggedRange : public PrimitiveC { public: RaggedRange() : PrimitiveC(kNameRaggedRange) {} ~RaggedRange() = default; diff --git a/mindspore/core/ops/random_standard_normal.h b/mindspore/core/ops/random_standard_normal.h index 16e29a69e3..0880fa3b84 100644 --- a/mindspore/core/ops/random_standard_normal.h +++ b/mindspore/core/ops/random_standard_normal.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { constexpr auto kNameRandomStandardNormal = "RandomStandardNormal"; -class RandomStandardNormal : public PrimitiveC { +class MS_CORE_API RandomStandardNormal : public PrimitiveC { public: RandomStandardNormal() : PrimitiveC(kNameRandomStandardNormal) {} ~RandomStandardNormal() = default; diff --git a/mindspore/core/ops/range.h b/mindspore/core/ops/range.h index aba04823a4..92c8701df8 100644 --- a/mindspore/core/ops/range.h +++ b/mindspore/core/ops/range.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { constexpr auto kNameRange = "Range"; -class Range : public PrimitiveC { +class MS_CORE_API Range : public PrimitiveC { public: Range() : PrimitiveC(kNameRange) {} ~Range() = default; diff --git a/mindspore/core/ops/rank.h b/mindspore/core/ops/rank.h index 506e6d0172..724860210c 100644 --- a/mindspore/core/ops/rank.h +++ b/mindspore/core/ops/rank.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { constexpr auto kNameRank = "Rank"; -class Rank : public PrimitiveC { +class MS_CORE_API Rank : public PrimitiveC { public: Rank() : PrimitiveC(kNameRank) { auto prim_name = name(); } ~Rank() = default; diff --git a/mindspore/core/ops/real_div.h b/mindspore/core/ops/real_div.h index dabd2c170a..b0fa183b95 100644 --- a/mindspore/core/ops/real_div.h +++ b/mindspore/core/ops/real_div.h @@ -26,7 +26,7 @@ namespace mindspore { namespace ops { constexpr auto kNameRealDiv = prim::kRealDiv; -class RealDiv : public PrimitiveC { +class MS_CORE_API RealDiv : public PrimitiveC { public: RealDiv() : PrimitiveC(kNameRealDiv) { InitIOName({"x", "y"}, {"output"}); } ~RealDiv() = default; diff --git a/mindspore/core/ops/reciprocal.h b/mindspore/core/ops/reciprocal.h index 85cd39fd57..b11cdd6e30 100644 --- a/mindspore/core/ops/reciprocal.h +++ b/mindspore/core/ops/reciprocal.h @@ -25,7 +25,7 @@ namespace mindspore { namespace ops { constexpr auto kNameReciprocal = prim::kReciprocal; -class Reciprocal : public PrimitiveC { +class MS_CORE_API Reciprocal : public PrimitiveC { public: Reciprocal() : PrimitiveC(prim::kPrimReciprocal->name()) { InitIOName({"x"}, {"y"}); } ~Reciprocal() = default; diff --git a/mindspore/core/ops/reduce.h b/mindspore/core/ops/reduce.h index 29a821ff52..e1afe2f880 100644 --- a/mindspore/core/ops/reduce.h +++ b/mindspore/core/ops/reduce.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { constexpr auto kNameReduce = "Reduce"; -class Reduce : public PrimitiveC { +class MS_CORE_API Reduce : public PrimitiveC { public: Reduce() : PrimitiveC(kNameReduce) { InitIOName({"input_x", "axis"}, {"y"}); } explicit Reduce(const std::string k_name) : PrimitiveC(k_name) { InitIOName({"input_x", "axis"}, {"y"}); } diff --git a/mindspore/core/ops/reduce_all.h b/mindspore/core/ops/reduce_all.h index 83de77ad6c..fbccc63080 100644 --- a/mindspore/core/ops/reduce_all.h +++ b/mindspore/core/ops/reduce_all.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { constexpr auto kNameReduceAll = "ReduceAll"; -class ReduceAll : public Reduce { +class MS_CORE_API ReduceAll : public Reduce { public: ReduceAll() : Reduce(kNameReduceAll) { InitIOName({"input_x", "axis"}, {"y"}); } ~ReduceAll() = default; diff --git a/mindspore/core/ops/reduce_any.h b/mindspore/core/ops/reduce_any.h index 3957ee1099..2c0875342d 100644 --- a/mindspore/core/ops/reduce_any.h +++ b/mindspore/core/ops/reduce_any.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { constexpr auto kNameReduceAny = "ReduceAny"; -class ReduceAny : public Reduce { +class MS_CORE_API ReduceAny : public Reduce { public: ReduceAny() : Reduce(kNameReduceAny) { InitIOName({"input_x", "axis"}, {"y"}); } ~ReduceAny() = default; diff --git a/mindspore/core/ops/reduce_asum.h b/mindspore/core/ops/reduce_asum.h index 9e6e36889c..c15fed454a 100644 --- a/mindspore/core/ops/reduce_asum.h +++ b/mindspore/core/ops/reduce_asum.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { constexpr auto kNameReduceASum = "ReduceASum"; -class ReduceASum : public Reduce { +class MS_CORE_API ReduceASum : public Reduce { public: ReduceASum() : Reduce(kNameReduceASum) { InitIOName({"input_x", "axis"}, {"y"}); } ~ReduceASum() = default; diff --git a/mindspore/core/ops/reduce_max.h b/mindspore/core/ops/reduce_max.h index a7cbed8517..a2728a5482 100644 --- a/mindspore/core/ops/reduce_max.h +++ b/mindspore/core/ops/reduce_max.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { constexpr auto kNameReduceMax = "ReduceMax"; -class ReduceMax : public Reduce { +class MS_CORE_API ReduceMax : public Reduce { public: ReduceMax() : Reduce(kNameReduceMax) { InitIOName({"input_x", "axis"}, {"y"}); } ~ReduceMax() = default; diff --git a/mindspore/core/ops/reduce_mean.h b/mindspore/core/ops/reduce_mean.h index 3bf643d862..9d1d1c410c 100644 --- a/mindspore/core/ops/reduce_mean.h +++ b/mindspore/core/ops/reduce_mean.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { constexpr auto kNameReduceMean = "ReduceMean"; -class ReduceMean : public Reduce { +class MS_CORE_API ReduceMean : public Reduce { public: ReduceMean() : Reduce(kNameReduceMean) { InitIOName({"input_x", "axis"}, {"y"}); } ~ReduceMean() = default; diff --git a/mindspore/core/ops/reduce_min.h b/mindspore/core/ops/reduce_min.h index 15972cafce..e0697b55a0 100644 --- a/mindspore/core/ops/reduce_min.h +++ b/mindspore/core/ops/reduce_min.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { constexpr auto kNameReduceMin = "ReduceMin"; -class ReduceMin : public Reduce { +class MS_CORE_API ReduceMin : public Reduce { public: ReduceMin() : Reduce(kNameReduceMin) { InitIOName({"input_x", "axis"}, {"y"}); } ~ReduceMin() = default; diff --git a/mindspore/core/ops/reduce_prod.h b/mindspore/core/ops/reduce_prod.h index f6c7f6506d..35155c182f 100644 --- a/mindspore/core/ops/reduce_prod.h +++ b/mindspore/core/ops/reduce_prod.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { constexpr auto kNameReduceProd = "ReduceProd"; -class ReduceProd : public Reduce { +class MS_CORE_API ReduceProd : public Reduce { public: ReduceProd() : Reduce(kNameReduceProd) { InitIOName({"input_x", "axis"}, {"y"}); } ~ReduceProd() = default; diff --git a/mindspore/core/ops/reduce_sum.h b/mindspore/core/ops/reduce_sum.h index 3c67e181b7..b94c55e0a0 100644 --- a/mindspore/core/ops/reduce_sum.h +++ b/mindspore/core/ops/reduce_sum.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { constexpr auto kNameReduceSum = "ReduceSum"; -class ReduceSum : public Reduce { +class MS_CORE_API ReduceSum : public Reduce { public: ReduceSum() : Reduce(kNameReduceSum) { InitIOName({"x", "axis"}, {"y"}); } ~ReduceSum() = default; diff --git a/mindspore/core/ops/reduce_sum_square.h b/mindspore/core/ops/reduce_sum_square.h index b5c4620fb6..a7f70a3b15 100644 --- a/mindspore/core/ops/reduce_sum_square.h +++ b/mindspore/core/ops/reduce_sum_square.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { constexpr auto kNameReduceSumSquare = "ReduceSumSquare"; -class ReduceSumSquare : public Reduce { +class MS_CORE_API ReduceSumSquare : public Reduce { public: ReduceSumSquare() : Reduce(kNameReduceSumSquare) { InitIOName({"input_x", "axis"}, {"y"}); } ~ReduceSumSquare() = default; diff --git a/mindspore/core/ops/relu.h b/mindspore/core/ops/relu.h index 3c21bb610f..cb41730316 100644 --- a/mindspore/core/ops/relu.h +++ b/mindspore/core/ops/relu.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { constexpr auto kNameReLU = prim::kReLU; -class ReLU : public PrimitiveC { +class MS_CORE_API ReLU : public PrimitiveC { public: ReLU() : PrimitiveC(kNameReLU) { InitIOName({"x"}, {"output"}); } ~ReLU() = default; diff --git a/mindspore/core/ops/relu6.h b/mindspore/core/ops/relu6.h index de76b6f686..f2cb544d0e 100644 --- a/mindspore/core/ops/relu6.h +++ b/mindspore/core/ops/relu6.h @@ -26,7 +26,7 @@ namespace mindspore { namespace ops { constexpr auto kNameReLU6 = prim::kReLU6; -class ReLU6 : public PrimitiveC { +class MS_CORE_API ReLU6 : public PrimitiveC { public: ReLU6() : PrimitiveC(kNameReLU6) { InitIOName({"x"}, {"output"}); } ~ReLU6() = default; diff --git a/mindspore/core/ops/reluv2.h b/mindspore/core/ops/reluv2.h index 399ff62cbe..af48acb980 100644 --- a/mindspore/core/ops/reluv2.h +++ b/mindspore/core/ops/reluv2.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { constexpr auto kNameReLUV2 = prim::kReLUV2; -class ReLUV2 : public PrimitiveC { +class MS_CORE_API ReLUV2 : public PrimitiveC { public: ReLUV2() : PrimitiveC(prim::kPrimReluV2->name()) { InitIOName({"x"}, {"output", "mask"}); } explicit ReLUV2(const std::string k_name) : PrimitiveC(k_name) { InitIOName({"x"}, {"output", "mask"}); } diff --git a/mindspore/core/ops/reshape.h b/mindspore/core/ops/reshape.h index 38c4b0db5a..bccebbbc63 100644 --- a/mindspore/core/ops/reshape.h +++ b/mindspore/core/ops/reshape.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { constexpr auto kNameReshape = "Reshape"; -class Reshape : public PrimitiveC { +class MS_CORE_API Reshape : public PrimitiveC { public: Reshape() : PrimitiveC(kNameReshape) { InitIOName({"tensor", "shape"}, {"output"}); } ~Reshape() = default; diff --git a/mindspore/core/ops/resize.h b/mindspore/core/ops/resize.h index 940a97501b..c613453d54 100644 --- a/mindspore/core/ops/resize.h +++ b/mindspore/core/ops/resize.h @@ -25,7 +25,7 @@ namespace mindspore { namespace ops { constexpr auto kNameResize = "Resize"; -class Resize : public PrimitiveC { +class MS_CORE_API Resize : public PrimitiveC { public: Resize() : PrimitiveC(kNameResize) {} ~Resize() = default; diff --git a/mindspore/core/ops/resize_bilinear.h b/mindspore/core/ops/resize_bilinear.h index e615509eec..1a4f9c0d9c 100644 --- a/mindspore/core/ops/resize_bilinear.h +++ b/mindspore/core/ops/resize_bilinear.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { constexpr auto kNameResizeBilinear = "ResizeBilinear"; -class ResizeBilinear : public PrimitiveC { +class MS_CORE_API ResizeBilinear : public PrimitiveC { public: ResizeBilinear() : PrimitiveC(kNameResizeBilinear) {} ~ResizeBilinear() = default; diff --git a/mindspore/core/ops/resize_nearest_neighbor.h b/mindspore/core/ops/resize_nearest_neighbor.h index aa4a15affd..7e1c3f97c2 100644 --- a/mindspore/core/ops/resize_nearest_neighbor.h +++ b/mindspore/core/ops/resize_nearest_neighbor.h @@ -26,7 +26,7 @@ namespace mindspore { namespace ops { constexpr auto kNameResizeNearestNeighbor = "ResizeNearestNeighbor"; -class ResizeNearestNeighbor : public PrimitiveC { +class MS_CORE_API ResizeNearestNeighbor : public PrimitiveC { public: ResizeNearestNeighbor() : PrimitiveC(kNameResizeNearestNeighbor) {} ~ResizeNearestNeighbor() = default; diff --git a/mindspore/core/ops/reverse_sequence.h b/mindspore/core/ops/reverse_sequence.h index 6fde1a8614..c0fa39929c 100644 --- a/mindspore/core/ops/reverse_sequence.h +++ b/mindspore/core/ops/reverse_sequence.h @@ -25,7 +25,7 @@ namespace mindspore { namespace ops { constexpr auto kNameReverseSequence = "ReverseSequence"; -class ReverseSequence : public PrimitiveC { +class MS_CORE_API ReverseSequence : public PrimitiveC { public: ReverseSequence() : PrimitiveC(kNameReverseSequence) { InitIOName({"x", "seq_lengths"}, {"y"}); } ~ReverseSequence() = default; diff --git a/mindspore/core/ops/reverse_v2.h b/mindspore/core/ops/reverse_v2.h index 6df7990ddb..914684cd2a 100644 --- a/mindspore/core/ops/reverse_v2.h +++ b/mindspore/core/ops/reverse_v2.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { constexpr auto kNameReverseV2 = "ReverseV2"; -class ReverseV2 : public PrimitiveC { +class MS_CORE_API ReverseV2 : public PrimitiveC { public: ReverseV2() : PrimitiveC(kNameReverseV2) {} ~ReverseV2() = default; diff --git a/mindspore/core/ops/rfft.h b/mindspore/core/ops/rfft.h index 1edf6b4fba..1b042f9c57 100644 --- a/mindspore/core/ops/rfft.h +++ b/mindspore/core/ops/rfft.h @@ -25,7 +25,7 @@ namespace mindspore { namespace ops { constexpr auto kNameRfft = "Rfft"; -class Rfft : public PrimitiveC { +class MS_CORE_API Rfft : public PrimitiveC { public: Rfft() : PrimitiveC(kNameRfft) {} ~Rfft() = default; diff --git a/mindspore/core/ops/roi_pooling.h b/mindspore/core/ops/roi_pooling.h index 3fe61323df..5f255bdf5f 100644 --- a/mindspore/core/ops/roi_pooling.h +++ b/mindspore/core/ops/roi_pooling.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { constexpr auto kNameROIPooling = "ROIPooling"; -class ROIPooling : public PrimitiveC { +class MS_CORE_API ROIPooling : public PrimitiveC { public: ROIPooling() : PrimitiveC(kNameROIPooling) {} ~ROIPooling() = default; diff --git a/mindspore/core/ops/round.h b/mindspore/core/ops/round.h index bec87da073..11956d6fad 100644 --- a/mindspore/core/ops/round.h +++ b/mindspore/core/ops/round.h @@ -26,7 +26,7 @@ namespace mindspore { namespace ops { constexpr auto kNameRound = "Round"; -class Round : public PrimitiveC { +class MS_CORE_API Round : public PrimitiveC { public: Round() : PrimitiveC(kNameRound) { InitIOName({"input_x"}, {"output"}); } ~Round() = default; diff --git a/mindspore/core/ops/rsqrt.h b/mindspore/core/ops/rsqrt.h index 96b7d3c02b..547edb9159 100644 --- a/mindspore/core/ops/rsqrt.h +++ b/mindspore/core/ops/rsqrt.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { constexpr auto kNameRsqrt = "Rsqrt"; -class Rsqrt : public PrimitiveC { +class MS_CORE_API Rsqrt : public PrimitiveC { public: Rsqrt() : PrimitiveC(kNameRsqrt) { InitIOName({"x"}, {"output"}); } ~Rsqrt() = default; diff --git a/mindspore/core/ops/scalar_summary.h b/mindspore/core/ops/scalar_summary.h index c688f3f7b8..32bd58cb02 100644 --- a/mindspore/core/ops/scalar_summary.h +++ b/mindspore/core/ops/scalar_summary.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { -class ScalarSummary : public PrimitiveC { +class MS_CORE_API ScalarSummary : public PrimitiveC { public: ScalarSummary() : PrimitiveC(prim::kPrimScalarSummary->name()) {} ~ScalarSummary() = default; diff --git a/mindspore/core/ops/scale.h b/mindspore/core/ops/scale.h index 3b224f44dd..512c029803 100644 --- a/mindspore/core/ops/scale.h +++ b/mindspore/core/ops/scale.h @@ -28,7 +28,7 @@ namespace mindspore { namespace ops { constexpr auto kNameScale = "Scale"; -class Scale : public PrimitiveC { +class MS_CORE_API Scale : public PrimitiveC { public: Scale() : PrimitiveC(kNameScale) {} explicit Scale(const std::string k_name) : PrimitiveC(k_name) {} diff --git a/mindspore/core/ops/scatter_nd.h b/mindspore/core/ops/scatter_nd.h index dfa678bfd5..7e5be0f725 100644 --- a/mindspore/core/ops/scatter_nd.h +++ b/mindspore/core/ops/scatter_nd.h @@ -26,7 +26,7 @@ namespace mindspore { namespace ops { constexpr auto kNameScatterNd = "ScatterNd"; -class ScatterNd : public PrimitiveC { +class MS_CORE_API ScatterNd : public PrimitiveC { public: ScatterNd() : PrimitiveC(kNameScatterNd) { InitIOName({"indices", "update", "shape"}, {"output"}); } ~ScatterNd() = default; diff --git a/mindspore/core/ops/scatter_nd_update.h b/mindspore/core/ops/scatter_nd_update.h index 5909f0ef48..03b42cc86b 100644 --- a/mindspore/core/ops/scatter_nd_update.h +++ b/mindspore/core/ops/scatter_nd_update.h @@ -26,7 +26,7 @@ namespace mindspore { namespace ops { constexpr auto kNameScatterNdUpdate = "ScatterNdUpdate"; -class ScatterNdUpdate : public PrimitiveC { +class MS_CORE_API ScatterNdUpdate : public PrimitiveC { public: ScatterNdUpdate() : PrimitiveC(kNameScatterNdUpdate) { InitIOName({"input_x", "indices", "update"}, {"output"}); } ~ScatterNdUpdate() = default; diff --git a/mindspore/core/ops/select.h b/mindspore/core/ops/select.h index 79a3b1b38d..44ea781934 100644 --- a/mindspore/core/ops/select.h +++ b/mindspore/core/ops/select.h @@ -31,7 +31,7 @@ namespace mindspore { namespace ops { constexpr auto kNameSelect = "Select"; -class Select : public PrimitiveC { +class MS_CORE_API Select : public PrimitiveC { public: Select() : PrimitiveC(kNameSelect) { InitIOName({"condition", "x", "y"}, {"output"}); } ~Select() = default; diff --git a/mindspore/core/ops/sgd.h b/mindspore/core/ops/sgd.h index 2002523205..69d87a18f5 100644 --- a/mindspore/core/ops/sgd.h +++ b/mindspore/core/ops/sgd.h @@ -25,7 +25,7 @@ namespace mindspore { namespace ops { constexpr auto kNameSGD = "SGD"; -class SGD : public PrimitiveC { +class MS_CORE_API SGD : public PrimitiveC { public: SGD() : PrimitiveC(kNameSGD) {} ~SGD() = default; diff --git a/mindspore/core/ops/shape.h b/mindspore/core/ops/shape.h index d359eebcd4..4962ee7e32 100644 --- a/mindspore/core/ops/shape.h +++ b/mindspore/core/ops/shape.h @@ -26,7 +26,7 @@ namespace mindspore { namespace ops { -class Shape : public PrimitiveC { +class MS_CORE_API Shape : public PrimitiveC { public: Shape() : PrimitiveC(prim::kPrimShape->name()) {} ~Shape() = default; diff --git a/mindspore/core/ops/sigmoid.h b/mindspore/core/ops/sigmoid.h index b67a7dc365..097d056094 100644 --- a/mindspore/core/ops/sigmoid.h +++ b/mindspore/core/ops/sigmoid.h @@ -23,7 +23,7 @@ namespace mindspore { namespace ops { constexpr auto kNameSigmoid = "Sigmoid"; -class Sigmoid : public PrimitiveC { +class MS_CORE_API Sigmoid : public PrimitiveC { public: Sigmoid() : PrimitiveC(kNameSigmoid) { InitIOName({"x"}, {"output"}); } ~Sigmoid() = default; diff --git a/mindspore/core/ops/sigmoid_cross_entropy_with_logits.h b/mindspore/core/ops/sigmoid_cross_entropy_with_logits.h index d34987cbe9..4ad8e17a3e 100644 --- a/mindspore/core/ops/sigmoid_cross_entropy_with_logits.h +++ b/mindspore/core/ops/sigmoid_cross_entropy_with_logits.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { constexpr auto kNameSigmoidCrossEntropyWithLogits = "SigmoidCrossEntropyWithLogits"; -class SigmoidCrossEntropyWithLogits : public PrimitiveC { +class MS_CORE_API SigmoidCrossEntropyWithLogits : public PrimitiveC { public: SigmoidCrossEntropyWithLogits() : PrimitiveC(kNameSigmoidCrossEntropyWithLogits) { InitIOName({"predict", "target"}, {"loss"}); diff --git a/mindspore/core/ops/sin.h b/mindspore/core/ops/sin.h index a6e050ae5f..6db737b178 100644 --- a/mindspore/core/ops/sin.h +++ b/mindspore/core/ops/sin.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { constexpr auto kNameSin = "Sin"; -class Sin : public PrimitiveC { +class MS_CORE_API Sin : public PrimitiveC { public: Sin() : PrimitiveC(kNameSin) {} ~Sin() = default; diff --git a/mindspore/core/ops/size.h b/mindspore/core/ops/size.h index b5396bab95..354dfa4498 100644 --- a/mindspore/core/ops/size.h +++ b/mindspore/core/ops/size.h @@ -25,7 +25,7 @@ namespace mindspore { namespace ops { constexpr auto kNameSize = "Size"; -class Size : public PrimitiveC { +class MS_CORE_API Size : public PrimitiveC { public: Size() : PrimitiveC(kNameSize) {} ~Size() = default; diff --git a/mindspore/core/ops/skip_gram.h b/mindspore/core/ops/skip_gram.h index 8fdbb64514..2d1e09b9ac 100644 --- a/mindspore/core/ops/skip_gram.h +++ b/mindspore/core/ops/skip_gram.h @@ -31,7 +31,7 @@ namespace mindspore { namespace ops { constexpr auto kNameSkipGram = "SkipGram"; -class SkipGram : public PrimitiveC { +class MS_CORE_API SkipGram : public PrimitiveC { public: SkipGram() : PrimitiveC(kNameSkipGram) {} ~SkipGram() = default; diff --git a/mindspore/core/ops/slice.h b/mindspore/core/ops/slice.h index da040f4c4e..446fd6124e 100644 --- a/mindspore/core/ops/slice.h +++ b/mindspore/core/ops/slice.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { constexpr auto kNameSlice = "Slice"; -class Slice : public PrimitiveC { +class MS_CORE_API Slice : public PrimitiveC { public: Slice() : PrimitiveC(kNameSlice) { InitIOName({"x", "begin", "size"}, {"output"}); } ~Slice() = default; diff --git a/mindspore/core/ops/smooth_l1_loss.h b/mindspore/core/ops/smooth_l1_loss.h index 972a27aae1..8e5f951705 100644 --- a/mindspore/core/ops/smooth_l1_loss.h +++ b/mindspore/core/ops/smooth_l1_loss.h @@ -25,7 +25,7 @@ namespace mindspore { namespace ops { constexpr auto kNameSmoothL1Loss = "SmoothL1Loss"; -class SmoothL1Loss : public PrimitiveC { +class MS_CORE_API SmoothL1Loss : public PrimitiveC { public: SmoothL1Loss() : PrimitiveC(kNameSmoothL1Loss) { InitIOName({"prediction", "target"}, {"output"}); } ~SmoothL1Loss() = default; diff --git a/mindspore/core/ops/soft_margin_loss.h b/mindspore/core/ops/soft_margin_loss.h index e670d99dc5..53f63fa38b 100644 --- a/mindspore/core/ops/soft_margin_loss.h +++ b/mindspore/core/ops/soft_margin_loss.h @@ -28,7 +28,7 @@ namespace mindspore { namespace ops { constexpr auto kNameSoftMarginLoss = "SoftMarginLoss"; -class SoftMarginLoss : public PrimitiveC { +class MS_CORE_API SoftMarginLoss : public PrimitiveC { public: SoftMarginLoss() : PrimitiveC(kNameSoftMarginLoss) { InitIOName({"predict", "label"}, {"loss"}); } ~SoftMarginLoss() = default; diff --git a/mindspore/core/ops/soft_shrink.h b/mindspore/core/ops/soft_shrink.h index ce9531d632..c93f5e7c81 100644 --- a/mindspore/core/ops/soft_shrink.h +++ b/mindspore/core/ops/soft_shrink.h @@ -26,7 +26,7 @@ namespace mindspore { namespace ops { constexpr auto kNameSoftShrink = "SoftShrink"; -class SoftShrink : public PrimitiveC { +class MS_CORE_API SoftShrink : public PrimitiveC { public: SoftShrink() : PrimitiveC(kNameSoftShrink) { InitIOName({"input_x"}, {"output"}); } ~SoftShrink() = default; diff --git a/mindspore/core/ops/softmax.h b/mindspore/core/ops/softmax.h index 464ed7c572..bd1995f9f6 100644 --- a/mindspore/core/ops/softmax.h +++ b/mindspore/core/ops/softmax.h @@ -28,7 +28,7 @@ namespace mindspore { namespace ops { constexpr auto kNameSoftmax = "Softmax"; -class Softmax : public PrimitiveC { +class MS_CORE_API Softmax : public PrimitiveC { public: Softmax() : PrimitiveC(kNameSoftmax) { InitIOName({"x"}, {"output"}); } ~Softmax() = default; diff --git a/mindspore/core/ops/softmax_cross_entropy_with_logits.h b/mindspore/core/ops/softmax_cross_entropy_with_logits.h index 61d10de048..feb5e953fc 100644 --- a/mindspore/core/ops/softmax_cross_entropy_with_logits.h +++ b/mindspore/core/ops/softmax_cross_entropy_with_logits.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { constexpr auto kNameSoftmaxCrossEntropyWithLogits = "SoftmaxCrossEntropyWithLogits"; -class SoftmaxCrossEntropyWithLogits : public PrimitiveC { +class MS_CORE_API SoftmaxCrossEntropyWithLogits : public PrimitiveC { public: SoftmaxCrossEntropyWithLogits() : PrimitiveC(kNameSoftmaxCrossEntropyWithLogits) {} ~SoftmaxCrossEntropyWithLogits() = default; diff --git a/mindspore/core/ops/softplus.h b/mindspore/core/ops/softplus.h index 42bc40518b..4906c7d87e 100644 --- a/mindspore/core/ops/softplus.h +++ b/mindspore/core/ops/softplus.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { -class Softplus : public PrimitiveC { +class MS_CORE_API Softplus : public PrimitiveC { public: Softplus() : PrimitiveC(prim::kPrimSoftplus->name()) { InitIOName({"x"}, {"output"}); } ~Softplus() = default; diff --git a/mindspore/core/ops/space_to_batch.h b/mindspore/core/ops/space_to_batch.h index 0e2197af52..e9afa33c77 100644 --- a/mindspore/core/ops/space_to_batch.h +++ b/mindspore/core/ops/space_to_batch.h @@ -28,7 +28,7 @@ namespace mindspore { namespace ops { constexpr auto kNameSpaceToBatch = "SpaceToBatch"; -class SpaceToBatch : public PrimitiveC { +class MS_CORE_API SpaceToBatch : public PrimitiveC { public: SpaceToBatch() : PrimitiveC(kNameSpaceToBatch) {} ~SpaceToBatch() = default; diff --git a/mindspore/core/ops/space_to_batch_nd.h b/mindspore/core/ops/space_to_batch_nd.h index dafd345d26..8820fb16af 100644 --- a/mindspore/core/ops/space_to_batch_nd.h +++ b/mindspore/core/ops/space_to_batch_nd.h @@ -28,7 +28,7 @@ namespace mindspore { namespace ops { constexpr auto kNameSpaceToBatchND = "SpaceToBatchND"; -class SpaceToBatchND : public PrimitiveC { +class MS_CORE_API SpaceToBatchND : public PrimitiveC { public: SpaceToBatchND() : PrimitiveC(kNameSpaceToBatchND) {} ~SpaceToBatchND() = default; diff --git a/mindspore/core/ops/space_to_depth.h b/mindspore/core/ops/space_to_depth.h index edc50abfbe..c307f225a1 100644 --- a/mindspore/core/ops/space_to_depth.h +++ b/mindspore/core/ops/space_to_depth.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { constexpr auto kNameSpaceToDepth = "SpaceToDepth"; -class SpaceToDepth : public PrimitiveC { +class MS_CORE_API SpaceToDepth : public PrimitiveC { public: SpaceToDepth() : PrimitiveC(kNameSpaceToDepth) { InitIOName({"x"}, {"y"}); } ~SpaceToDepth() = default; diff --git a/mindspore/core/ops/sparse_softmax_cross_entropy_with_logits.h b/mindspore/core/ops/sparse_softmax_cross_entropy_with_logits.h index 56528354e0..569f0bf57d 100644 --- a/mindspore/core/ops/sparse_softmax_cross_entropy_with_logits.h +++ b/mindspore/core/ops/sparse_softmax_cross_entropy_with_logits.h @@ -25,7 +25,7 @@ namespace mindspore { namespace ops { constexpr auto kNameSparseSoftmaxCrossEntropyWithLogits = "SparseSoftmaxCrossEntropyWithLogits"; -class SparseSoftmaxCrossEntropyWithLogits : public PrimitiveC { +class MS_CORE_API SparseSoftmaxCrossEntropyWithLogits : public PrimitiveC { public: SparseSoftmaxCrossEntropyWithLogits() : PrimitiveC(kNameSparseSoftmaxCrossEntropyWithLogits) {} ~SparseSoftmaxCrossEntropyWithLogits() = default; diff --git a/mindspore/core/ops/sparse_to_dense.h b/mindspore/core/ops/sparse_to_dense.h index 27820a60ef..28ba3d489f 100644 --- a/mindspore/core/ops/sparse_to_dense.h +++ b/mindspore/core/ops/sparse_to_dense.h @@ -25,7 +25,7 @@ namespace mindspore { namespace ops { constexpr auto kNameSparseToDense = "SparseToDense"; -class SparseToDense : public PrimitiveC { +class MS_CORE_API SparseToDense : public PrimitiveC { public: SparseToDense() : PrimitiveC(kNameSparseToDense) { InitIOName({"indices", "values", "dense_shape"}, {"output"}); } ~SparseToDense() = default; diff --git a/mindspore/core/ops/splice.h b/mindspore/core/ops/splice.h index b9f1f69305..137ee0b8de 100644 --- a/mindspore/core/ops/splice.h +++ b/mindspore/core/ops/splice.h @@ -25,7 +25,7 @@ namespace mindspore { namespace ops { constexpr auto kNameSplice = "Splice"; -class Splice : public PrimitiveC { +class MS_CORE_API Splice : public PrimitiveC { public: Splice() : PrimitiveC(kNameSplice) { InitIOName({"inputs"}, {"outputs"}); } ~Splice() = default; diff --git a/mindspore/core/ops/split.h b/mindspore/core/ops/split.h index 2a745180d8..7844eb195c 100644 --- a/mindspore/core/ops/split.h +++ b/mindspore/core/ops/split.h @@ -26,7 +26,7 @@ namespace mindspore { namespace ops { constexpr auto kNameSplit = "Split"; -class Split : public PrimitiveC { +class MS_CORE_API Split : public PrimitiveC { public: Split() : PrimitiveC(kNameSplit) {} ~Split() = default; diff --git a/mindspore/core/ops/split_with_overlap.h b/mindspore/core/ops/split_with_overlap.h index 37853ae92b..8a76f525e6 100644 --- a/mindspore/core/ops/split_with_overlap.h +++ b/mindspore/core/ops/split_with_overlap.h @@ -23,7 +23,7 @@ namespace mindspore { namespace ops { constexpr auto kNameSplitWithOverlap = "SplitWithOverlap"; -class SplitWithOverlap : public PrimitiveC { +class MS_CORE_API SplitWithOverlap : public PrimitiveC { public: SplitWithOverlap() : PrimitiveC(kNameSplitWithOverlap) {} ~SplitWithOverlap() = default; diff --git a/mindspore/core/ops/sqrt.h b/mindspore/core/ops/sqrt.h index 5de8234550..a679108a49 100644 --- a/mindspore/core/ops/sqrt.h +++ b/mindspore/core/ops/sqrt.h @@ -23,7 +23,7 @@ namespace mindspore { namespace ops { constexpr auto kNameSqrt = "Sqrt"; -class Sqrt : public PrimitiveC { +class MS_CORE_API Sqrt : public PrimitiveC { public: Sqrt() : PrimitiveC(kNameSqrt) { InitIOName({"x"}, {"output"}); } ~Sqrt() = default; diff --git a/mindspore/core/ops/square.h b/mindspore/core/ops/square.h index 4c39c1dccc..cc1cc393a4 100644 --- a/mindspore/core/ops/square.h +++ b/mindspore/core/ops/square.h @@ -23,7 +23,7 @@ namespace mindspore { namespace ops { constexpr auto kNameSquare = "Square"; -class Square : public PrimitiveC { +class MS_CORE_API Square : public PrimitiveC { public: Square() : PrimitiveC(kNameSquare) { InitIOName({"input_x"}, {"y"}); } ~Square() = default; diff --git a/mindspore/core/ops/squared_difference.h b/mindspore/core/ops/squared_difference.h index c5362e0969..56541954f2 100644 --- a/mindspore/core/ops/squared_difference.h +++ b/mindspore/core/ops/squared_difference.h @@ -25,7 +25,7 @@ namespace mindspore { namespace ops { constexpr auto kNameSquaredDifference = "SquaredDifference"; -class SquaredDifference : public PrimitiveC { +class MS_CORE_API SquaredDifference : public PrimitiveC { public: SquaredDifference() : PrimitiveC(kNameSquaredDifference) { InitIOName({"x", "y"}, {"output"}); } ~SquaredDifference() = default; diff --git a/mindspore/core/ops/squeeze.h b/mindspore/core/ops/squeeze.h index 6a467a7c1d..c78c8448f6 100644 --- a/mindspore/core/ops/squeeze.h +++ b/mindspore/core/ops/squeeze.h @@ -31,7 +31,7 @@ namespace mindspore { namespace ops { constexpr auto kNameSqueeze = "Squeeze"; -class Squeeze : public PrimitiveC { +class MS_CORE_API Squeeze : public PrimitiveC { public: Squeeze() : PrimitiveC(kNameSqueeze) { InitIOName({"x"}, {"output"}); } ~Squeeze() = default; diff --git a/mindspore/core/ops/stack.h b/mindspore/core/ops/stack.h index 09a1b21e47..81328e3ce7 100644 --- a/mindspore/core/ops/stack.h +++ b/mindspore/core/ops/stack.h @@ -31,7 +31,7 @@ namespace mindspore { namespace ops { constexpr auto kNameStack = "Stack"; -class Stack : public PrimitiveC { +class MS_CORE_API Stack : public PrimitiveC { public: Stack() : PrimitiveC(kNameStack) {} ~Stack() = default; diff --git a/mindspore/core/ops/strided_slice.h b/mindspore/core/ops/strided_slice.h index dcbb0ba66a..a05f8e7c30 100644 --- a/mindspore/core/ops/strided_slice.h +++ b/mindspore/core/ops/strided_slice.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { constexpr auto kNameStridedSlice = prim::kStridedSlice; -class StridedSlice : public PrimitiveC { +class MS_CORE_API StridedSlice : public PrimitiveC { public: StridedSlice() : PrimitiveC(prim::kPrimStridedSlice->name()) { InitIOName({"x", "begin", "end", "strides"}, {"output"}); diff --git a/mindspore/core/ops/sub.h b/mindspore/core/ops/sub.h index 89c9653837..50a847a505 100644 --- a/mindspore/core/ops/sub.h +++ b/mindspore/core/ops/sub.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { constexpr auto kNameSub = prim::kSub; -class Sub : public PrimitiveC { +class MS_CORE_API Sub : public PrimitiveC { public: Sub() : PrimitiveC(kNameSub) { InitIOName({"x", "y"}, {"output"}); } explicit Sub(const std::string k_name) : PrimitiveC(k_name) { InitIOName({"x", "y"}, {"output"}); } diff --git a/mindspore/core/ops/switch.h b/mindspore/core/ops/switch.h index 5782b30f9d..ecd82b03b8 100644 --- a/mindspore/core/ops/switch.h +++ b/mindspore/core/ops/switch.h @@ -23,7 +23,7 @@ namespace mindspore { namespace ops { constexpr auto kNameSwitch = "Switch"; -class Switch : public PrimitiveC { +class MS_CORE_API Switch : public PrimitiveC { public: Switch() : PrimitiveC(kNameSwitch) {} ~Switch() = default; diff --git a/mindspore/core/ops/tan.h b/mindspore/core/ops/tan.h index 85d914867e..e70c320387 100644 --- a/mindspore/core/ops/tan.h +++ b/mindspore/core/ops/tan.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { constexpr auto kNameTan = "Tan"; -class Tan : public PrimitiveC { +class MS_CORE_API Tan : public PrimitiveC { public: Tan() : PrimitiveC(kNameTan) {} ~Tan() = default; diff --git a/mindspore/core/ops/tanh.h b/mindspore/core/ops/tanh.h index e4a15a1dad..f329dc82b3 100644 --- a/mindspore/core/ops/tanh.h +++ b/mindspore/core/ops/tanh.h @@ -23,7 +23,7 @@ namespace mindspore { namespace ops { constexpr auto kNameTanh = "Tanh"; -class Tanh : public PrimitiveC { +class MS_CORE_API Tanh : public PrimitiveC { public: Tanh() : PrimitiveC(kNameTanh) {} ~Tanh() = default; diff --git a/mindspore/core/ops/tensor_array.h b/mindspore/core/ops/tensor_array.h index f633c3249e..8dfc5dc372 100644 --- a/mindspore/core/ops/tensor_array.h +++ b/mindspore/core/ops/tensor_array.h @@ -25,7 +25,7 @@ namespace ops { constexpr auto kNameTensorArray = "TensorArray"; -class TensorArray : public PrimitiveC { +class MS_CORE_API TensorArray : public PrimitiveC { public: TensorArray() : PrimitiveC(kNameTensorArray) { InitIOName({"size"}, {"handle", "flow"}); } ~TensorArray() = default; diff --git a/mindspore/core/ops/tensor_array_read.h b/mindspore/core/ops/tensor_array_read.h index 18d4af00d5..ec28194d81 100644 --- a/mindspore/core/ops/tensor_array_read.h +++ b/mindspore/core/ops/tensor_array_read.h @@ -25,7 +25,7 @@ namespace ops { constexpr auto kNameTensorArrayRead = "TensorArrayRead"; -class TensorArrayRead : public PrimitiveC { +class MS_CORE_API TensorArrayRead : public PrimitiveC { public: TensorArrayRead() : PrimitiveC(kNameTensorArrayRead) { InitIOName({"handle", "index", "flow_in"}, {"tensor"}); } ~TensorArrayRead() = default; diff --git a/mindspore/core/ops/tensor_array_write.h b/mindspore/core/ops/tensor_array_write.h index efee0ae62b..8035cc2809 100644 --- a/mindspore/core/ops/tensor_array_write.h +++ b/mindspore/core/ops/tensor_array_write.h @@ -25,7 +25,7 @@ namespace ops { constexpr auto kNameTensorArrayWrite = "TensorArrayWrite"; -class TensorArrayWrite : public PrimitiveC { +class MS_CORE_API TensorArrayWrite : public PrimitiveC { public: TensorArrayWrite() : PrimitiveC(kNameTensorArrayWrite) { InitIOName({"handle", "index", "value", "flow_in"}, {"flow_out"}); diff --git a/mindspore/core/ops/tensor_list_from_tensor.h b/mindspore/core/ops/tensor_list_from_tensor.h index 62ba4a63a1..905370e835 100644 --- a/mindspore/core/ops/tensor_list_from_tensor.h +++ b/mindspore/core/ops/tensor_list_from_tensor.h @@ -25,7 +25,7 @@ namespace mindspore { namespace ops { constexpr auto kNameTensorListFromTensor = "TensorListFromTensor"; -class TensorListFromTensor : public PrimitiveC { +class MS_CORE_API TensorListFromTensor : public PrimitiveC { public: TensorListFromTensor() : PrimitiveC(kNameTensorListFromTensor) {} ~TensorListFromTensor() = default; diff --git a/mindspore/core/ops/tensor_list_get_item.h b/mindspore/core/ops/tensor_list_get_item.h index a86cf0b345..b65acdb07e 100644 --- a/mindspore/core/ops/tensor_list_get_item.h +++ b/mindspore/core/ops/tensor_list_get_item.h @@ -24,7 +24,7 @@ namespace mindspore { namespace ops { constexpr auto kNameTensorListGetItem = "TensorListGetItem"; -class TensorListGetItem : public PrimitiveC { +class MS_CORE_API TensorListGetItem : public PrimitiveC { public: TensorListGetItem() : PrimitiveC(kNameTensorListGetItem) {} ~TensorListGetItem() = default; diff --git a/mindspore/core/ops/tensor_list_reserve.h b/mindspore/core/ops/tensor_list_reserve.h index adcf1ebe46..9f0f680e77 100644 --- a/mindspore/core/ops/tensor_list_reserve.h +++ b/mindspore/core/ops/tensor_list_reserve.h @@ -24,7 +24,7 @@ namespace mindspore { namespace ops { constexpr auto kNameTensorListReserve = "TensorListReserve"; -class TensorListReserve : public PrimitiveC { +class MS_CORE_API TensorListReserve : public PrimitiveC { public: TensorListReserve() : PrimitiveC(kNameTensorListReserve) {} ~TensorListReserve() = default; diff --git a/mindspore/core/ops/tensor_list_set_item.h b/mindspore/core/ops/tensor_list_set_item.h index 045824449e..7b265e33df 100644 --- a/mindspore/core/ops/tensor_list_set_item.h +++ b/mindspore/core/ops/tensor_list_set_item.h @@ -24,7 +24,7 @@ namespace mindspore { namespace ops { constexpr auto kNameTensorListSetItem = "TensorListSetItem"; -class TensorListSetItem : public PrimitiveC { +class MS_CORE_API TensorListSetItem : public PrimitiveC { public: TensorListSetItem() : PrimitiveC(kNameTensorListSetItem) {} ~TensorListSetItem() = default; diff --git a/mindspore/core/ops/tensor_list_stack.h b/mindspore/core/ops/tensor_list_stack.h index ad51e3ec79..67837002b6 100644 --- a/mindspore/core/ops/tensor_list_stack.h +++ b/mindspore/core/ops/tensor_list_stack.h @@ -25,7 +25,7 @@ namespace mindspore { namespace ops { constexpr auto kNameTensorListStack = "TensorListStack"; -class TensorListStack : public PrimitiveC { +class MS_CORE_API TensorListStack : public PrimitiveC { public: TensorListStack() : PrimitiveC(kNameTensorListStack) {} ~TensorListStack() = default; diff --git a/mindspore/core/ops/tensor_summary.h b/mindspore/core/ops/tensor_summary.h index 317e22f668..666c7a31de 100644 --- a/mindspore/core/ops/tensor_summary.h +++ b/mindspore/core/ops/tensor_summary.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { -class TensorSummary : public PrimitiveC { +class MS_CORE_API TensorSummary : public PrimitiveC { public: TensorSummary() : PrimitiveC(prim::kPrimTensorSummary->name()) {} ~TensorSummary() = default; diff --git a/mindspore/core/ops/tile.h b/mindspore/core/ops/tile.h index 6150649d0a..ca3be5763f 100644 --- a/mindspore/core/ops/tile.h +++ b/mindspore/core/ops/tile.h @@ -28,7 +28,7 @@ namespace mindspore { namespace ops { constexpr auto kNameTile = prim::kTile; -class Tile : public PrimitiveC { +class MS_CORE_API Tile : public PrimitiveC { public: Tile() : PrimitiveC(kNameTile) { InitIOName({"x", "multiples"}, {"output"}); } explicit Tile(const std::string k_name) : PrimitiveC(k_name) { InitIOName({"x", "multiples"}, {"output"}); } diff --git a/mindspore/core/ops/to_format.h b/mindspore/core/ops/to_format.h index 3e438c168c..141d285ceb 100644 --- a/mindspore/core/ops/to_format.h +++ b/mindspore/core/ops/to_format.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { constexpr auto kNameToFormat = "ToFormat"; -class ToFormat : public PrimitiveC { +class MS_CORE_API ToFormat : public PrimitiveC { public: ToFormat() : PrimitiveC(kNameToFormat) {} ~ToFormat() = default; diff --git a/mindspore/core/ops/topk.h b/mindspore/core/ops/topk.h index 94a5cf8c12..16258ce6e8 100644 --- a/mindspore/core/ops/topk.h +++ b/mindspore/core/ops/topk.h @@ -26,7 +26,7 @@ namespace mindspore { namespace ops { constexpr auto kNameTopK = "TopK"; -class TopK : public PrimitiveC { +class MS_CORE_API TopK : public PrimitiveC { public: explicit TopK(const std::string &k_name = kNameTopK) : PrimitiveC(k_name) { InitIOName({"input", "k"}, {"values", "indices"}); diff --git a/mindspore/core/ops/transpose.h b/mindspore/core/ops/transpose.h index 56b4c25f32..230b4d970d 100644 --- a/mindspore/core/ops/transpose.h +++ b/mindspore/core/ops/transpose.h @@ -25,7 +25,7 @@ namespace mindspore { namespace ops { constexpr auto kNameTranspose = prim::kTranspose; -class Transpose : public PrimitiveC { +class MS_CORE_API Transpose : public PrimitiveC { public: Transpose() : PrimitiveC(prim::kTranspose) { InitIOName({"x", "perm"}, {"output"}); } ~Transpose() = default; diff --git a/mindspore/core/ops/uniform_real.h b/mindspore/core/ops/uniform_real.h index 4ca1b366de..34dd9fccfd 100644 --- a/mindspore/core/ops/uniform_real.h +++ b/mindspore/core/ops/uniform_real.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { constexpr auto kNameUniformReal = "UniformReal"; -class UniformReal : public PrimitiveC { +class MS_CORE_API UniformReal : public PrimitiveC { public: UniformReal() : PrimitiveC(kNameUniformReal) {} ~UniformReal() = default; diff --git a/mindspore/core/ops/unique.h b/mindspore/core/ops/unique.h index d0d797c061..e0526aae9b 100644 --- a/mindspore/core/ops/unique.h +++ b/mindspore/core/ops/unique.h @@ -23,7 +23,7 @@ namespace mindspore { namespace ops { constexpr auto kNameUnique = "Unique"; -class Unique : public PrimitiveC { +class MS_CORE_API Unique : public PrimitiveC { public: Unique() : PrimitiveC(kNameUnique) { InitIOName({"x", "y"}, {"output"}); } ~Unique() = default; diff --git a/mindspore/core/ops/unpack.h b/mindspore/core/ops/unpack.h index ee53d711e6..79820bfc8f 100644 --- a/mindspore/core/ops/unpack.h +++ b/mindspore/core/ops/unpack.h @@ -31,7 +31,7 @@ namespace mindspore { namespace ops { constexpr auto kNameUnpack = "Unpack"; -class Unpack : public PrimitiveC { +class MS_CORE_API Unpack : public PrimitiveC { public: Unpack() : PrimitiveC(kNameUnpack) {} ~Unpack() = default; diff --git a/mindspore/core/ops/unsorted_segment_sum.h b/mindspore/core/ops/unsorted_segment_sum.h index 986c3b730c..5bd13acf6f 100644 --- a/mindspore/core/ops/unsorted_segment_sum.h +++ b/mindspore/core/ops/unsorted_segment_sum.h @@ -28,7 +28,7 @@ namespace mindspore { namespace ops { constexpr auto kNameUnsortedSegmentSum = "UnsortedSegmentSum"; -class UnsortedSegmentSum : public PrimitiveC { +class MS_CORE_API UnsortedSegmentSum : public PrimitiveC { public: UnsortedSegmentSum() : PrimitiveC(kNameUnsortedSegmentSum) { InitIOName({"x", "segment_ids", "num_segments"}, {"y"}); diff --git a/mindspore/core/ops/unsqueeze.h b/mindspore/core/ops/unsqueeze.h index a207d51db2..7dd2f44be0 100644 --- a/mindspore/core/ops/unsqueeze.h +++ b/mindspore/core/ops/unsqueeze.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { constexpr auto kNameUnsqueeze = "Unsqueeze"; -class Unsqueeze : public PrimitiveC { +class MS_CORE_API Unsqueeze : public PrimitiveC { public: Unsqueeze() : PrimitiveC(kNameUnsqueeze) {} ~Unsqueeze() = default; diff --git a/mindspore/core/ops/unstack.h b/mindspore/core/ops/unstack.h index 3657f5dc7d..91712c6235 100644 --- a/mindspore/core/ops/unstack.h +++ b/mindspore/core/ops/unstack.h @@ -31,7 +31,7 @@ namespace mindspore { namespace ops { constexpr auto kNameUnstack = "Unstack"; -class Unstack : public PrimitiveC { +class MS_CORE_API Unstack : public PrimitiveC { public: Unstack() : PrimitiveC(kNameUnstack) {} ~Unstack() = default; diff --git a/mindspore/core/ops/where.h b/mindspore/core/ops/where.h index 5a0b8c37a8..c957e8b275 100644 --- a/mindspore/core/ops/where.h +++ b/mindspore/core/ops/where.h @@ -26,7 +26,7 @@ namespace mindspore { namespace ops { constexpr auto kNameWhere = "Where"; -class Where : public PrimitiveC { +class MS_CORE_API Where : public PrimitiveC { public: Where() : PrimitiveC(kNameWhere) { InitIOName({"condition"}, {"output"}); } ~Where() = default; diff --git a/mindspore/core/ops/zeros.h b/mindspore/core/ops/zeros.h index d0c23bfc32..d6b70ec8d7 100644 --- a/mindspore/core/ops/zeros.h +++ b/mindspore/core/ops/zeros.h @@ -27,7 +27,7 @@ namespace mindspore { namespace ops { -class Zeros : public PrimitiveC { +class MS_CORE_API Zeros : public PrimitiveC { public: Zeros() : PrimitiveC(prim::kPrimZeros->name()) {} ~Zeros() = default; diff --git a/mindspore/core/ops/zeros_like.h b/mindspore/core/ops/zeros_like.h index 7dde20d687..0b404bcfb4 100644 --- a/mindspore/core/ops/zeros_like.h +++ b/mindspore/core/ops/zeros_like.h @@ -25,7 +25,7 @@ namespace mindspore { namespace ops { -class ZerosLike : public PrimitiveC { +class MS_CORE_API ZerosLike : public PrimitiveC { public: ZerosLike() : PrimitiveC(prim::kPrimZerosLike->name()) { InitIOName({"x"}, {"y"}); } ~ZerosLike() = default; diff --git a/mindspore/core/utils/log_adapter.h b/mindspore/core/utils/log_adapter.h index 60766cc6d3..6350353b73 100644 --- a/mindspore/core/utils/log_adapter.h +++ b/mindspore/core/utils/log_adapter.h @@ -25,6 +25,7 @@ #include #include #include +#include "utils/visible.h" #include "utils/overload.h" #include "./securec.h" #ifdef USE_GLOG @@ -44,7 +45,7 @@ static constexpr size_t GetRelPathPos() noexcept { } namespace mindspore { -extern std::map acl_handle_map __attribute__((visibility("default"))); +MS_CORE_API extern std::map acl_handle_map; #define FILE_NAME \ (sizeof(__FILE__) > GetRelPathPos() ? static_cast(__FILE__) + GetRelPathPos() \ : static_cast(__FILE__)) @@ -69,7 +70,7 @@ enum ExceptionType { NameError }; -struct LocationInfo { +struct MS_CORE_API LocationInfo { LocationInfo(const char *file, int line, const char *func) : file_(file), line_(line), func_(func) {} ~LocationInfo() = default; @@ -78,7 +79,7 @@ struct LocationInfo { const char *func_; }; -class LogStream { +class MS_CORE_API LogStream { public: LogStream() { sstream_ = std::make_shared(); } ~LogStream() = default; @@ -146,27 +147,15 @@ enum SubModuleId : int { #define SUBMODULE_ID mindspore::SubModuleId::SM_ME #endif -#if defined(_WIN32) || defined(_WIN64) -extern const std::string GetSubModuleName(SubModuleId module_id) __attribute__((dllexport)); -#else -extern const std::string GetSubModuleName(SubModuleId module_id) __attribute__((visibility("default"))); -#endif +MS_EXPORT const std::string GetSubModuleName(SubModuleId module_id); const char *EnumStrForMsLogLevel(MsLogLevel level); -#if defined(_WIN32) || defined(_WIN64) -extern std::string GetTimeString() __attribute__((dllexport)); -#else -extern std::string GetTimeString() __attribute__((visibility("default"))); -#endif +MS_EXPORT std::string GetTimeString(); -#if defined(_WIN32) || defined(_WIN64) -extern int g_ms_submodule_log_levels[] __attribute__((dllexport)); -#else -extern int g_ms_submodule_log_levels[] __attribute__((visibility("default"))); -#endif +MS_EXPORT extern int g_ms_submodule_log_levels[]; -class LogWriter { +class MS_CORE_API LogWriter { public: using ExceptionHandler = std::function; using TraceProvider = std::function; @@ -176,8 +165,8 @@ class LogWriter { : location_(location), log_level_(log_level), submodule_(submodule), exception_type_(excp_type) {} ~LogWriter() = default; - void operator<(const LogStream &stream) const noexcept __attribute__((visibility("default"))); - void operator^(const LogStream &stream) const __attribute__((noreturn, visibility("default"))); + void operator<(const LogStream &stream) const noexcept; + [[noreturn]] void operator^(const LogStream &stream) const; static void set_exception_handler(ExceptionHandler exception_handler) { exception_handler_ = exception_handler; } static void set_trace_provider(TraceProvider trace_provider) { trace_provider_ = trace_provider; } diff --git a/mindspore/core/utils/visible.h b/mindspore/core/utils/visible.h index afa9b4a46b..2a3315c0a8 100644 --- a/mindspore/core/utils/visible.h +++ b/mindspore/core/utils/visible.h @@ -1,5 +1,5 @@ /** - * Copyright 2019 Huawei Technologies Co., Ltd + * Copyright 2019-2021 Huawei Technologies Co., Ltd * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,27 +17,20 @@ #ifndef MINDSPORE_CORE_UTILS_VISIBLE_H_ #define MINDSPORE_CORE_UTILS_VISIBLE_H_ -namespace mindspore { -// refer to https://gcc.gnu.org/wiki/Visibility -#if defined _WIN32 || defined __CYGWIN__ +#if (defined(_WIN32) || defined(__WIN32__) || defined(WIN32) || defined(__CYGWIN__)) +// Because it extremely slow down compile time in mingw, +// core api exporting is disabled for Windows. +#define MS_CORE_API #ifdef BUILDING_DLL -#ifdef __GNUC__ -#define MS_EXPORT __attribute__((dllexport)) +#define MS_EXPORT __declspec(dllexport) #else -#define MS_EXPORT __declspec(dllexport) // Note: actually gcc seems to also supports this syntax. -#endif -#else -#ifdef __GNUC__ -#define MS_EXPORT __attribute__((dllimport)) -#else -#define MS_EXPORT __declspec(dllimport) // Note: actually gcc seems to also supports this syntax. -#endif +#define MS_EXPORT __declspec(dllimport) #endif #define MS_LOCAL #else +#define MS_CORE_API __attribute__((visibility("default"))) #define MS_EXPORT __attribute__((visibility("default"))) #define MS_LOCAL __attribute__((visibility("hidden"))) #endif -} // namespace mindspore #endif // MINDSPORE_CORE_UTILS_VISIBLE_H_