P4 to Git Change 1596023 by skudchad@skudchad_test2_win_opencl on 2018/08/20 18:40:38

SWDEV-145570 - [HIP] Fixes to HIP env var logic

	ReviewBoardURL = http://ocltc.amd.com/reviews/r/15653/diff/

Affected files ...

... //depot/stg/opencl/drivers/opencl/api/hip/hip_device.cpp#16 edit
... //depot/stg/opencl/drivers/opencl/api/hip/hip_internal.hpp#15 edit
... //depot/stg/opencl/drivers/opencl/api/hip/hip_platform.cpp#18 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/device.cpp#225 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/device.hpp#311 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/paldevice.cpp#105 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocdevice.cpp#96 edit


[ROCm/clr commit: 26954707a4]
このコミットが含まれているのは:
foreman
2018-08-20 18:48:00 -04:00
コミット 5fc5595516
4個のファイルの変更18行の追加46行の削除
+8 -14
ファイルの表示
@@ -406,12 +406,11 @@ bool Device::init() {
std::unordered_map<int, bool> selectedDevices;
bool useDeviceList = false;
if ((GPU_DEVICE_ORDINAL != '\0') || (HIP_VISIBLE_DEVICES[0] != '\0')
|| (CUDA_VISIBLE_DEVICES != '\0')) {
std::string ordinals = IS_HIP ? ((HIP_VISIBLE_DEVICES[0] != '\0') ?
HIP_VISIBLE_DEVICES : CUDA_VISIBLE_DEVICES)
: GPU_DEVICE_ORDINAL;
if (ordinals[0] != '\0') {
useDeviceList = true;
std::string ordinals = IS_HIP ? ((HIP_VISIBLE_DEVICES[0] != '\0') ?
HIP_VISIBLE_DEVICES : CUDA_VISIBLE_DEVICES)
: GPU_DEVICE_ORDINAL;
size_t end, pos = 0;
do {
@@ -421,16 +420,11 @@ bool Device::init() {
if (index < 0 || static_cast<size_t>(index) >= gpu_agents_.size()) {
deviceIdValid = false;
}
// FIXME Allow atleast one valid deviceId so compilation etc doesnt break
// but set validOrdinal_ flag
if (!deviceIdValid && (selectedDevices.size() != 0)) {
// Exit the loop as anything to the right of invalid deviceId
// has to be discarded unless its the first one
break;
}
if (!deviceIdValid && (selectedDevices.size() == 0)) {
Device::setvalidOrdinal(false);
if (!deviceIdValid) {
// Exit the loop as anything to the right of invalid deviceId
// has to be discarded
break;
}
selectedDevices[index] = deviceIdValid;