Skip to content

Commit ef3b05f

Browse files
committed
[SYCL] Get the device vector by reference
Eliminate the device_impl shared_ptr copy by getting the device vector by reference.
1 parent c410b9a commit ef3b05f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

sycl/source/detail/program_manager/program_manager.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,13 +121,14 @@ static bool isDeviceBinaryTypeSupported(const context &C,
121121
if (Format != SYCL_DEVICE_BINARY_TYPE_SPIRV)
122122
return true;
123123

124-
const backend ContextBackend = detail::getSyclObjImpl(C)->getBackend();
124+
const ContextImplPtr &ContextImpl = detail::getSyclObjImpl(C);
125+
const backend ContextBackend = ContextImpl->getBackend();
125126

126127
// The CUDA backend cannot use SPIR-V
127128
if (ContextBackend == backend::ext_oneapi_cuda)
128129
return false;
129130

130-
std::vector<device> Devices = C.get_devices();
131+
const std::vector<device> &Devices = ContextImpl->getDevices();
131132

132133
// Program type is SPIR-V, so we need a device compiler to do JIT.
133134
for (const device &D : Devices) {

0 commit comments

Comments
 (0)