P4 to Git Change 1607329 by jatang@jatang_win_pal_lc on 2018/09/18 10:34:41

SWDEV-148809 - Device Enqueue on LC/PAL.

Affected files ...

... //depot/stg/opencl/drivers/opencl/runtime/device/devkernel.cpp#7 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/paldevice.cpp#109 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palkernel.cpp#66 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palprogram.cpp#71 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palprogram.hpp#28 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palvirtual.cpp#124 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palvirtual.hpp#55 edit
This commit is contained in:
foreman
2018-09-18 10:42:05 -04:00
parent d635cbae60
commit 41facdb089
7 changed files with 55 additions and 23 deletions
+11 -2
View File
@@ -2179,15 +2179,24 @@ bool Device::createBlitProgram() {
// Delayed compilation due to brig_loader memory allocation
const char* scheduler = nullptr;
const char* ocl20 = nullptr;
#if !defined(WITH_LIGHTNING_COMPILER)
std::string sch = SchedulerSourceCode;
if (settings().oclVersion_ >= OpenCL20) {
size_t loc = sch.find("%s");
sch.replace(loc, 2, iDev()->GetDispatchKernelSource());
#if defined(WITH_LIGHTNING_COMPILER)
// For LC, replace "amd_scheduler" with "amd_scheduler_pal"
static const char AmdScheduler[] = "amd_scheduler";
static const char AmdSchedulerPal[] = "amd_scheduler_pal";
loc = sch.find(AmdScheduler);
sch.replace(loc, strlen(AmdScheduler), AmdSchedulerPal);
loc = sch.find(AmdScheduler, (loc + strlen(AmdSchedulerPal)));
sch.replace(loc, strlen(AmdScheduler), AmdSchedulerPal);
#endif
scheduler = sch.c_str();
ocl20 = "-cl-std=CL2.0";
}
#endif // !defined(WITH_LIGHTNING_COMPILER)
blitProgram_ = new BlitProgram(context_);
// Create blit programs
if (blitProgram_ == nullptr || !blitProgram_->create(this, scheduler, ocl20)) {