From 045473bd529d4433f07ed6cc0c6242bb02f91901 Mon Sep 17 00:00:00 2001 From: foreman Date: Thu, 4 Jan 2018 15:54:19 -0500 Subject: [PATCH] P4 to Git Change 1500078 by gandryey@gera-w8 on 2018/01/04 15:38:35 SWDEV-79445 - OCL generic changes and code clean-up - Correct the order of created subdevices Affected files ... ... //depot/stg/opencl/drivers/opencl/runtime/device/cpu/cpudevice.cpp#282 edit [ROCm/clr commit: 884e05c7933e5f7333f6d8d2247b92f44c2c489c] --- projects/clr/rocclr/runtime/device/cpu/cpudevice.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/clr/rocclr/runtime/device/cpu/cpudevice.cpp b/projects/clr/rocclr/runtime/device/cpu/cpudevice.cpp index 1c91d24ff6..15ebad1c78 100644 --- a/projects/clr/rocclr/runtime/device/cpu/cpudevice.cpp +++ b/projects/clr/rocclr/runtime/device/cpu/cpudevice.cpp @@ -617,13 +617,13 @@ cl_int Device::partitionByCounts(const device::CreateSubDevicesInfo& create_info return CL_INVALID_VALUE; } uint coreId = (uint)-1; - while (numSubDevices-- > 0) { + for (uint subDev = 0; subDev < numSubDevices; ++subDev) { Device* device = new Device(this); if (device == NULL) { return CL_OUT_OF_HOST_MEMORY; } - cl_uint subComputeUnits = create_info.countsListAt((size_t)numSubDevices); + cl_uint subComputeUnits = create_info.countsListAt((size_t)subDev); if (!device->create() || !device->initSubDevice(info_, subComputeUnits, create_info)) { device->release(); return CL_OUT_OF_HOST_MEMORY;