SWDEV-308644 - update blit kernel setup in rocm

Change-Id: Iaa9ff97b3ed7d379189c359696be932a83cf203c
This commit is contained in:
Julia Jiang
2021-11-15 12:02:23 -05:00
bovenliggende 02f36b565b
commit ef3d6f7b28
4 gewijzigde bestanden met toevoegingen van 60 en 20 verwijderingen
+14 -6
Bestand weergeven
@@ -518,6 +518,7 @@ bool Device::init() {
extern const char* SchedulerSourceCode;
extern const char* GwsInitSourceCode;
extern const char* rocBlitLinearSourceCode;
void Device::tearDown() {
NullDevice::tearDown();
@@ -832,21 +833,28 @@ void Device::ReleaseExclusiveGpuAccess(VirtualGPU& vgpu) const {
bool Device::createBlitProgram() {
bool result = true;
const char* scheduler = nullptr;
const char* extraKernel = nullptr;
#if defined(USE_COMGR_LIBRARY)
std::string sch = SchedulerSourceCode;
std::string rocKernel;
if (settings().useLightning_) {
if (info().cooperativeGroups_) {
sch.append(GwsInitSourceCode);
if (amd::IS_HIP) {
rocKernel = rocBlitLinearSourceCode;
if (info().cooperativeGroups_) {
rocKernel.append(GwsInitSourceCode);
}
}
scheduler = sch.c_str();
else {
rocKernel = SchedulerSourceCode;
}
extraKernel = rocKernel.c_str();
}
#endif // USE_COMGR_LIBRARY
blitProgram_ = new BlitProgram(context_);
// Create blit programs
if (blitProgram_ == nullptr || !blitProgram_->create(this, scheduler)) {
if (blitProgram_ == nullptr || !blitProgram_->create(this, extraKernel)) {
delete blitProgram_;
blitProgram_ = nullptr;
LogError("Couldn't create blit kernels!");