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
Этот коммит содержится в:
1 родитель
320062f843
Коммит
3683b3d03c
3 files changed
+9
-6
No files matched your search
@@ -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) {
|
||||
|
||||
@@ -260,7 +260,7 @@ bool Settings::create(const Pal::DeviceProperties& palProp,
|
||||
? XCONCAT(OpenCL, XCONCAT(OPENCL_MAJOR, OPENCL_MINOR))
|
||||
: OpenCL12;
|
||||
}
|
||||
if ((OPENCL_VERSION < 200) || IS_LINUX) {
|
||||
if (OPENCL_VERSION < 200) {
|
||||
oclVersion_ = OpenCL12;
|
||||
}
|
||||
numComputeRings_ = 8;
|
||||
|
||||
@@ -75,7 +75,7 @@ Memory::Memory(Context& context, Type type, Flags flags, size_t size, void* svmP
|
||||
forceSysMemAlloc_(false),
|
||||
mapCount_(0),
|
||||
svmHostAddress_(svmPtr),
|
||||
svmPtrCommited_(false),
|
||||
svmPtrCommited_(flags & CL_MEM_SVM_FINE_GRAIN_BUFFER ? true : false),
|
||||
canBeCached_(true),
|
||||
lockMemoryOps_("Memory Ops Lock", true) {}
|
||||
|
||||
|
||||
Reference in new issue
Block a user