Skip to content

Commit

Permalink
c++ api: add primitive kind enum
Browse files Browse the repository at this point in the history
  • Loading branch information
Fomenko, Evarist M committed Nov 1, 2017
1 parent 50d880a commit 85911b9
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions include/mkldnn.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,26 @@ class primitive: public handle<mkldnn_primitive_t> {
friend class primitive_at;
using handle::handle;
public:
/// A proxy to C primitive kind enum
enum class kind {
undefined_primitive = mkldnn_undefined_primitive,
memory = mkldnn_memory,
view = mkldnn_view,
reorder = mkldnn_reorder,
concat = mkldnn_concat,
concat_inplace = mkldnn_concat_inplace,
sum = mkldnn_sum,
convolution = mkldnn_convolution,
eltwise = mkldnn_eltwise,
relu = mkldnn_relu,
softmax = mkldnn_softmax,
pooling = mkldnn_pooling,
lrn = mkldnn_lrn,
batch_normalization = mkldnn_batch_normalization,
inner_product = mkldnn_inner_product,
convolution_relu = mkldnn_convolution_relu,
};

/// A wrapper structure to specify a particular output of a primitive.
struct at {
/// The underlying C API structure.
Expand All @@ -126,6 +146,10 @@ class primitive: public handle<mkldnn_primitive_t> {
// TODO: use the C++ API wrapper structure.
};

inline mkldnn_primitive_kind_t convert_to_c(primitive::kind akind) {
return static_cast<mkldnn_primitive_kind_t>(akind);
}

/// Intel(R) MKL-DNN exception class.
///
/// This class captures the status returned by the failed C API function, error
Expand Down

0 comments on commit 85911b9

Please sign in to comment.