From cf9c843b44db74ad5671efd2efdf9a4b4dd79214 Mon Sep 17 00:00:00 2001 From: Pablo Tello Date: Mon, 22 Jul 2019 17:36:03 +0100 Subject: COMPMID 1528: Fixed compilation error when opencl=0 Change-Id: I0d57ba882a608026f582f9f208830e5b5ad315cd Signed-off-by: Pablo Tello Reviewed-on: https://review.mlplatform.org/c/1586 Tested-by: Arm Jenkins Reviewed-by: Giuseppe Rossini Comments-Addressed: Arm Jenkins --- utils/Utils.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'utils') diff --git a/utils/Utils.cpp b/utils/Utils.cpp index 47ec25963b..baf829b473 100644 --- a/utils/Utils.cpp +++ b/utils/Utils.cpp @@ -23,7 +23,9 @@ */ #include "Utils.h" +#ifdef ARM_COMPUTE_CL #include "arm_compute/runtime/CL/CLScheduler.h" +#endif /* ARM_COMPUTE_CL */ #include #include @@ -276,6 +278,7 @@ uint64_t get_mem_free_from_meminfo() */ void restore_program_cache_from_file(const std::string &filename) { +#ifdef ARM_COMPUTE_CL std::ifstream cache_file(filename, std::ios::binary); if(cache_file.is_open()) { @@ -310,6 +313,7 @@ void restore_program_cache_from_file(const std::string &filename) } cache_file.close(); } +#endif /* ARM_COMPUTE_CL */ } /** This function saves opencl kernels library to a file @@ -318,6 +322,7 @@ void restore_program_cache_from_file(const std::string &filename) */ void save_program_cache_to_file(const std::string &filename) { +#ifdef ARM_COMPUTE_CL if(CLScheduler::get().is_initialised()) { std::ofstream cache_file(filename, std::ios::binary); @@ -342,6 +347,7 @@ void save_program_cache_to_file(const std::string &filename) ARM_COMPUTE_ERROR("Cannot open cache file"); } } +#endif /* ARM_COMPUTE_CL */ } } // namespace utils } // namespace arm_compute -- cgit v1.2.1