P4 to Git Change 1338972 by scharupa@scharupa_temp on 2016/11/09 16:33:58

SWDEV-95488 - Limiting max cap Context on ROCm, it is limited to 100

Affected files ...

... //depot/stg/opencl/drivers/opencl/runtime/device/device.cpp#204 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/device.hpp#279 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocdevice.cpp#25 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocdevice.hpp#7 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocsettings.cpp#6 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocvirtual.cpp#16 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocvirtual.hpp#4 edit
Этот коммит содержится в:
foreman
2016-11-09 17:07:33 -05:00
родитель 621f70b372
Коммит 2d64dbab44
7 изменённых файлов: 28 добавлений и 2 удалений
+2
Просмотреть файл
@@ -628,6 +628,8 @@ Settings::Settings()
waitCommand_ = AMD_OCL_WAIT_COMMAND;
supportDepthsRGB_ = false;
enableHwDebug_ = false;
commandQueues_ = 200; //!< Field value set to maximum number
//!< concurrent Virtual GPUs for default
}
bool
+2
Просмотреть файл
@@ -594,6 +594,8 @@ public:
uint value_;
};
uint commandQueues_; //!< Field value for maximum number
//!< concurrent Virtual GPUs for each backend
//! Default constructor
Settings();
+1
Просмотреть файл
@@ -186,6 +186,7 @@ Device::Device(hsa_agent_t bkendDevice)
, alloc_granularity_(0)
, context_(nullptr)
, xferQueue_(nullptr)
, numOfVgpus_(0)
{
group_segment_.handle = 0;
system_segment_.handle = 0;
+2
Просмотреть файл
@@ -221,6 +221,8 @@ public:
static bool loadHsaModules();
amd::Atomic<uint> numOfVgpus_; //!< Virtual gpu unique index
bool create();
//! Construct a new physical HSA device
+7
Просмотреть файл
@@ -52,6 +52,8 @@ Settings::Settings()
partialDispatch = getenv("OPENCL_DISABLE_PARTIAL_DISPATCH");
enablePartialDispatch_ = (partialDispatch) ? false : true;
partialDispatch_ = (partialDispatch) ? false : true;
commandQueues_ = 100 //!< Field value set to maximum number
//!< concurrent Virtual GPUs for ROCm backend
}
bool
@@ -97,6 +99,11 @@ Settings::create(bool doublePrecision)
void
Settings::override()
{
if (!flagIsDefault(GPU_MAX_COMMAND_QUEUES)) {
commandQueues_ = GPU_MAX_COMMAND_QUEUES;
}
}
}
} // namespace roc
+8
Просмотреть файл
@@ -450,6 +450,8 @@ bool VirtualGPU::releaseGpuMemoryFence() {
VirtualGPU::VirtualGPU(Device &device)
: device::VirtualDevice(device)
, roc_device_(device)
, index_(device_.numOfVgpus_++) // Virtual gpu unique index incrementing
, gpuDevice_(device)
{
gpu_device_ = device.getBackendDevice();
// Initialize the last signal and dispatch flags
@@ -477,6 +479,7 @@ VirtualGPU::~VirtualGPU()
}
tools_lib_ = NULL;
--gpuDevice_.numOfVgpus_; // Virtual gpu unique index decrementing
}
bool
@@ -494,6 +497,11 @@ VirtualGPU::create(bool profilingEna)
tools_lib_ = amd::Os::loadLibrary(tools_lib_name);
}
// Checking Virtual gpu unique index for ROCm backend
if (index() > device().settings().commandQueues_) {
return false;
}
uint32_t queue_max_packets = 0;
if (HSA_STATUS_SUCCESS !=
hsa_agent_get_info(
+6 -2
Просмотреть файл
@@ -193,7 +193,10 @@ public:
bool processMemObjects(
const amd::Kernel& kernel, //!< AMD kernel object for execution
const_address params //!< Pointer to the param's store
);
);
//Retun the virtual gpu unique index
uint index() const { return index_; }
// } roc OpenCL integration
private:
@@ -244,7 +247,8 @@ private:
uint kernarg_pool_cur_offset_;
std::vector<ProfilingSignal> signal_pool_; //!< Pool of signals for profiling
Device& gpuDevice_; //!< Roc device obj
const uint index_; //!< Virtual gpu unique index
friend class Timestamp;
};
}