Skip to content

Commit 340ffa2

Browse files
committed
Use reserve in DPCTLDevice_GetComponentDevices
1 parent 1821b76 commit 340ffa2

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

libsyclinterface/source/dpctl_sycl_device_interface.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -862,6 +862,7 @@ DPCTLDevice_GetComponentDevices(__dpctl_keep const DPCTLSyclDeviceRef DRef)
862862
D->get_info<sycl::ext::oneapi::experimental::info::device::
863863
component_devices>();
864864
ComponentDevicesVectorPtr = new vecTy();
865+
ComponentDevicesVectorPtr->reserve(componentDevices.size());
865866
for (const auto &cd : componentDevices) {
866867
ComponentDevicesVectorPtr->emplace_back(
867868
wrap<device>(new device(cd)));

0 commit comments

Comments
 (0)