P4 to Git Change 1776019 by gandryey@gera-w8 on 2019/04/29 14:13:29

SWDEV-79445 - OCL generic changes and code clean-up
	- Remove GPU_DEVICE_NAME support

Affected files ...

... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpudevice.cpp#605 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/paldevice.cpp#131 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocdevice.cpp#125 edit
... //depot/stg/opencl/drivers/opencl/runtime/utils/flags.hpp#305 edit


[ROCm/clr commit: 5f99d6ed66]
This commit is contained in:
foreman
2019-04-29 14:30:36 -04:00
förälder 5c11478b66
incheckning c1cd5b9e43
4 ändrade filer med 6 tillägg och 20 borttagningar
@@ -1216,25 +1216,21 @@ bool Device::init() {
// Count up all the devices in the system.
numDevices = gsAdaptor::enumerateAdaptors();
CALuint ordinal = 0;
const char* selectDeviceByName = NULL;
if (!flagIsDefault(GPU_DEVICE_ORDINAL)) {
useDeviceList = true;
parseRequestedDeviceList(requestedDevices);
} else if (!flagIsDefault(GPU_DEVICE_NAME)) {
selectDeviceByName = GPU_DEVICE_NAME;
}
// Loop through all active devices and initialize the device info structure
for (; ordinal < numDevices; ++ordinal) {
for (CALuint ordinal = 0; ordinal < numDevices; ++ordinal) {
// Create the GPU device object
Device* d = new Device();
bool result = (NULL != d) && d->create(ordinal, numDevices);
if (useDeviceList) {
result &= (requestedDevices.find(ordinal) != requestedDevices.end());
}
if (result && ((NULL == selectDeviceByName) || ('\0' == selectDeviceByName[0]) ||
(strstr(selectDeviceByName, d->info().name_) != NULL))) {
if (result) {
d->registerDevice();
} else {
delete d;
@@ -1310,8 +1310,6 @@ bool Device::init() {
// Count up all the devices in the system.
platform_->EnumerateDevices(&gNumDevices, &gDeviceList[0]);
uint ordinal = 0;
const char* selectDeviceByName = nullptr;
const char* requestedDeviceList = amd::IS_HIP ? ((HIP_VISIBLE_DEVICES[0] != '\0') ?
HIP_VISIBLE_DEVICES : CUDA_VISIBLE_DEVICES)
: GPU_DEVICE_ORDINAL;
@@ -1319,14 +1317,12 @@ bool Device::init() {
if (requestedDeviceList[0] != '\0') {
useDeviceList = true;
parseRequestedDeviceList(requestedDeviceList, requestedDevices, gNumDevices);
} else if (GPU_DEVICE_NAME[0] != '\0') {
selectDeviceByName = GPU_DEVICE_NAME;
}
bool foundDevice = false;
// Loop through all active devices and initialize the device info structure
for (; ordinal < gNumDevices; ++ordinal) {
for (uint ordinal = 0; ordinal < gNumDevices; ++ordinal) {
bool result = true;
if (useDeviceList) {
result = (requestedDevices.find(ordinal) != requestedDevices.end());
@@ -1335,8 +1331,7 @@ bool Device::init() {
Device* d = new Device();
result = result && (nullptr != d) && d->create(gDeviceList[ordinal]);
if (result && ((nullptr == selectDeviceByName) || ('\0' == selectDeviceByName[0]) ||
(strstr(selectDeviceByName, d->info().name_) != nullptr))) {
if (result) {
foundDevice = true;
d->registerDevice();
} else {
@@ -560,11 +560,8 @@ bool Device::init() {
}
}
if (!useDeviceList && (flagIsDefault(GPU_DEVICE_NAME) || GPU_DEVICE_NAME == 0
|| GPU_DEVICE_NAME[0] == '\0' || !strcmp(GPU_DEVICE_NAME, roc_device->info_.name_))) {
roc_device.release()->registerDevice();
} else if (useDeviceList && selectedDevices[ordinal++]) {
roc_device.release()->registerDevice();
if (!useDeviceList || selectedDevices[ordinal++]) {
roc_device.release()->registerDevice();
}
}
@@ -38,8 +38,6 @@ debug(size_t, PARAMETERS_MIN_ALIGNMENT, 16, \
"Minimum alignment required for the abstract parameters stack") \
debug(size_t, MEMOBJ_BASE_ADDR_ALIGN, 4*Ki, \
"Alignment of the base address of any allocate memory object") \
release(cstring, GPU_DEVICE_NAME, "", \
"Select the device ordinal (will only report a single device)") \
release(cstring, GPU_DEVICE_ORDINAL, "", \
"Select the device ordinal (comma seperated list of available devices)") \
release(bool, REMOTE_ALLOC, false, \