P4 to Git Change 1528884 by vsytchen@vsytchen-ocl-win10 on 2018/03/19 11:36:48

SWDEV-133818 - PAL support for Linux Pro: Coarse Grain SVM for OpenCL 2.0

	1. This change enables OCL 2.0 on Linux for devices using PAL backend.
	2. Set the alignment for Coarse Grain SVM allocations to be the gpu fragment size (2MB on Linux).

	ReviewBoardURL = http://ocltc.amd.com/reviews/r/14437/diff/

Affected files ...

... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palresource.cpp#52 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palsettings.cpp#46 edit
... //depot/stg/opencl/drivers/opencl/runtime/platform/memory.cpp#128 edit
Bu işleme şunda yer alıyor:
foreman
2018-03-19 11:55:32 -04:00
ebeveyn 320062f843
işleme 3683b3d03c
3 değiştirilmiş dosya ile 9 ekleme ve 6 silme
+7 -4
Dosyayı Görüntüle
@@ -982,12 +982,15 @@ bool Resource::CreatePinned(CreateParams* params)
// ================================================================================================
bool Resource::CreateSvm(CreateParams* params, Pal::gpusize svmPtr)
{
size_t allocSize = amd::alignUp(desc().width_ * elementSize_, MaxGpuAlignment);
if ((memoryType() == RemoteUSWC) || (memoryType() == Remote)) {
const bool isFineGrain = (memoryType() == RemoteUSWC) || (memoryType() == Remote);
const Pal::gpusize svmAlignment = isFineGrain ? MaxGpuAlignment :
dev().properties().gpuMemoryProperties.fragmentSize;
size_t allocSize = amd::alignUp(desc().width_ * elementSize_, svmAlignment);
if (isFineGrain) {
Pal::SvmGpuMemoryCreateInfo createInfo = {};
createInfo.isUsedForKernel = desc_.isAllocExecute_;
createInfo.size = allocSize;
createInfo.alignment = MaxGpuAlignment;
createInfo.alignment = svmAlignment;
if (svmPtr != 0) {
createInfo.flags.useReservedGpuVa = true;
createInfo.pReservedGpuVaOwner = params->svmBase_->iMem();
@@ -1001,7 +1004,7 @@ bool Resource::CreateSvm(CreateParams* params, Pal::gpusize svmPtr)
else {
Pal::GpuMemoryCreateInfo createInfo = {};
createInfo.size = allocSize;
createInfo.alignment = MaxGpuAlignment;
createInfo.alignment = svmAlignment;
createInfo.vaRange = Pal::VaRange::Svm;
createInfo.priority = Pal::GpuMemPriority::Normal;
if (svmPtr != 0) {