aboutsummaryrefslogtreecommitdiff
path: root/tests/TensorCache.h
diff options
context:
space:
mode:
authorGeorgios Pinitas <georgios.pinitas@arm.com>2018-10-26 19:05:32 +0100
committerGeorgios Pinitas <georgios.pinitas@arm.com>2018-11-08 12:00:31 +0000
commit421405b6a21b124288a750e2da26dc01eb7391cb (patch)
tree35f5655ce9d8b5921cb03630534f532e4eb47bf5 /tests/TensorCache.h
parentf1adf11c776aebaa8da1b8644a4ba2453afd2b81 (diff)
downloadComputeLibrary-421405b6a21b124288a750e2da26dc01eb7391cb.tar.gz
COMPMID-1675: Add SVE support
Change-Id: I86679adff556b6ffc9929b35cbf1b59b3958bdb1
Diffstat (limited to 'tests/TensorCache.h')
-rw-r--r--tests/TensorCache.h14
1 files changed, 8 insertions, 6 deletions
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