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
Этот коммит содержится в:
foreman
2018-08-20 18:48:00 -04:00
родитель f61e9b7c12
Коммит 188c4e9bd7
3 изменённых файлов: 7 добавлений и 7 удалений
+1 -3
Просмотреть файл
@@ -96,10 +96,8 @@ hipError_t ihipDeviceGetCount(int* count) {
return hipErrorInvalidValue;
}
auto* deviceHandle = g_devices[0]->devices()[0];
// Get all available devices
*count = deviceHandle->isOrdinalValid() ? g_devices.size() : 0;
*count = g_devices.size();
return hipSuccess;
}
+3 -4
Просмотреть файл
@@ -29,10 +29,9 @@ THE SOFTWARE.
#include <stack>
#define HIP_INIT() \
std::call_once(hip::g_ihipInitialized, hip::init); \
assert(g_devices.size() > 0); \
if (hip::g_context == nullptr) { \
hip::g_context = g_devices[0]; \
std::call_once(hip::g_ihipInitialized, hip::init); \
if (hip::g_context == nullptr && g_devices.size() > 0) { \
hip::g_context = g_devices[0]; \
}
// This macro should be called at the beginning of every HIP API.
+3
Просмотреть файл
@@ -59,6 +59,9 @@ extern "C" hipModule_t __hipRegisterFatBinary(const void* data)
{
HIP_INIT();
if(g_devices.empty()) {
return nullptr;
}
const __CudaFatBinaryWrapper* fbwrapper = reinterpret_cast<const __CudaFatBinaryWrapper*>(data);
if (fbwrapper->magic != __hipFatMAGIC2 || fbwrapper->version != 1) {
return nullptr;