P4 to Git Change 1293210 by gandryey@gera-rcf-lnx on 2016/07/19 17:08:07

SWDEV-94640 - [OCL-LC-ROCm] OpenCL Runtime Library Implements OpenCL runtime API. Add HSA virtual device to ORCA.
	- Rename hsa_foundation to ROCm

Affected files ...

... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/build/Makefile.api#133 edit
... //depot/stg/opencl/drivers/opencl/runtime/Makefile#22 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/device.cpp#196 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/device.hpp#275 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/hsa_foundation/Makefile#2 delete
... //depot/stg/opencl/drivers/opencl/runtime/device/hsa_foundation/build/Makefile#2 delete
... //depot/stg/opencl/drivers/opencl/runtime/device/hsa_foundation/build/Makefile.oclhsa#7 delete
... //depot/stg/opencl/drivers/opencl/runtime/device/hsa_foundation/hsaappprofile.cpp#4 delete
... //depot/stg/opencl/drivers/opencl/runtime/device/hsa_foundation/hsaappprofile.hpp#3 delete
... //depot/stg/opencl/drivers/opencl/runtime/device/hsa_foundation/hsabinary.cpp#2 delete
... //depot/stg/opencl/drivers/opencl/runtime/device/hsa_foundation/hsabinary.hpp#3 delete
... //depot/stg/opencl/drivers/opencl/runtime/device/hsa_foundation/hsablit.cpp#17 delete
... //depot/stg/opencl/drivers/opencl/runtime/device/hsa_foundation/hsablit.hpp#5 delete
... //depot/stg/opencl/drivers/opencl/runtime/device/hsa_foundation/hsacompiler.cpp#6 delete
... //depot/stg/opencl/drivers/opencl/runtime/device/hsa_foundation/hsacompilerlib.cpp#3 delete
... //depot/stg/opencl/drivers/opencl/runtime/device/hsa_foundation/hsacompilerlib.hpp#3 delete
... //depot/stg/opencl/drivers/opencl/runtime/device/hsa_foundation/hsadefs.hpp#6 delete
... //depot/stg/opencl/drivers/opencl/runtime/device/hsa_foundation/hsadevice.cpp#65 delete
... //depot/stg/opencl/drivers/opencl/runtime/device/hsa_foundation/hsadevice.hpp#31 delete
... //depot/stg/opencl/drivers/opencl/runtime/device/hsa_foundation/hsaglinterop.cpp#3 delete
... //depot/stg/opencl/drivers/opencl/runtime/device/hsa_foundation/hsaglinterop.hpp#3 delete
... //depot/stg/opencl/drivers/opencl/runtime/device/hsa_foundation/hsakernel.cpp#18 delete
... //depot/stg/opencl/drivers/opencl/runtime/device/hsa_foundation/hsakernel.hpp#12 delete
... //depot/stg/opencl/drivers/opencl/runtime/device/hsa_foundation/hsamemory.cpp#27 delete
... //depot/stg/opencl/drivers/opencl/runtime/device/hsa_foundation/hsamemory.hpp#13 delete
... //depot/stg/opencl/drivers/opencl/runtime/device/hsa_foundation/hsaprintf.cpp#2 delete
... //depot/stg/opencl/drivers/opencl/runtime/device/hsa_foundation/hsaprintf.hpp#2 delete
... //depot/stg/opencl/drivers/opencl/runtime/device/hsa_foundation/hsaprogram.cpp#28 delete
... //depot/stg/opencl/drivers/opencl/runtime/device/hsa_foundation/hsaprogram.hpp#11 delete
... //depot/stg/opencl/drivers/opencl/runtime/device/hsa_foundation/hsaregisters.hpp#2 delete
... //depot/stg/opencl/drivers/opencl/runtime/device/hsa_foundation/hsasettings.cpp#13 delete
... //depot/stg/opencl/drivers/opencl/runtime/device/hsa_foundation/hsasettings.hpp#8 delete
... //depot/stg/opencl/drivers/opencl/runtime/device/hsa_foundation/hsavirtual.cpp#67 delete
... //depot/stg/opencl/drivers/opencl/runtime/device/hsa_foundation/hsavirtual.hpp#28 delete
... //depot/stg/opencl/drivers/opencl/runtime/device/hsa_foundation/mesa_glinterop.h#2 delete
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/Makefile#1 add
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/build/Makefile#1 add
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/build/Makefile.oclrocm#1 add
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/build/wNow64a/Makefile#1 add
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/mesa_glinterop.h#1 add
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocappprofile.cpp#1 add
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocappprofile.hpp#1 add
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocbinary.hpp#1 add
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocblit.cpp#1 add
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocblit.hpp#1 add
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/roccompiler.cpp#1 add
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/roccompilerlib.cpp#1 add
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/roccompilerlib.hpp#1 add
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocdefs.hpp#1 add
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocdevice.cpp#1 add
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocdevice.hpp#1 add
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocglinterop.cpp#1 add
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocglinterop.hpp#1 add
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rockernel.cpp#1 add
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rockernel.hpp#1 add
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocmemory.cpp#1 add
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocmemory.hpp#1 add
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocprintf.cpp#1 add
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocprintf.hpp#1 add
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocprogram.cpp#1 add
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocprogram.hpp#1 add
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocregisters.hpp#1 add
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocsettings.cpp#1 add
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocsettings.hpp#1 add
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocvirtual.cpp#1 add
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocvirtual.hpp#1 add
This commit is contained in:
foreman
2016-07-19 17:42:51 -04:00
parent 55eab0bebd
commit 06056e3adc
29 changed files with 10403 additions and 17 deletions
+16 -16
View File
@@ -7,8 +7,8 @@
#include "thread/monitor.hpp"
#if defined(WITH_HSA_DEVICE)
#include "device/hsa_foundation/hsadevice.hpp"
extern amd::AppProfile* oclhsaCreateAppProfile();
#include "device/rocm/rocdevice.hpp"
extern amd::AppProfile* rocCreateAppProfile();
#endif
#if defined(WITH_CPU_DEVICE)
@@ -65,7 +65,7 @@ bool Device::isGpuDeviceAvailable_ = false;
AppProfile Device::appProfile_;
#if defined(WITH_HSA_DEVICE)
AppProfile* Device::oclhsaAppProfile_ = NULL;
AppProfile* Device::rocAppProfile_ = NULL;
#endif
amd::Monitor SvmManager::AllocatedLock_("Guards SVM allocation list");
@@ -169,22 +169,22 @@ Device::init()
// GPU stack. The order of initialization is signiicant and if changed
// amd::Device::registerDevice() must be accordingly modified.
#if defined(WITH_HSA_DEVICE)
oclhsaAppProfile_ = oclhsaCreateAppProfile();
if (oclhsaAppProfile_ && !oclhsaAppProfile_->IsHsaInitDisabled()) {
// Return value of oclhsa::Device::init()
rocAppProfile_ = rocCreateAppProfile();
if (rocAppProfile_ && !rocAppProfile_->IsHsaInitDisabled()) {
// Return value of roc::Device::init()
// If returned false, error initializing HSA stack.
// If returned true, either HSA not installed or HSA stack
// successfully initialized.
if (!oclhsa::Device::init() ) {
if (!roc::Device::init() ) {
// abort() commentted because this is the only indication
// that KFD is not installed.
// Ignore the failure and assume KFD is not installed.
//abort();
}
ret |= oclhsa::NullDevice::init();
ret |= roc::NullDevice::init();
}
#endif // WITH_HSA_DEVICE
#if defined(WITH_GPU_DEVICE) && !defined(WITH_PAL_DEVICE)
#if defined(WITH_GPU_DEVICE)
ret |= DeviceLoad();
#endif // WITH_GPU_DEVICE
#if defined(WITH_PAL_DEVICE)
@@ -207,13 +207,13 @@ Device::tearDown()
delete devices_;
}
#if defined(WITH_HSA_DEVICE)
if (oclhsaAppProfile_ && !oclhsaAppProfile_->IsHsaInitDisabled()) {
oclhsa::Device::tearDown();
delete oclhsaAppProfile_;
oclhsaAppProfile_ = NULL;
if (rocAppProfile_ && !rocAppProfile_->IsHsaInitDisabled()) {
roc::Device::tearDown();
delete rocAppProfile_;
rocAppProfile_ = NULL;
}
#endif // WITH_HSA_DEVICE
#if defined(WITH_GPU_DEVICE) && !defined(WITH_PAL_DEVICE)
#if defined(WITH_GPU_DEVICE)
DeviceUnload();
#endif // WITH_GPU_DEVICE
#if defined(WITH_PAL_DEVICE)
@@ -481,7 +481,7 @@ Device::getDevices(cl_device_type type, bool offlineDevices)
}
#if defined(WITH_HSA_DEVICE)
type = oclhsaAppProfile_->ApplyHsaDeviceHintFlag(type);
type = rocAppProfile_->ApplyHsaDeviceHintFlag(type);
#endif
// Create the list of available devices
@@ -505,7 +505,7 @@ Device::numDevices(cl_device_type type, bool offlineDevices)
}
#if defined(WITH_HSA_DEVICE)
type = oclhsaAppProfile_->ApplyHsaDeviceHintFlag(type);
type = rocAppProfile_->ApplyHsaDeviceHintFlag(type);
#endif
for (device_iterator it = devices_->begin(); it != devices_->end(); ++it) {