Move ideep singleton registration to ATen from C2. (#18335)
authorGregory Chanan <gchanan@fb.com>
Mon, 1 Apr 2019 14:57:48 +0000 (07:57 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Mon, 1 Apr 2019 15:00:33 +0000 (08:00 -0700)
Summary:
Since we are going to add ideep to ATen, and ATen is always compiled, it makes sense to have the registration in ATen rather than C2.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/18335

Reviewed By: bddppq

Differential Revision: D14578652

Pulled By: gchanan

fbshipit-source-id: 4d77fcfc21a362b21d5291a127498aa722548873

aten/src/ATen/native/mkldnn/IDeepRegistration.cpp [new file with mode: 0644]
caffe2/ideep/utils/ideep_register.cc

diff --git a/aten/src/ATen/native/mkldnn/IDeepRegistration.cpp b/aten/src/ATen/native/mkldnn/IDeepRegistration.cpp
new file mode 100644 (file)
index 0000000..ffbcdf7
--- /dev/null
@@ -0,0 +1,8 @@
+#include <ATen/Config.h>
+
+#if AT_MKLDNN_ENABLED()
+
+// needs to be included only once in library.
+#include <ideep_pin_singletons.hpp>
+
+#endif // AT_MKLDNN_ENALBED()
index a352238..1932adc 100644 (file)
@@ -1,7 +1,7 @@
 #include <caffe2/core/event_cpu.h>
 #include <caffe2/core/operator.h>
 #include <caffe2/proto/caffe2_pb.h>
-#include <ideep_pin_singletons.hpp>
+#include <ideep/tensor.hpp>
 #include "ideep_context.h"
 
 namespace at {