fix: cache canAccessPeer result of each pair of devices

query peer access only once per pair of devices

Related-To: NEO-14938

Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2025-06-12 15:33:25 +00:00
committed by Compute-Runtime-Automation
parent cdf087f3da
commit f165e713a5
5 changed files with 127 additions and 29 deletions

View File

@@ -125,6 +125,10 @@ struct DriverHandleImp : public DriverHandle {
void initHostUsmAllocPool();
void initDeviceUsmAllocPool(NEO::Device &device);
std::unique_lock<std::mutex> obtainPeerAccessQueryLock() {
return std::unique_lock<std::mutex>(peerAccessQueryMutex);
}
std::unique_ptr<HostPointerManager> hostPointerManager;
std::mutex sharedMakeResidentAllocationsLock;
@@ -174,6 +178,7 @@ struct DriverHandleImp : public DriverHandle {
// not based on the lifetime of the object of a class.
std::unordered_map<std::thread::id, std::string> errorDescs;
std::mutex errorDescsMutex;
std::mutex peerAccessQueryMutex;
int setErrorDescription(const std::string &str) override;
ze_result_t getErrorDescription(const char **ppString) override;
ze_result_t clearErrorDescription() override;