mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Move device name to device scope.
Change-Id: If7df4c8f97fa6b0c6f9449ae6802386c639241c2
This commit is contained in:

committed by
sys_ocldev

parent
ca87805ba0
commit
3e65a39c62
@ -83,6 +83,7 @@ Device::Device(const HardwareInfo &hwInfo,
|
||||
osTime(nullptr), slmWindowStartAddress(nullptr) {
|
||||
memset(&deviceInfo, 0, sizeof(deviceInfo));
|
||||
deviceExtensions.reserve(1000);
|
||||
name.reserve(100);
|
||||
preemptionMode = PreemptionHelper::getDefaultPreemptionMode(hwInfo);
|
||||
engineType = DebugManager.flags.NodeOrdinal.get() == -1
|
||||
? hwInfo.capabilityTable.defaultEngineType
|
||||
|
@ -134,6 +134,7 @@ class Device : public BaseObject<_cl_device_id> {
|
||||
MOCKABLE_VIRTUAL const WhitelistedRegisters &getWhitelistedRegisters() { return hwInfo.capabilityTable.whitelistedRegisters; }
|
||||
std::vector<unsigned int> simultaneousInterops;
|
||||
std::string deviceExtensions;
|
||||
std::string name;
|
||||
bool getEnabled64kbPages();
|
||||
bool isSourceLevelDebuggerActive() const;
|
||||
SourceLevelDebugger *getSourceLevelDebugger() { return sourceLevelDebugger.get(); }
|
||||
|
@ -40,7 +40,6 @@
|
||||
namespace OCLRT {
|
||||
extern const char *familyName[];
|
||||
|
||||
static std::string name(128, '\0');
|
||||
static std::string vendor = "Intel(R) Corporation";
|
||||
static std::string profile = "FULL_PROFILE";
|
||||
static std::string spirVersions = "1.2 ";
|
||||
@ -99,17 +98,15 @@ void Device::initializeCaps() {
|
||||
if (is32bit) {
|
||||
addressing32bitAllowed = false;
|
||||
}
|
||||
std::string tempName = "Intel(R) ";
|
||||
tempName += familyName[hwInfo.pPlatform->eRenderCoreFamily];
|
||||
tempName += " HD Graphics NEO";
|
||||
|
||||
DEBUG_BREAK_IF(tempName.size() > name.size());
|
||||
name = tempName;
|
||||
|
||||
driverVersion = TOSTR(NEO_DRIVER_VERSION);
|
||||
|
||||
name += "Intel(R) ";
|
||||
name += familyName[hwInfo.pPlatform->eRenderCoreFamily];
|
||||
name += " HD Graphics NEO";
|
||||
|
||||
if (driverInfo) {
|
||||
name.assign(driverInfo.get()->getDeviceName(tempName).c_str());
|
||||
name.assign(driverInfo.get()->getDeviceName(name).c_str());
|
||||
driverVersion.assign(driverInfo.get()->getVersion(driverVersion).c_str());
|
||||
}
|
||||
|
||||
|
@ -84,6 +84,7 @@ TEST(Device_GetCaps, validate) {
|
||||
|
||||
std::string strDriverName = caps.name;
|
||||
std::string strFamilyName = familyName[device->getRenderCoreFamily()];
|
||||
|
||||
EXPECT_NE(std::string::npos, strDriverName.find(strFamilyName));
|
||||
|
||||
EXPECT_NE(nullptr, caps.name);
|
||||
@ -720,6 +721,7 @@ TEST(Device_GetCaps, givenSystemWithNoDriverInfoWhenGettingNameAndVersionThenRet
|
||||
auto device = Device::create<OCLRT::MockDevice>(platformDevices[0]);
|
||||
|
||||
device->setDriverInfo(nullptr);
|
||||
device->name.clear();
|
||||
device->initializeCaps();
|
||||
|
||||
const auto &caps = device->getDeviceInfo();
|
||||
|
Reference in New Issue
Block a user