From b7d27db3825492aec40a573028a648132622ba5f Mon Sep 17 00:00:00 2001 From: Sergey Semenov Date: Wed, 14 Sep 2022 05:22:49 -0700 Subject: [PATCH] [SYCL] Remove unused argument from getDeviceImpl --- sycl/source/detail/platform_impl.cpp | 13 ++++++------- sycl/source/detail/platform_impl.hpp | 10 ++-------- sycl/source/detail/usm/usm_impl.cpp | 2 +- 3 files changed, 9 insertions(+), 16 deletions(-) diff --git a/sycl/source/detail/platform_impl.cpp b/sycl/source/detail/platform_impl.cpp index 149bbd730ece0..e97f77439fa44 100644 --- a/sycl/source/detail/platform_impl.cpp +++ b/sycl/source/detail/platform_impl.cpp @@ -213,18 +213,17 @@ static void filterDeviceFilter(std::vector &PiDevices, Plugin.setLastDeviceId(Platform, DeviceNum); } -std::shared_ptr platform_impl::getDeviceImpl( - RT::PiDevice PiDevice, const std::shared_ptr &PlatformImpl) { +std::shared_ptr +platform_impl::getDeviceImpl(RT::PiDevice PiDevice) { const std::lock_guard Guard(MDeviceMapMutex); - return getDeviceImplHelper(PiDevice, PlatformImpl); + return getDeviceImplHelper(PiDevice); } std::shared_ptr platform_impl::getOrMakeDeviceImpl( RT::PiDevice PiDevice, const std::shared_ptr &PlatformImpl) { const std::lock_guard Guard(MDeviceMapMutex); // If we've already seen this device, return the impl - std::shared_ptr Result = - getDeviceImplHelper(PiDevice, PlatformImpl); + std::shared_ptr Result = getDeviceImplHelper(PiDevice); if (Result) return Result; @@ -336,8 +335,8 @@ bool platform_impl::has(aspect Aspect) const { return true; } -std::shared_ptr platform_impl::getDeviceImplHelper( - RT::PiDevice PiDevice, const std::shared_ptr &PlatformImpl) { +std::shared_ptr +platform_impl::getDeviceImplHelper(RT::PiDevice PiDevice) { for (const std::weak_ptr &DeviceWP : MDeviceCache) { if (std::shared_ptr Device = DeviceWP.lock()) { if (Device->getHandleRef() == PiDevice) diff --git a/sycl/source/detail/platform_impl.hpp b/sycl/source/detail/platform_impl.hpp index 013b146555c4e..b3fdc9cf608b0 100644 --- a/sycl/source/detail/platform_impl.hpp +++ b/sycl/source/detail/platform_impl.hpp @@ -142,12 +142,8 @@ class platform_impl { /// /// \param PiDevice is the PiDevice whose impl is requested /// - /// \param PlatormImpl is the Platform for that Device - /// /// \return a shared_ptr corresponding to the device - std::shared_ptr - getDeviceImpl(RT::PiDevice PiDevice, - const std::shared_ptr &PlatformImpl); + std::shared_ptr getDeviceImpl(RT::PiDevice PiDevice); /// Queries the device_impl cache to either return a shared_ptr /// for the device_impl corresponding to the PiDevice or add @@ -193,9 +189,7 @@ class platform_impl { getPlatformFromPiDevice(RT::PiDevice PiDevice, const plugin &Plugin); private: - std::shared_ptr - getDeviceImplHelper(RT::PiDevice PiDevice, - const std::shared_ptr &PlatformImpl); + std::shared_ptr getDeviceImplHelper(RT::PiDevice PiDevice); bool MHostPlatform = false; RT::PiPlatform MPlatform = 0; diff --git a/sycl/source/detail/usm/usm_impl.cpp b/sycl/source/detail/usm/usm_impl.cpp index 1b6534ba9ab6a..52ee3769a7cf0 100644 --- a/sycl/source/detail/usm/usm_impl.cpp +++ b/sycl/source/detail/usm/usm_impl.cpp @@ -598,7 +598,7 @@ device get_pointer_device(const void *Ptr, const context &Ctxt) { // member's descendant instead. Fetch the corresponding device from the cache. std::shared_ptr PltImpl = CtxImpl->getPlatformImpl(); std::shared_ptr DevImpl = - PltImpl->getDeviceImpl(DeviceId, PltImpl); + PltImpl->getDeviceImpl(DeviceId); if (DevImpl) return detail::createSyclObjFromImpl(DevImpl); throw runtime_error("Cannot find device associated with USM allocation!",