提交 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:
- 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:
......
......@@ -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<KVStorageFactory> storage_factory) {
// Set OpenCL Compiled Binary paths, just call once. (Not thread-safe)
void SetOpenCLBinaryPaths(const std::vector<std::string> &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,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册