Skip to content

Commit f0c17d4

Browse files
[SYCL] Remove unused argument from getDeviceImpl (intel#6780)
1 parent 76ec14b commit f0c17d4

File tree

3 files changed

+9
-16
lines changed

3 files changed

+9
-16
lines changed

sycl/source/detail/platform_impl.cpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -213,18 +213,17 @@ static void filterDeviceFilter(std::vector<RT::PiDevice> &PiDevices,
213213
Plugin.setLastDeviceId(Platform, DeviceNum);
214214
}
215215

216-
std::shared_ptr<device_impl> platform_impl::getDeviceImpl(
217-
RT::PiDevice PiDevice, const std::shared_ptr<platform_impl> &PlatformImpl) {
216+
std::shared_ptr<device_impl>
217+
platform_impl::getDeviceImpl(RT::PiDevice PiDevice) {
218218
const std::lock_guard<std::mutex> Guard(MDeviceMapMutex);
219-
return getDeviceImplHelper(PiDevice, PlatformImpl);
219+
return getDeviceImplHelper(PiDevice);
220220
}
221221

222222
std::shared_ptr<device_impl> platform_impl::getOrMakeDeviceImpl(
223223
RT::PiDevice PiDevice, const std::shared_ptr<platform_impl> &PlatformImpl) {
224224
const std::lock_guard<std::mutex> Guard(MDeviceMapMutex);
225225
// If we've already seen this device, return the impl
226-
std::shared_ptr<device_impl> Result =
227-
getDeviceImplHelper(PiDevice, PlatformImpl);
226+
std::shared_ptr<device_impl> Result = getDeviceImplHelper(PiDevice);
228227
if (Result)
229228
return Result;
230229

@@ -336,8 +335,8 @@ bool platform_impl::has(aspect Aspect) const {
336335
return true;
337336
}
338337

339-
std::shared_ptr<device_impl> platform_impl::getDeviceImplHelper(
340-
RT::PiDevice PiDevice, const std::shared_ptr<platform_impl> &PlatformImpl) {
338+
std::shared_ptr<device_impl>
339+
platform_impl::getDeviceImplHelper(RT::PiDevice PiDevice) {
341340
for (const std::weak_ptr<device_impl> &DeviceWP : MDeviceCache) {
342341
if (std::shared_ptr<device_impl> Device = DeviceWP.lock()) {
343342
if (Device->getHandleRef() == PiDevice)

sycl/source/detail/platform_impl.hpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -142,12 +142,8 @@ class platform_impl {
142142
///
143143
/// \param PiDevice is the PiDevice whose impl is requested
144144
///
145-
/// \param PlatormImpl is the Platform for that Device
146-
///
147145
/// \return a shared_ptr<device_impl> corresponding to the device
148-
std::shared_ptr<device_impl>
149-
getDeviceImpl(RT::PiDevice PiDevice,
150-
const std::shared_ptr<platform_impl> &PlatformImpl);
146+
std::shared_ptr<device_impl> getDeviceImpl(RT::PiDevice PiDevice);
151147

152148
/// Queries the device_impl cache to either return a shared_ptr
153149
/// for the device_impl corresponding to the PiDevice or add
@@ -193,9 +189,7 @@ class platform_impl {
193189
getPlatformFromPiDevice(RT::PiDevice PiDevice, const plugin &Plugin);
194190

195191
private:
196-
std::shared_ptr<device_impl>
197-
getDeviceImplHelper(RT::PiDevice PiDevice,
198-
const std::shared_ptr<platform_impl> &PlatformImpl);
192+
std::shared_ptr<device_impl> getDeviceImplHelper(RT::PiDevice PiDevice);
199193

200194
bool MHostPlatform = false;
201195
RT::PiPlatform MPlatform = 0;

sycl/source/detail/usm/usm_impl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,7 @@ device get_pointer_device(const void *Ptr, const context &Ctxt) {
598598
// member's descendant instead. Fetch the corresponding device from the cache.
599599
std::shared_ptr<detail::platform_impl> PltImpl = CtxImpl->getPlatformImpl();
600600
std::shared_ptr<detail::device_impl> DevImpl =
601-
PltImpl->getDeviceImpl(DeviceId, PltImpl);
601+
PltImpl->getDeviceImpl(DeviceId);
602602
if (DevImpl)
603603
return detail::createSyclObjFromImpl<device>(DevImpl);
604604
throw runtime_error("Cannot find device associated with USM allocation!",

0 commit comments

Comments
 (0)