SINGA-173 OpenCL device support and implementation: Fixed a missing header 
include in device.cc, and ifdef switches for OpenCL.


Project: http://git-wip-us.apache.org/repos/asf/incubator-singa/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-singa/commit/f9219cc3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-singa/tree/f9219cc3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-singa/diff/f9219cc3

Branch: refs/heads/dev
Commit: f9219cc3e66b07dbe3cd5a46f2437532d2f87fee
Parents: 57f3a1e
Author: Tan Li Boon <[email protected]>
Authored: Tue Jul 26 21:15:14 2016 +0800
Committer: Tan Li Boon <[email protected]>
Committed: Tue Jul 26 21:15:14 2016 +0800

----------------------------------------------------------------------
 include/singa/core/device.h | 11 +++++++++++
 src/core/device/platform.cc |  9 ---------
 2 files changed, 11 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/f9219cc3/include/singa/core/device.h
----------------------------------------------------------------------
diff --git a/include/singa/core/device.h b/include/singa/core/device.h
index a7f6488..95de99d 100644
--- a/include/singa/core/device.h
+++ b/include/singa/core/device.h
@@ -24,12 +24,21 @@
 #include <string>
 #include <functional>
 #include <memory>
+
 #include "singa/singa_config.h"
 #include "singa/core/common.h"
 #include "singa/core/memory.h"
 #include "singa/core/scheduler.h"
 #include "singa/proto/core.pb.h"
 
+#ifdef USE_CUDA
+#include "singa/utils/cuda_utils.h"
+#endif // USE_CUDA
+
+#ifdef USE_OPENCL
+#include "singa/utils/opencl_utils.h"
+#endif // USE_OPENCL
+
 using std::vector;
 using std::string;
 using std::function;
@@ -253,7 +262,9 @@ public:
 
 
 private:
+#ifdef USE_OPENCL
   cl::Platform clPlatform;
+#endif
 };
 
 }  // namespace singa

http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/f9219cc3/src/core/device/platform.cc
----------------------------------------------------------------------
diff --git a/src/core/device/platform.cc b/src/core/device/platform.cc
index 80826c0..a4561de 100644
--- a/src/core/device/platform.cc
+++ b/src/core/device/platform.cc
@@ -16,19 +16,10 @@
  * limitations under the License.
  */
 
-#ifdef USE_CUDA
-#include "singa/utils/cuda_utils.h"
-#endif // USE_CUDA
-
-#ifdef USE_OPENCL
-#include <cl/cl2.hpp>
-#endif // USE_OPENCL
-
 #include "singa/core/device.h"
 #include "singa/singa_config.h"
 
 #ifdef USE_CUDA
-#include "singa/utils/cuda_utils.h"
 
 namespace singa {
 

Reply via email to