提交 ab81d04a 编写于 作者: 李滨

Merge branch 'fix-build-standalone' into 'master'

Fix bug: build x86_64 which need opencl.

See merge request !659
...@@ -3,6 +3,7 @@ stages: ...@@ -3,6 +3,7 @@ stages:
- pycodestyle - pycodestyle
- docs - docs
- platform_compatible_tests - platform_compatible_tests
- build_libraries
- ndk_versions_compatible_tests - ndk_versions_compatible_tests
- ops_test - ops_test
- api_test - api_test
...@@ -72,6 +73,11 @@ platform_compatible_tests: ...@@ -72,6 +73,11 @@ platform_compatible_tests:
script: script:
- bazel build mace/core:core - bazel build mace/core:core
build_libraries:
stage: build_libraries
script:
- bash tools/build-standalone-lib.sh
ndk_versions_compatible_tests: ndk_versions_compatible_tests:
stage: ndk_versions_compatible_tests stage: ndk_versions_compatible_tests
script: script:
......
...@@ -12,8 +12,11 @@ ...@@ -12,8 +12,11 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
#include "mace/core/macros.h"
#include "mace/core/runtime/cpu/cpu_runtime.h" #include "mace/core/runtime/cpu/cpu_runtime.h"
#ifdef MACE_ENABLE_OPENCL
#include "mace/core/runtime/opencl/opencl_runtime.h" #include "mace/core/runtime/opencl/opencl_runtime.h"
#endif // MACE_ENABLE_OPENCL
#include "mace/public/mace_runtime.h" #include "mace/public/mace_runtime.h"
#include "mace/utils/logging.h" #include "mace/utils/logging.h"
...@@ -28,7 +31,11 @@ void SetKVStorageFactory(std::shared_ptr<KVStorageFactory> storage_factory) { ...@@ -28,7 +31,11 @@ void SetKVStorageFactory(std::shared_ptr<KVStorageFactory> storage_factory) {
// Set OpenCL Compiled Binary paths, just call once. (Not thread-safe) // Set OpenCL Compiled Binary paths, just call once. (Not thread-safe)
void SetOpenCLBinaryPaths(const std::vector<std::string> &paths) { void SetOpenCLBinaryPaths(const std::vector<std::string> &paths) {
#ifdef MACE_ENABLE_OPENCL
OpenCLRuntime::ConfigureOpenCLBinaryPath(paths); OpenCLRuntime::ConfigureOpenCLBinaryPath(paths);
#else
MACE_UNUSED(paths);
#endif // MACE_ENABLE_OPENCL
} }
extern std::string kOpenCLParameterPath; extern std::string kOpenCLParameterPath;
...@@ -38,9 +45,14 @@ void SetOpenCLParameterPath(const std::string &path) { ...@@ -38,9 +45,14 @@ void SetOpenCLParameterPath(const std::string &path) {
} }
void SetGPUHints(GPUPerfHint gpu_perf_hint, GPUPriorityHint gpu_priority_hint) { void SetGPUHints(GPUPerfHint gpu_perf_hint, GPUPriorityHint gpu_priority_hint) {
#ifdef MACE_ENABLE_OPENCL
VLOG(1) << "Set GPU configurations, gpu_perf_hint: " << gpu_perf_hint VLOG(1) << "Set GPU configurations, gpu_perf_hint: " << gpu_perf_hint
<< ", gpu_priority_hint: " << gpu_priority_hint; << ", gpu_priority_hint: " << gpu_priority_hint;
OpenCLRuntime::Configure(gpu_perf_hint, gpu_priority_hint); OpenCLRuntime::Configure(gpu_perf_hint, gpu_priority_hint);
#else
MACE_UNUSED(gpu_perf_hint);
MACE_UNUSED(gpu_priority_hint);
#endif // MACE_ENABLE_OPENCL
} }
MaceStatus SetOpenMPThreadPolicy(int num_threads_hint, MaceStatus SetOpenMPThreadPolicy(int num_threads_hint,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册