P4 to Git Change 1115252 by skudchad@skudchad_test_win_opencl2 on 2015/01/26 12:25:46

EPR #403782 - IOMMU2/SVM
	- Detect SVM Fine Grain system in IOL and OpenCL runtime
	- Changes to convey Allocation attribute to IOL

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

Affected files ...

... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuresource.cpp#203 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuresource.hpp#78 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuscsi.cpp#31 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpusettings.cpp#299 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpusettings.hpp#89 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gslbe/src/include/cal/cal.h#31 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gslbe/src/include/cal/calcl.h#31 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gslbe/src/rt/GSLDevice.cpp#104 edit
Этот коммит содержится в:
foreman
2015-01-26 12:53:29 -05:00
родитель cc54e51cfb
Коммит 172266c1ba
8 изменённых файлов: 23 добавлений и 7 удалений
+10
Просмотреть файл
@@ -406,6 +406,7 @@ Resource::create(MemoryType memType, CreateParams* params, bool heap)
// Fall through ...
case RemoteUSWC:
case Remote:
case Shader:
case BusAddressable:
case ExternalPhysical:
// Fall through to process the memory allocation ...
@@ -437,6 +438,15 @@ Resource::create(MemoryType memType, CreateParams* params, bool heap)
else if (memoryType() == RemoteUSWC) {
desc.type = GSL_MOA_MEMORY_AGP;
}
else if (memoryType() == Shader){
if(dev().settings().svmFineGrainSystem_) {
desc.isAllocExecute = true;
}
// force to use remote memory for HW DEBUG or use
// local memory once we determine if FGS is supported
memType = (!dev().settings().enableHwDebug_) ? Local : RemoteUSWC;
cal_.type_ = memType;
}
else if (memoryType() == BusAddressable){
desc.type = GSL_MOA_MEMORY_CARD_BUS_ADDRESSABLE;
}
+2 -1
Просмотреть файл
@@ -137,7 +137,8 @@ public:
BusAddressable, //!< resource is a bus addressable memory
ExternalPhysical, //!< resource is an external physical memory
D3D9Interop, //!< resource is a D3D9 memory object
Scratch //!< resource is scratch memory
Scratch, //!< resource is scratch memory
Shader, //!< resource is a shader
};
//! Resource map flags
+1 -4
Просмотреть файл
@@ -175,11 +175,8 @@ HSAILKernel::aqlCreateHWInfo(const void* shader, size_t shaderSize)
codeSize_ = codeEndAddress - codeStartAddress;
code_ = new gpu::Memory(dev(), amd::alignUp(codeSize_, gpu::ConstBuffer::VectorSize));
// force to use remote memory for HW DEBUG
Resource::MemoryType resMemType = (!dev().settings().enableHwDebug_) ? Resource::Local : Resource::RemoteUSWC;
// Initialize kernel ISA code
if ((code_ != NULL) && code_->create(resMemType)) {
if ((code_ != NULL) && code_->create(Resource::Shader)) {
address cpuCodePtr = static_cast<address>(code_->map(NULL, Resource::WriteOnly));
// Copy only amd_kernel_code_t
memcpy(cpuCodePtr, codeStartAddress, codeSize_);
+2
Просмотреть файл
@@ -424,6 +424,8 @@ Settings::create(
svmAtomics_ = true;
}
svmFineGrainSystem_ = calAttr.isSVMFineGrainSystem;
// Enable some platform extensions
enableExtension(ClAmdDeviceAttributeQuery);
+2 -1
Просмотреть файл
@@ -69,11 +69,12 @@ public:
uint hsail_: 1; //!< Enables HSAIL compilation
uint stagingWritePersistent_: 1; //!< Enables persistent writes
uint svmAtomics_: 1; //!< SVM device atomics
uint svmFineGrainSystem_: 1; //!< SVM fine grain system support
uint apuSystem_: 1; //!< Device is APU system with shared memory
uint asyncMemCopy_: 1; //!< Use async memory transfers
uint hsailDirectSRD_: 1; //!< Controls direct SRD for HSAIL
uint useDeviceQueue_: 1; //!< Submit to separate device queue
uint reserved_: 2;
uint reserved_: 1;
};
uint value_;
};
+2 -1
Просмотреть файл
@@ -239,7 +239,8 @@ typedef struct CALdeviceattribsRec {
CALuint64 vaEnd; /**< VA end address */
bool isWorkstation; /**< Whether Device is a Workstation/Server part */
CALuint numOfVpu; /**< number of vpu in the device*/
bool isOpenCL200Device; /**< the flag to mark if the device is OpenCL 200*/
bool isOpenCL200Device; /**< the flag to mark if the device is OpenCL 200 */
bool isSVMFineGrainSystem; /**< check if SVM finegrainsystem */
} CALdeviceattribs;
/** CAL device status */
+1
Просмотреть файл
@@ -146,6 +146,7 @@ typedef struct CALresourceDescRec {
mcaddr vaBase;
gslMemObjectAttribSection section;
CALuint minAlignment;
bool isAllocExecute;
} CALresourceDesc;
typedef enum CALresallocsliceviewflagsRec {
+3
Просмотреть файл
@@ -156,6 +156,7 @@ CALGSLDevice::getAttribs_int(gsl::gsCtx* cs)
m_attribs.vaEnd = static_cast<CALuint64>(m_adp->pAsicInfo->vaEnd);
m_attribs.numOfVpu = m_adp->pAsicInfo->numberOfVPU;
m_attribs.isOpenCL200Device = m_adp->pAsicInfo->bIsOpen2Device;
m_attribs.isSVMFineGrainSystem = m_adp->pAsicInfo->svmFineGrainSystem;
}
void
@@ -733,6 +734,7 @@ CALGSLDevice::resAlloc(const CALresourceDesc* desc) const
attribs.location = desc->type;
attribs.vaBase = desc->vaBase;
attribs.section = desc->section;
attribs.isAllocExecute = desc->isAllocExecute;
attribs.minAlignment = desc->minAlignment;
//!@note GSL asserts with tiled 1D images of any type.
@@ -837,6 +839,7 @@ CALGSLDevice::resAllocView(gslMemObject res, gslResource3D size, CALdomain offse
);
attribs.bytePitch = bytePitch;
attribs.section = res->getAttribs().section;
attribs.isAllocExecute = res->getAttribs().isAllocExecute;
// Need to get the alignment info from hwl.
// Not sure hwl is correct though. Linear aligned 256b, tiled 8kb according to the address library.