diff options
author | Georgios Pinitas <georgios.pinitas@arm.com> | 2018-10-26 19:05:32 +0100 |
---|---|---|
committer | Georgios Pinitas <georgios.pinitas@arm.com> | 2018-11-08 12:00:31 +0000 |
commit | 421405b6a21b124288a750e2da26dc01eb7391cb (patch) | |
tree | 35f5655ce9d8b5921cb03630534f532e4eb47bf5 /tests | |
parent | f1adf11c776aebaa8da1b8644a4ba2453afd2b81 (diff) | |
download | ComputeLibrary-421405b6a21b124288a750e2da26dc01eb7391cb.tar.gz |
COMPMID-1675: Add SVE support
Change-Id: I86679adff556b6ffc9929b35cbf1b59b3958bdb1
Diffstat (limited to 'tests')
-rw-r--r-- | tests/AssetsLibrary.cpp | 4 | ||||
-rw-r--r-- | tests/AssetsLibrary.h | 4 | ||||
-rw-r--r-- | tests/SConscript | 2 | ||||
-rw-r--r-- | tests/TensorCache.h | 14 | ||||
-rw-r--r-- | tests/framework/instruments/Instruments.h | 2 |
5 files changed, 15 insertions, 11 deletions
diff --git a/tests/AssetsLibrary.cpp b/tests/AssetsLibrary.cpp index ee876f91e3..c6d86d1c1a 100644 --- a/tests/AssetsLibrary.cpp +++ b/tests/AssetsLibrary.cpp @@ -416,7 +416,7 @@ RawTensor AssetsLibrary::load_image(const std::string &name) const const RawTensor &AssetsLibrary::find_or_create_raw_tensor(const std::string &name, Format format) const { - std::lock_guard<std::mutex> guard(_format_lock); + std::lock_guard<arm_compute::Mutex> guard(_format_lock); const RawTensor *ptr = _cache.find(std::forward_as_tuple(name, format)); @@ -440,7 +440,7 @@ const RawTensor &AssetsLibrary::find_or_create_raw_tensor(const std::string &nam const RawTensor &AssetsLibrary::find_or_create_raw_tensor(const std::string &name, Format format, Channel channel) const { - std::lock_guard<std::mutex> guard(_channel_lock); + std::lock_guard<arm_compute::Mutex> guard(_channel_lock); const RawTensor *ptr = _cache.find(std::forward_as_tuple(name, format, channel)); diff --git a/tests/AssetsLibrary.h b/tests/AssetsLibrary.h index b1c8c430ad..7af036d256 100644 --- a/tests/AssetsLibrary.h +++ b/tests/AssetsLibrary.h @@ -414,8 +414,8 @@ private: const RawTensor &find_or_create_raw_tensor(const std::string &name, Format format, Channel channel) const; mutable TensorCache _cache{}; - mutable std::mutex _format_lock{}; - mutable std::mutex _channel_lock{}; + mutable arm_compute::Mutex _format_lock{}; + mutable arm_compute::Mutex _channel_lock{}; const std::string _library_path; std::random_device::result_type _seed; }; diff --git a/tests/SConscript b/tests/SConscript index ac826f848d..24714efa74 100644 --- a/tests/SConscript +++ b/tests/SConscript @@ -124,7 +124,7 @@ if env['gles_compute']: if env['os'] == 'android': test_env.Append(LIBS = ["log"]) -else: +elif env['os'] != 'bare_metal': test_env.Append(LIBS = ["rt"]) if test_env['benchmark_tests']: diff --git a/tests/TensorCache.h b/tests/TensorCache.h index 7cf64ffbe5..c8f21116d6 100644 --- a/tests/TensorCache.h +++ b/tests/TensorCache.h @@ -26,6 +26,8 @@ #include "RawTensor.h" +#include "support/Mutex.h" + #include <map> #include <mutex> #include <utility> @@ -84,10 +86,10 @@ private: using FormatMap = std::map<std::tuple<std::string, Format>, RawTensor>; using ChannelMap = std::map<std::tuple<std::string, Format, Channel>, RawTensor>; - FormatMap _raw_tensor_cache{}; - ChannelMap _raw_tensor_channel_cache{}; - std::mutex _raw_tensor_cache_mutex{}; - std::mutex _raw_tensor_channel_cache_mutex{}; + FormatMap _raw_tensor_cache{}; + ChannelMap _raw_tensor_channel_cache{}; + arm_compute::Mutex _raw_tensor_cache_mutex{}; + arm_compute::Mutex _raw_tensor_channel_cache_mutex{}; }; inline RawTensor *TensorCache::find(std::tuple<const std::string &, Format> key) @@ -104,13 +106,13 @@ inline RawTensor *TensorCache::find(std::tuple<const std::string &, Format, Chan inline RawTensor &TensorCache::add(std::tuple<const std::string &, Format> key, RawTensor raw) { - std::lock_guard<std::mutex> lock(_raw_tensor_channel_cache_mutex); + std::lock_guard<arm_compute::Mutex> lock(_raw_tensor_cache_mutex); return std::get<0>(_raw_tensor_cache.emplace(std::move(key), std::move(raw)))->second; } inline RawTensor &TensorCache::add(std::tuple<const std::string &, Format, Channel> key, RawTensor raw) { - std::lock_guard<std::mutex> lock(_raw_tensor_channel_cache_mutex); + std::lock_guard<arm_compute::Mutex> lock(_raw_tensor_channel_cache_mutex); return std::get<0>(_raw_tensor_channel_cache.emplace(std::move(key), std::move(raw)))->second; } } // namespace test diff --git a/tests/framework/instruments/Instruments.h b/tests/framework/instruments/Instruments.h index 705fc59b29..77c74b7b3e 100644 --- a/tests/framework/instruments/Instruments.h +++ b/tests/framework/instruments/Instruments.h @@ -24,10 +24,12 @@ #ifndef ARM_COMPUTE_TEST_INSTRUMENTS #define ARM_COMPUTE_TEST_INSTRUMENTS +#if !defined(BARE_METAL) #include "MaliCounter.h" #include "OpenCLMemoryUsage.h" #include "OpenCLTimer.h" #include "PMUCounter.h" +#endif /* !defined(BARE_METAL) */ #include "SchedulerTimer.h" #include "WallClockTimer.h" |