P4 to Git Change 2049201 by skudchad@skudchad_test2_win_opencl on 2019/12/20 11:44:13
SWDEV-216708 - [hipclang-vdi-rocm][FBA-77]hipGetDeviceCount() query should not trigger any queue creation.
- KFD queues get created when we call hsa_executable_load_agent_code_object when creating a blitProgram at init. Delay blit creation until when needed
- Queue also gets created when we init a xferQueue. Delay that too until when needed.
If we want to have a lite init, there are multiple changes needed in both OpenCL and HIP. Thats rather a feature to work on later.
ReviewBoardURL = http://ocltc.amd.com/reviews/r/18416/diff/
Affected files ...
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocblit.cpp#34 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocdevice.cpp#148 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocdevice.hpp#47 edit
[ROCm/clr commit: 1384e82e60]
Cette révision appartient à :
@@ -733,7 +733,9 @@ bool KernelBlitManager::create(amd::Device& device) {
|
||||
|
||||
bool KernelBlitManager::createProgram(Device& device) {
|
||||
if (device.blitProgram() == nullptr) {
|
||||
return false;
|
||||
if (!device.createBlitProgram()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<amd::Device*> devices;
|
||||
|
||||
@@ -656,18 +656,6 @@ bool Device::create(bool sramEccEnabled) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const char* scheduler = nullptr;
|
||||
|
||||
#if defined(USE_COMGR_LIBRARY)
|
||||
std::string sch = SchedulerSourceCode;
|
||||
if (settings().useLightning_) {
|
||||
if (info().cooperativeGroups_) {
|
||||
sch.append(GwsInitSourceCode);
|
||||
}
|
||||
scheduler = sch.c_str();
|
||||
}
|
||||
#endif // USE_COMGR_LIBRARY
|
||||
|
||||
amd::Context::Info info = {0};
|
||||
std::vector<amd::Device*> devices;
|
||||
devices.push_back(this);
|
||||
@@ -678,15 +666,6 @@ bool Device::create(bool sramEccEnabled) {
|
||||
return false;
|
||||
}
|
||||
|
||||
blitProgram_ = new BlitProgram(context_);
|
||||
// Create blit programs
|
||||
if (blitProgram_ == nullptr || !blitProgram_->create(this, scheduler)) {
|
||||
delete blitProgram_;
|
||||
blitProgram_ = nullptr;
|
||||
LogError("Couldn't create blit kernels!");
|
||||
return false;
|
||||
}
|
||||
|
||||
mapCacheOps_ = new amd::Monitor("Map Cache Lock", true);
|
||||
if (nullptr == mapCacheOps_) {
|
||||
return false;
|
||||
@@ -757,8 +736,6 @@ bool Device::create(bool sramEccEnabled) {
|
||||
}
|
||||
}
|
||||
|
||||
xferQueue();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -809,6 +786,32 @@ void Device::ReleaseExclusiveGpuAccess(VirtualGPU& vgpu) const {
|
||||
vgpusAccess().unlock();
|
||||
}
|
||||
|
||||
bool Device::createBlitProgram() {
|
||||
bool result = true;
|
||||
const char* scheduler = nullptr;
|
||||
|
||||
#if defined(USE_COMGR_LIBRARY)
|
||||
std::string sch = SchedulerSourceCode;
|
||||
if (settings().useLightning_) {
|
||||
if (info().cooperativeGroups_) {
|
||||
sch.append(GwsInitSourceCode);
|
||||
}
|
||||
scheduler = sch.c_str();
|
||||
}
|
||||
#endif // USE_COMGR_LIBRARY
|
||||
|
||||
blitProgram_ = new BlitProgram(context_);
|
||||
// Create blit programs
|
||||
if (blitProgram_ == nullptr || !blitProgram_->create(this, scheduler)) {
|
||||
delete blitProgram_;
|
||||
blitProgram_ = nullptr;
|
||||
LogError("Couldn't create blit kernels!");
|
||||
return false;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
device::Program* Device::createProgram(amd::Program& owner, amd::option::Options* options) {
|
||||
device::Program* program;
|
||||
if (settings().useLightning_) {
|
||||
|
||||
@@ -380,6 +380,9 @@ class Device : public NullDevice {
|
||||
|
||||
amd::Context& context() const { return *context_; }
|
||||
|
||||
//! Create internal blit program
|
||||
bool createBlitProgram();
|
||||
|
||||
// Returns AMD GPU Pro interfaces
|
||||
const IProDevice& iPro() const { return *pro_device_; }
|
||||
bool ProEna() const { return pro_ena_; }
|
||||
|
||||
Référencer dans un nouveau ticket
Bloquer un utilisateur