diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a126054f23133a6753ec0d84e957c1c37b8521df..e49a7dc0cfec2f172044c2c01e840546aefa1e1f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,6 +3,7 @@ stages: - pycodestyle - docs - platform_compatible_tests + - build_libraries - ndk_versions_compatible_tests - ops_test - api_test @@ -72,6 +73,11 @@ platform_compatible_tests: script: - bazel build mace/core:core +build_libraries: + stage: build_libraries + script: + - bash tools/build-standalone-lib.sh + ndk_versions_compatible_tests: stage: ndk_versions_compatible_tests script: diff --git a/mace/libmace/mace_runtime.cc b/mace/libmace/mace_runtime.cc index 720b82994425905258d0c042b6d5f750004fc7a9..41eabd45f7d1d398868b6d3d71af7b15f51c9d78 100644 --- a/mace/libmace/mace_runtime.cc +++ b/mace/libmace/mace_runtime.cc @@ -12,8 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include "mace/core/macros.h" #include "mace/core/runtime/cpu/cpu_runtime.h" +#ifdef MACE_ENABLE_OPENCL #include "mace/core/runtime/opencl/opencl_runtime.h" +#endif // MACE_ENABLE_OPENCL #include "mace/public/mace_runtime.h" #include "mace/utils/logging.h" @@ -28,7 +31,11 @@ void SetKVStorageFactory(std::shared_ptr storage_factory) { // Set OpenCL Compiled Binary paths, just call once. (Not thread-safe) void SetOpenCLBinaryPaths(const std::vector &paths) { +#ifdef MACE_ENABLE_OPENCL OpenCLRuntime::ConfigureOpenCLBinaryPath(paths); +#else + MACE_UNUSED(paths); +#endif // MACE_ENABLE_OPENCL } extern std::string kOpenCLParameterPath; @@ -38,9 +45,14 @@ void SetOpenCLParameterPath(const std::string &path) { } 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 << ", gpu_priority_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,