P4 to Git Change 1312342 by rili@rili-opencl-pal-stg on 2016/09/08 13:27:45

SWDEV-101790 -  Cherry-pick CL#1293292 from 16.20.1010
	                            Support DriverStore in OCL

Affected files ...

... //depot/stg/opencl/drivers/opencl/runtime/device/device.hpp#278 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpudevice.cpp#554 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gslbe/src/rt/GSLDevice.cpp#173 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gslbe/src/rt/backend.h#14 edit
Этот коммит содержится в:
foreman
2016-09-08 13:36:56 -04:00
родитель 8764785ce1
Коммит fbb90f4504
4 изменённых файлов: 60 добавлений и 14 удалений
+2
Просмотреть файл
@@ -571,6 +571,8 @@ struct Info : public amd::EmbeddedObject
//! The maximum size of global scope variables
size_t maxGlobalVariableSize_;
size_t globalVariablePreferredTotalSize_;
//! Driver store location
char driverStore_[200];
};
//! Device settings
+53 -14
Просмотреть файл
@@ -178,6 +178,31 @@ NullDevice::create(CALtarget target)
// Fill the device info structure
fillDeviceInfo(calAttr, memInfo, 4096, 1, 0);
if (NULL == compiler_) {
#if !defined(ATI_OS_LINUX)
char CompilerLibrary[220] = "";
strcpy_s(CompilerLibrary, calAttr.driverStore);
strcat_s(CompilerLibrary, "amdocl12cl" LP64_SWITCH("", "64") ".dll");
#endif
const char *library = getenv("COMPILER_LIBRARY");
aclCompilerOptions opts = {
sizeof(aclCompilerOptions_0_8),
#if defined(ATI_OS_LINUX)
library ? library : LINUX_ONLY("lib") "amdocl12cl" \
LP64_SWITCH(LINUX_SWITCH("32",""),"64") LINUX_SWITCH(".so",".dll"),
#else
library ? library : CompilerLibrary,
#endif
NULL,
NULL,
NULL,
NULL,
NULL,
AMD_OCL_SC_LIB
};
compiler_ = aclCompilerInit(&opts, NULL);
}
if (settings().hsail_ || (settings().oclVersion_ == OpenCL20)) {
// Runtime doesn't know what local size could be on the real board
info_.maxGlobalVariableSize_ = static_cast<size_t>(512 * Mi);
@@ -510,6 +535,7 @@ NullDevice::fillDeviceInfo(
info_.deviceTopology_.pcie.function = (calAttr.pciTopologyInformation&0x07);
::strncpy(info_.boardName_, calAttr.boardName, sizeof(info_.boardName_));
::strncpy(info_.driverStore_, calAttr.driverStore, sizeof(info_.driverStore_));
// OpenCL1.2 device info fields
info_.builtInKernels_ = "";
@@ -936,6 +962,32 @@ Device::create(CALuint ordinal, CALuint numOfDevices)
static_cast<size_t>(getMaxTextureSize()),
engines().numComputeRings(), engines().numComputeRingsRT());
if (NULL == compiler_) {
#if !defined(ATI_OS_LINUX)
char CompilerLibrary[220] = "";
strcpy_s(CompilerLibrary, getAttribs().driverStore);
strcat_s(CompilerLibrary, "amdocl12cl" LP64_SWITCH("", "64") ".dll");
#endif
const char *library = getenv("COMPILER_LIBRARY");
aclCompilerOptions opts = {
sizeof(aclCompilerOptions_0_8),
#if defined(ATI_OS_LINUX)
library ? library : LINUX_ONLY("lib") "amdocl12cl" \
LP64_SWITCH(LINUX_SWITCH("32",""),"64") LINUX_SWITCH(".so",".dll"),
#else
library ? library : CompilerLibrary,
#endif
NULL,
NULL,
NULL,
NULL,
NULL,
AMD_OCL_SC_LIB
};
compiler_ = aclCompilerInit(&opts, NULL);
}
if (settings().hsail_ || (settings().oclVersion_ == OpenCL20)) {
if (NULL == hsaCompiler_) {
const char* library = getenv("HSA_COMPILER_LIBRARY");
@@ -1195,21 +1247,8 @@ Device::init()
bool useDeviceList = false;
requestedDevices_t requestedDevices;
const char *library = getenv("COMPILER_LIBRARY");
aclCompilerOptions opts = {
sizeof(aclCompilerOptions_0_8),
library ? library : LINUX_ONLY("lib") "amdocl12cl" \
LP64_SWITCH(LINUX_SWITCH("32",""),"64") LINUX_SWITCH(".so",".dll"),
NULL,
NULL,
NULL,
NULL,
NULL,
AMD_OCL_SC_LIB
};
hsaCompiler_ = NULL;
compiler_ = aclCompilerInit(&opts, NULL);
compiler_ = NULL;
#if defined(_WIN32) && !defined(_WIN64)
// @toto: FIXME: remove this when CAL is fixed!!!
+3
Просмотреть файл
@@ -108,6 +108,9 @@ CALGSLDevice::getAttribs_int(gsl::gsCtx* cs)
const uint8* boardName = cs->getString(GSL_GS_RENDERER);
::strncpy(m_attribs.boardName, (char*)boardName, CAL_ASIC_INFO_MAX_LEN * sizeof(char));
const uint8* driverStore = cs->getString(GSL_GS_DRIVER_STORE_PATH);
::strncpy(m_attribs.driverStore, (char*)driverStore, CAL_DRIVER_STORE_MAX_LEN * sizeof(char));
m_attribs.counterFreq = cs->getCounterFreq();
m_attribs.nanoSecondsPerTick = 1000000000.0 / cs->getCounterFreq();
m_attribs.longIdleDetect = cs->getLongIdleDetect();
+2
Просмотреть файл
@@ -47,6 +47,7 @@ typedef enum CALbooleanEnum {
typedef struct CALimageRec* CALimage;
#define CAL_ASIC_INFO_MAX_LEN 128
#define CAL_DRIVER_STORE_MAX_LEN 200
/** CAL device attributes */
typedef struct CALdeviceattribsRec {
@@ -86,6 +87,7 @@ typedef struct CALdeviceattribsRec {
bool isWDDM2Enabled; /**< check if WDDM2 is enabled */
CALuint maxRTCUs; /**< The maximum number of RT CUs for RT queues */
CALuint asicRevision; /**< The ASIC revision ID */
CALchar driverStore[CAL_DRIVER_STORE_MAX_LEN];/**< Driver store location. */
} CALdeviceattribs;