mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-12 17:33:00 +08:00
Get CL Device Name with device ID appended at the end
Related-To: NEO-4744 Change-Id: I8a9a791a634f9c0c444695036d96e3c959c90de0 Signed-off-by: Slawomir Milczarek <slawomir.milczarek@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
324150dd37
commit
eb8f5fa301
@@ -17,5 +17,15 @@ set(NEO_CORE_DEVICE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/sub_device.h
|
||||
)
|
||||
|
||||
if(SUPPORT_DG1 AND "${BRANCH_TYPE}" STREQUAL "")
|
||||
list(APPEND NEO_CORE_DEVICE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/device_get_device_name_dg1.cpp
|
||||
)
|
||||
else()
|
||||
list(APPEND NEO_CORE_DEVICE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}/device_get_device_name.cpp
|
||||
)
|
||||
endif()
|
||||
|
||||
set_property(GLOBAL PROPERTY NEO_CORE_DEVICE ${NEO_CORE_DEVICE})
|
||||
add_subdirectories()
|
||||
|
||||
@@ -66,6 +66,7 @@ class Device : public ReferenceTrackedObject<Device> {
|
||||
Debugger *getDebugger() { return getRootDeviceEnvironment().debugger.get(); }
|
||||
NEO::SourceLevelDebugger *getSourceLevelDebugger();
|
||||
const std::vector<EngineControl> &getEngines() const;
|
||||
const std::string getDeviceName(const HardwareInfo &hwInfo) const;
|
||||
|
||||
ExecutionEnvironment *getExecutionEnvironment() const { return executionEnvironment; }
|
||||
const RootDeviceEnvironment &getRootDeviceEnvironment() const { return *executionEnvironment->rootDeviceEnvironments[getRootDeviceIndex()]; }
|
||||
|
||||
18
shared/source/device/device_get_device_name.cpp
Normal file
18
shared/source/device/device_get_device_name.cpp
Normal file
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
* Copyright (C) 2020 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/device/device.h"
|
||||
#include "shared/source/helpers/hw_info.h"
|
||||
|
||||
namespace NEO {
|
||||
|
||||
const std::string Device::getDeviceName(const HardwareInfo &hwInfo) const {
|
||||
std::string deviceName = "Intel(R) Graphics ";
|
||||
deviceName += familyName[hwInfo.platform.eRenderCoreFamily];
|
||||
return deviceName;
|
||||
}
|
||||
} // namespace NEO
|
||||
20
shared/source/device/device_get_device_name_dg1.cpp
Normal file
20
shared/source/device/device_get_device_name_dg1.cpp
Normal file
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright (C) 2020 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/device/device.h"
|
||||
#include "shared/source/helpers/hw_info.h"
|
||||
|
||||
namespace NEO {
|
||||
|
||||
const std::string Device::getDeviceName(const HardwareInfo &hwInfo) const {
|
||||
std::string deviceName = "Intel(R) Graphics";
|
||||
if (hwInfo.platform.eProductFamily < PRODUCT_FAMILY::IGFX_DG1) {
|
||||
deviceName += std::string(" ") + familyName[hwInfo.platform.eRenderCoreFamily];
|
||||
}
|
||||
return deviceName;
|
||||
}
|
||||
} // namespace NEO
|
||||
Reference in New Issue
Block a user