P4 to Git Change 1175724 by gandryey@gera-ubuntu14 on 2015/07/30 15:50:59

ECR #304775 - Remove CALdevicestatus

Affected files ...

... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpudevice.cpp#516 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpudevice.hpp#146 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gslbe/src/rt/GSLDevice.cpp#128 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gslbe/src/rt/GSLDevice.h#52 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gslbe/src/rt/backend.h#7 edit


[ROCm/clr commit: 4b97729c2e]
Этот коммит содержится в:
foreman
2015-07-30 16:07:40 -04:00
родитель 4322990c61
Коммит 1d21b8cfb2
5 изменённых файлов: 15 добавлений и 75 удалений
+11 -13
Просмотреть файл
@@ -118,8 +118,8 @@ NullDevice::init()
bool
NullDevice::create(CALtarget target)
{
CALdeviceattribs calAttr = {0};
CALdevicestatus calDevStatus = {0};
CALdeviceattribs calAttr = {0};
gslMemInfo memInfo = {0};
online_ = false;
@@ -168,13 +168,12 @@ NullDevice::create(CALtarget target)
}
// Report 512MB for all offline devices
calDevStatus.availVisibleHeap = 512;
calDevStatus.largestBlockVisibleHeap = 512;
memInfo.cardMemAvailableBytes = 512 * Mi;
memInfo.cardLargestFreeBlockBytes = 512 * Mi;
calAttr.localRAM = 512;
// Fill the device info structure
fillDeviceInfo(calAttr, calDevStatus, 4096, 1, true
);
fillDeviceInfo(calAttr, memInfo, 4096, 1, true);
if (settings().hsail_ || (settings().oclVersion_ == OpenCL20)) {
// Runtime doesn't know what local size could be on the real board
@@ -224,7 +223,7 @@ NullDevice::createProgram(int oclVer)
void NullDevice::fillDeviceInfo(
const CALdeviceattribs& calAttr,
const CALdevicestatus& calStatus,
const gslMemInfo& memInfo,
size_t maxTextureSize,
uint numComputeRings,
bool isVirtualMode
@@ -294,8 +293,7 @@ void NullDevice::fillDeviceInfo(
(static_cast<cl_ulong>(std::min(GPU_MAX_HEAP_SIZE, 100u)) *
// globalMemSize is the actual available size for app on Linux
// Because Linux base driver doesn't support paging
static_cast<cl_ulong>(calStatus.availVisibleHeap +
calStatus.availInvisibleHeap) / 100u) * Mi;
static_cast<cl_ulong>(memInfo.cardMemAvailableBytes + memInfo.cardExtMemAvailableBytes) / 100u);
#else
info_.globalMemSize_ =
(static_cast<cl_ulong>(std::min(GPU_MAX_HEAP_SIZE, 100u)) *
@@ -312,8 +310,8 @@ void NullDevice::fillDeviceInfo(
// start. Note that it may not be a guarantee still as the
// application progresses.
info_.maxMemAllocSize_ = std::max(
cl_ulong(calStatus.largestBlockVisibleHeap * Mi),
cl_ulong(calStatus.largestBlockInvisibleHeap * Mi));
cl_ulong(memInfo.cardLargestFreeBlockBytes),
cl_ulong(memInfo.cardExtLargestFreeBlockBytes));
#if defined(ATI_OS_WIN)
if (settings().apuSystem_) {
@@ -894,7 +892,7 @@ Device::create(CALuint ordinal, CALuint numOfDevices)
}
// Fill the device info structure
fillDeviceInfo(getAttribs(), getStatus(),
fillDeviceInfo(getAttribs(), getMemInfo(),
static_cast<size_t>(getMaxTextureSize()),
engines().numComputeRings(), heap()->isVirtual()
);
@@ -2129,7 +2127,7 @@ Device::globalFreeMemory(size_t* freeMemory) const
}
if (heap()->isVirtual()) {
gslMemInfo memInfo = {0};
getMemInfo(&memInfo);
gslCtx()->getMemInfo(&memInfo, GSL_MEMINFO_BASIC);
// Fill free memory info
freeMemory[TotalFreeMemory] = (memInfo.cardMemAvailableBytes +
+1 -1
Просмотреть файл
@@ -123,7 +123,7 @@ protected:
//! Fills OpenCL device info structure
void fillDeviceInfo(
const CALdeviceattribs& calAttr, //!< CAL device attributes info
const CALdevicestatus& calStatus, //!< CAL device status
const gslMemInfo& memInfo, //!< GSL mem info
size_t maxTextureSize, //!< Maximum texture size supported in HW
uint numComputeRings, //!< Number of compute rings
bool isVirtualMode //!< Device is in virtual mode
+1 -36
Просмотреть файл
@@ -81,12 +81,6 @@ CALGSLDevice::getMaxTextureSize() const
return static_cast<uint32>(m_maxtexturesize);
}
void
CALGSLDevice::getMemInfo(gslMemInfo* memInfo) const
{
m_cs->getMemInfo(memInfo, GSL_MEMINFO_BASIC);
}
void
CALGSLDevice::getAttribs_int(gsl::gsCtx* cs)
{
@@ -157,35 +151,6 @@ CALGSLDevice::getAttribs_int(gsl::gsCtx* cs)
m_attribs.isSVMFineGrainSystem = m_adp->pAsicInfo->svmFineGrainSystem;
}
void
CALGSLDevice::getStatus_int(gsl::gsCtx* cs)
{
m_deviceStatus.struct_size = sizeof(CALdevicestatus);
gslMemInfo memInfo;
cs->getMemInfo(&memInfo, GSL_MEMINFO_BASIC);
m_deviceStatus.availLocalRAM = (uint32)((memInfo.cardMemAvailableBytes + memInfo.cardExtMemAvailableBytes) / (1024 * 1024));
m_deviceStatus.availUncachedRemoteRAM = (uint32)(memInfo.agpMemAvailableBytes / (1024 * 1024));
m_deviceStatus.availCachedRemoteRAM = (uint32)(memInfo.agpMemAvailableCacheableBytes / (1024 * 1024));
m_deviceStatus.availVisibleHeap = (uint32) (memInfo.cardMemAvailableBytes / (1024 * 1024));
m_deviceStatus.availInvisibleHeap = (uint32) (memInfo.cardExtMemAvailableBytes / (1024 * 1024));
m_deviceStatus.availDirectHeap = (uint32) (memInfo.directAvailableBytes / (1024 * 1024));
m_deviceStatus.availCoherentHeap = (uint32) (memInfo.coherentAvailableBytes / (1024 * 1024));
m_deviceStatus.availRemoteSharedHeap = (uint32) (memInfo.sharedAvailableBytes / (1024 * 1024));
m_deviceStatus.availCachedRemoteSharedHeap = (uint32) (memInfo.sharedCacheableAvailableBytes / (1024 * 1024));
m_deviceStatus.largestBlockVisibleHeap = (uint32) (memInfo.cardLargestFreeBlockBytes / (1024 * 1024));
m_deviceStatus.largestBlockInvisibleHeap = (uint32) (memInfo.cardExtLargestFreeBlockBytes / (1024 * 1024));
m_deviceStatus.largestBlockRemoteHeap = (uint32) (memInfo.agpLargestFreeBlockBytes / (1024 * 1024));
m_deviceStatus.largestBlockCachedRemoteHeap = (uint32) (memInfo.agpCacheableLargestFreeBlockBytes / (1024 * 1024));
m_deviceStatus.largestBlockDirectHeap = (uint32) (memInfo.directLargestFreeBlockBytes / (1024 * 1024));
m_deviceStatus.largestBlockCoherentHeap = (uint32) (memInfo.coherentLargestFreeBlockBytes / (1024 * 1024));
m_deviceStatus.largestBlockRemoteSharedHeap = (uint32) (memInfo.sharedLargestFreeBlockBytes / (1024 * 1024));
m_deviceStatus.largestBlockCachedRemoteSharedHeap = (uint32) (memInfo.sharedCacheableLargestFreeBlockBytes / (1024 * 1024));
}
bool
CALGSLDevice::open(uint32 gpuIndex, bool enableHighPerformanceState, bool reportAsOCL12Device)
{
@@ -578,7 +543,7 @@ CALGSLDevice::SetupContext(int32 &asic_id)
//cache device details
getAttribs_int(temp_cs);
getStatus_int(temp_cs);
temp_cs->getMemInfo(&m_memInfo, GSL_MEMINFO_BASIC);
m_vmMode = temp_cs->getVMMode();
+2 -4
Просмотреть файл
@@ -96,8 +96,7 @@ public:
uint32 getMaxTextureSize() const;
const CALdeviceattribs& getAttribs() const { return m_attribs; }
const CALdevicestatus& getStatus() const {return m_deviceStatus; }
void getMemInfo(gslMemInfo* memInfo) const;
const gslMemInfo& getMemInfo() const { return m_memInfo; }
bool isVmMode() const { return m_vmMode; };
@@ -203,11 +202,10 @@ private:
void PerformFullInitialization_int();
void getAttribs_int(gsl::gsCtx* cs);
void getStatus_int(gsl::gsCtx* cs);
bool ResolveAperture(const gslMemObjectAttribTiling tiling) const;
CALdeviceattribs m_attribs;
CALdevicestatus m_deviceStatus;
gslMemInfo m_memInfo;
gslTextureResourceObject m_textureResource;
gslSamplerObject m_textureSampler;
gslEngineID m_forcedComputeEngineID;
-21
Просмотреть файл
@@ -105,27 +105,6 @@ typedef struct CALdeviceattribsRec {
bool isSVMFineGrainSystem; /**< check if SVM finegrainsystem */
} CALdeviceattribs;
/** CAL device status */
typedef struct CALdevicestatusRec {
CALuint struct_size; /**< Client filled out size of CALdevicestatus struct */
CALuint availLocalRAM; /**< Amount of available local GPU RAM in megabytes */
CALuint availUncachedRemoteRAM; /**< Amount of available uncached remote GPU memory in megabytes */
CALuint availCachedRemoteRAM; /**< Amount of available cached remote GPU memory in megabytes */
CALuint availVisibleHeap; /**< Amount of available visible local GPU RAM in megabytes */
CALuint availInvisibleHeap; /**< Amount of available invisible local GPU RAM in megabytes */
CALuint availDirectHeap; /**< Amount of available direct GPU memory in megabytes */
CALuint availCoherentHeap; /**< Amount of available coherent GPU memory in megabytes */
CALuint availRemoteSharedHeap; /**< Amount of available remote Shared GPU memory in megabytes */
CALuint availCachedRemoteSharedHeap; /**< Amount of available cached remote Shared GPU memory in megabytes */
CALuint largestBlockVisibleHeap; /**< Largest block available visible local GPU RAM in megabytes */
CALuint largestBlockInvisibleHeap; /**< Largest block available invisible local GPU RAM in megabytes */
CALuint largestBlockRemoteHeap; /**< Largest block available remote GPU memory in megabytes */
CALuint largestBlockCachedRemoteHeap; /**< Largest block available cached remote GPU memory in megabytes */
CALuint largestBlockDirectHeap; /**< Largest block available direct GPU memory in megabytes */
CALuint largestBlockCoherentHeap; /**< Largest block available coherent GPU memory in megabytes */
CALuint largestBlockRemoteSharedHeap; /**< Largest block available remote Shared GPU memory in megabytes */
CALuint largestBlockCachedRemoteSharedHeap; /**< Largest block available cached remote Shared GPU memory in megabytes */
} CALdevicestatus;
/** CAL resource allocation flags **/
typedef enum CALresallocflagsEnum {