P4 to Git Change 1160575 by gandryey@gera-dev-w7 on 2015/06/11 18:31:59

ECR #304775 - Real time queue support
	- Add the new interface for the real time queue creation

Affected files ...

... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_command.cpp#10 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_device.cpp#58 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/cpu/cpudevice.hpp#90 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/device.hpp#246 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpudevice.cpp#511 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpudevice.hpp#144 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/hsa/hsadevice.cpp#91 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/hsa/hsadevice.hpp#48 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/hsa_foundation/hsadevice.cpp#33 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/hsa_foundation/hsadevice.hpp#14 edit
... //depot/stg/opencl/drivers/opencl/runtime/platform/commandqueue.cpp#20 edit
... //depot/stg/opencl/drivers/opencl/runtime/platform/commandqueue.hpp#15 edit


[ROCm/clr commit: e919691665]
This commit is contained in:
foreman
2015-06-11 19:17:47 -04:00
bovenliggende 05a44262bc
commit 97fbdd7f58
8 gewijzigde bestanden met toevoegingen van 57 en 77 verwijderingen
@@ -71,12 +71,7 @@ public:
//! Instantiate a new virtual device
virtual device::VirtualDevice* createVirtualDevice(
bool profiling,
bool interopQueue
#if cl_amd_open_video
, void* calVideoProperties = NULL
#endif // cl_amd_open_video
, uint deviceQueueSize = 0
amd::CommandQueue* queue = NULL
)
{
VirtualCPU* virtualCpu = new VirtualCPU(*this);
@@ -550,6 +550,10 @@ struct Info : public amd::EmbeddedObject
cl_uint gfxipVersion_;
//! Number of available async queues
cl_uint numAsyncQueues_;
//! Number of available real time queues
cl_uint numRTQueues_;
//! Number of available real time compute units
cl_uint numRTCUs_;
//! Thread trace enable
cl_bool threadTraceEnable_;
@@ -1577,12 +1581,7 @@ public:
//! Create a new virtual device environment.
virtual device::VirtualDevice* createVirtualDevice(
bool profiling,
bool interopQueue
#if cl_amd_open_video
, void* calVideoProperties = NULL
#endif // cl_amd_open_video
, uint deviceQueueSize = 0
CommandQueue* queue = NULL
) = 0;
//! Compile the given source code.
@@ -543,6 +543,8 @@ void NullDevice::fillDeviceInfo(
info_.localMemBanks_ = hwInfo()->localMemBanks_;
info_.gfxipVersion_ = hwInfo()->gfxipVersion_;
info_.numAsyncQueues_ = numComputeRings;
info_.numRTQueues_ = 2;
info_.numRTCUs_ = 4;
info_.threadTraceEnable_ = settings().threadTraceEnable_;
}
}
@@ -1091,14 +1093,31 @@ Device::initializeHeapResources()
device::VirtualDevice*
Device::createVirtualDevice(
bool profiling,
bool interopQueue
#if cl_amd_open_video
, void* calVideoProperties
#endif // cl_amd_open_video
, uint deviceQueueSize
amd::CommandQueue* queue
)
{
bool profiling = false;
bool interopQueue = false;
uint rtCUs = 0;
uint deviceQueueSize = 0;
#if cl_amd_open_video
void* calVideoProperties = NULL;
#endif // cl_amd_open_video
if (queue != NULL) {
profiling = queue->properties().test(CL_QUEUE_PROFILING_ENABLE);
if (queue->asHostQueue() != NULL) {
interopQueue = (0 != (queue->context().info().flags_ &
(amd::Context::GLDeviceKhr |
amd::Context::D3D10DeviceKhr |
amd::Context::D3D11DeviceKhr)));
rtCUs = queue->rtCUs();
}
else if (queue->asDeviceQueue() != NULL) {
deviceQueueSize = queue->asDeviceQueue()->size();
}
}
// Not safe to add a queue. So lock the device
amd::ScopedLock k(lockAsyncOps());
amd::ScopedLock lock(vgpusAccess());
@@ -63,12 +63,7 @@ public:
//! Instantiate a new virtual device
virtual device::VirtualDevice* createVirtualDevice(
bool profiling,
bool interopQueue
#if cl_amd_open_video
, void* calVideoProperties = NULL
#endif // cl_amd_open_video
, uint deviceQueueSize = 0
amd::CommandQueue* queue = NULL
) { return NULL; }
//! Compile the given source code.
@@ -394,12 +389,7 @@ public:
//! Instantiate a new virtual device
device::VirtualDevice* createVirtualDevice(
bool profiling,
bool interopQueue
#if cl_amd_open_video
, void* calVideoProperties = NULL
#endif // cl_amd_open_video
, uint deviceQueueSize = 0
amd::CommandQueue* queue = NULL
);
//! Memory allocation
@@ -648,15 +648,14 @@ Device::populateOCLDeviceConstants()
}
device::VirtualDevice*
Device::createVirtualDevice(
bool profiling,
bool interopQueue
#if cl_amd_open_video
, void *calVideoProperties
#endif
, uint deviceQueueSize
)
Device::createVirtualDevice(amd::CommandQueue* queue)
{
bool interopQueue = (queue != NULL) &&
(0 != (queue->context().info().flags_ &
(amd::Context::GLDeviceKhr |
amd::Context::D3D10DeviceKhr |
amd::Context::D3D11DeviceKhr)));
// Initialization of heap and other resources occur during the command
// queue creation time.
HsaQueueType type = kHsaQueueTypeCompute;
@@ -884,7 +883,7 @@ Device::xferQueue() const
// Create virtual device for internal memory transfer
Device* thisDevice = const_cast<Device*>(this);
thisDevice->xferQueue_ = reinterpret_cast<VirtualGPU*>(
thisDevice->createVirtualDevice(false, false));
thisDevice->createVirtualDevice());
if (!xferQueue_) {
LogError("Couldn't create the device transfer manager!");
}
@@ -100,16 +100,7 @@ public:
//! Create a new virtual device environment.
virtual device::VirtualDevice* createVirtualDevice(
bool profiling,
bool interopQueue
#if cl_amd_open_video
, void* calVideoProperties = NULL
#endif // cl_amd_open_video
, uint deviceQueueSize = 0
) {
ShouldNotReachHere();
return NULL;
};
amd::CommandQueue* queue = NULL) { return NULL; }
virtual bool registerSvmMemory(void* ptr, size_t size) const {
ShouldNotReachHere();
@@ -252,12 +243,8 @@ public:
//! Instantiate a new virtual device
virtual device::VirtualDevice *createVirtualDevice(
bool profiling, bool interopQueue
#if cl_amd_open_video
, void *calVideoProperties = NULL
#endif // cl_amd_open_vide
, uint deviceQueueSize = 0
);
amd::CommandQueue* queue = NULL);
//! Construct an HSAIL program object from the ELF assuming it is valid
virtual device::Program *createProgram(int oclVer = 120);