diff --git a/mace/core/BUILD b/mace/core/BUILD index 9d337bc4b8f19755dbc71f1f2a1120981b64e628..63a30357240f99df964d1c23d2884739f61827db 100644 --- a/mace/core/BUILD +++ b/mace/core/BUILD @@ -12,11 +12,11 @@ load("//mace:mace.bzl", "if_android") cc_library( name = "opencl_runtime", srcs = glob([ - "runtime/opencl/cl.hpp", - "runtime/opencl/cl2.hpp", "runtime/opencl/*.cc", ]), hdrs = glob([ + "runtime/opencl/cl.hpp", + "runtime/opencl/cl2.hpp", "runtime/opencl/*.h", ]), copts = ["-std=c++11"], diff --git a/mace/core/runtime/opencl/cl2_header.h b/mace/core/runtime/opencl/cl2_header.h new file mode 100644 index 0000000000000000000000000000000000000000..f7c4af4b1cfee051e8afd869d945700eefa1cf20 --- /dev/null +++ b/mace/core/runtime/opencl/cl2_header.h @@ -0,0 +1,12 @@ +// +// Copyright (c) 2017 XiaoMi All rights reserved. +// + +#ifndef MACE_CORE_RUNTIME_OPENCL_CL2_HEADER_H_ +#define MACE_CORE_RUNTIME_OPENCL_CL2_HEADER_H_ + +#define CL_HPP_TARGET_OPENCL_VERSION 200 + +#include "mace/core/runtime/opencl/cl2.hpp" + +#endif // MACE_CORE_RUNTIME_OPENCL_CL2_HEADER_H_ diff --git a/mace/core/runtime/opencl/opencl_allocator.cc b/mace/core/runtime/opencl/opencl_allocator.cc index f1338cf2bb05bf08b436c38c76216e5a0a97bed2..d40432e2a2bb18b264d641d55f66868a26dafc22 100644 --- a/mace/core/runtime/opencl/opencl_allocator.cc +++ b/mace/core/runtime/opencl/opencl_allocator.cc @@ -2,8 +2,8 @@ // Copyright (c) 2017 XiaoMi All rights reserved. // +#include "mace/core/runtime/opencl/cl2_header.h" #include "mace/core/runtime/opencl/opencl_allocator.h" -#include "mace/core/runtime/opencl/cl2.hpp" #include "mace/core/runtime/opencl/opencl_runtime.h" namespace mace { diff --git a/mace/core/runtime/opencl/opencl_runtime.h b/mace/core/runtime/opencl/opencl_runtime.h index e7c7b180e43ba13dfdfedec9a63b5973bdfcb55a..f21ade57fa73cabd48a50e6baf4f7284cc51e40f 100644 --- a/mace/core/runtime/opencl/opencl_runtime.h +++ b/mace/core/runtime/opencl/opencl_runtime.h @@ -5,14 +5,10 @@ #ifndef MACE_CORE_RUNTIME_OPENCL_OPENCL_RUNTIME_H_ #define MACE_CORE_RUNTIME_OPENCL_OPENCL_RUNTIME_H_ -#ifndef CL_HPP_TARGET_OPENCL_VERSION -#define CL_HPP_TARGET_OPENCL_VERSION 200 -#endif - #include #include -#include "mace/core/runtime/opencl/cl2.hpp" +#include "mace/core/runtime/opencl/cl2_header.h" #include "mace/core/runtime/opencl/opencl_wrapper.h" namespace mace { diff --git a/mace/kernels/opencl/batch_norm_opencl.cc b/mace/kernels/opencl/batch_norm_opencl.cc index 82efa4595ae6e4f091ce9618dc4e1b16199f382d..86f15164a1f9bd99d09b591cff705eccc62446d9 100644 --- a/mace/kernels/opencl/batch_norm_opencl.cc +++ b/mace/kernels/opencl/batch_norm_opencl.cc @@ -3,7 +3,7 @@ // #include "mace/kernels/batch_norm.h" -#include "mace/core/runtime/opencl/cl2.hpp" +#include "mace/core/runtime/opencl/cl2_header.h" #include "mace/core/runtime/opencl/opencl_runtime.h" #include "mace/utils/tuner.h" @@ -79,4 +79,4 @@ void BatchNormFunctor::operator()( } } // namespace kernels -} // namespace mace \ No newline at end of file +} // namespace mace