mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-20 08:53:55 +08:00
Rename function
Rename multiDeviceCapable to implicitScalingCapable Rename isMultiDeviceCapable to isImplicitScalingCapable Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
e5d7142ae0
commit
cf4ce308d9
@@ -148,7 +148,7 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::initialize(Device *device, NEO
|
||||
}
|
||||
}
|
||||
|
||||
if (device->isMultiDeviceCapable() && !this->internalUsage) {
|
||||
if (device->isImplicitScalingCapable() && !this->internalUsage) {
|
||||
this->partitionCount = static_cast<uint32_t>(this->device->getNEODevice()->getDeviceBitfield().count());
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ void CommandQueueHw<gfxCoreFamily>::programStateBaseAddress(uint64_t gsba, bool
|
||||
NEO::MemorySynchronizationCommands<GfxFamily>::addPipeControl(commandStream, args);
|
||||
auto pSbaCmd = static_cast<STATE_BASE_ADDRESS *>(commandStream.getSpace(sizeof(STATE_BASE_ADDRESS)));
|
||||
STATE_BASE_ADDRESS sbaCmd;
|
||||
bool multiOsContextCapable = device->isMultiDeviceCapable();
|
||||
bool multiOsContextCapable = device->isImplicitScalingCapable();
|
||||
NEO::StateBaseAddressHelper<GfxFamily>::programStateBaseAddress(&sbaCmd,
|
||||
nullptr,
|
||||
nullptr,
|
||||
|
||||
@@ -150,7 +150,7 @@ ze_result_t ContextImp::allocDeviceMem(ze_device_handle_t hDevice,
|
||||
uint64_t globalMemSize = neoDevice->getDeviceInfo().globalMemSize;
|
||||
|
||||
uint32_t numSubDevices = neoDevice->getNumGenericSubDevices();
|
||||
if ((!device->isMultiDeviceCapable()) && (numSubDevices > 1)) {
|
||||
if ((!device->isImplicitScalingCapable()) && (numSubDevices > 1)) {
|
||||
globalMemSize = globalMemSize / numSubDevices;
|
||||
}
|
||||
if (lookupTable.relaxedSizeAllowed && (size > globalMemSize)) {
|
||||
@@ -213,7 +213,7 @@ ze_result_t ContextImp::allocSharedMem(ze_device_handle_t hDevice,
|
||||
uint64_t globalMemSize = neoDevice->getDeviceInfo().globalMemSize;
|
||||
|
||||
uint32_t numSubDevices = neoDevice->getNumGenericSubDevices();
|
||||
if ((!device->isMultiDeviceCapable()) && (numSubDevices > 1)) {
|
||||
if ((!device->isImplicitScalingCapable()) && (numSubDevices > 1)) {
|
||||
globalMemSize = globalMemSize / numSubDevices;
|
||||
}
|
||||
if (relaxedSizeAllowed &&
|
||||
|
||||
@@ -88,8 +88,8 @@ struct Device : _ze_device_handle_t {
|
||||
virtual uint32_t getMaxNumHwThreads() const = 0;
|
||||
|
||||
virtual NEO::HwHelper &getHwHelper() = 0;
|
||||
bool isMultiDeviceCapable() const {
|
||||
return multiDeviceCapable;
|
||||
bool isImplicitScalingCapable() const {
|
||||
return implicitScalingCapable;
|
||||
}
|
||||
virtual const NEO::HardwareInfo &getHwInfo() const = 0;
|
||||
virtual NEO::OSInterface &getOsInterface() = 0;
|
||||
@@ -140,7 +140,7 @@ struct Device : _ze_device_handle_t {
|
||||
virtual void storeReusableAllocation(NEO::GraphicsAllocation &alloc) = 0;
|
||||
|
||||
protected:
|
||||
bool multiDeviceCapable = false;
|
||||
bool implicitScalingCapable = false;
|
||||
};
|
||||
|
||||
} // namespace L0
|
||||
|
||||
@@ -333,7 +333,7 @@ ze_result_t DeviceImp::getMemoryProperties(uint32_t *pCount, ze_device_memory_pr
|
||||
strcpy_s(pMemProperties->name, ZE_MAX_DEVICE_NAME, hwInfoConfig.getDeviceMemoryName().c_str());
|
||||
pMemProperties->maxClockRate = hwInfoConfig.getDeviceMemoryMaxClkRate(&hwInfo);
|
||||
pMemProperties->maxBusWidth = deviceInfo.addressBits;
|
||||
if (this->isMultiDeviceCapable() ||
|
||||
if (this->isImplicitScalingCapable() ||
|
||||
this->getNEODevice()->getNumGenericSubDevices() == 0) {
|
||||
pMemProperties->totalSize = deviceInfo.globalMemSize;
|
||||
} else {
|
||||
@@ -496,7 +496,7 @@ ze_result_t DeviceImp::getProperties(ze_device_properties_t *pDeviceProperties)
|
||||
|
||||
pDeviceProperties->numSlices = hardwareInfo.gtSystemInfo.SliceCount;
|
||||
|
||||
if (isMultiDeviceCapable()) {
|
||||
if (isImplicitScalingCapable()) {
|
||||
pDeviceProperties->numSlices *= neoDevice->getNumGenericSubDevices();
|
||||
}
|
||||
|
||||
@@ -702,7 +702,7 @@ ze_result_t DeviceImp::systemBarrier() { return ZE_RESULT_ERROR_UNSUPPORTED_FEAT
|
||||
ze_result_t DeviceImp::activateMetricGroupsDeferred(uint32_t count,
|
||||
zet_metric_group_handle_t *phMetricGroups) {
|
||||
ze_result_t result = ZE_RESULT_ERROR_UNKNOWN;
|
||||
if (!this->isSubdevice && this->isMultiDeviceCapable()) {
|
||||
if (!this->isSubdevice && this->isImplicitScalingCapable()) {
|
||||
for (auto subDevice : this->subDevices) {
|
||||
result = subDevice->getMetricContext().activateMetricGroupsDeferred(count, phMetricGroups);
|
||||
if (result != ZE_RESULT_SUCCESS)
|
||||
@@ -738,7 +738,7 @@ MetricContext &DeviceImp::getMetricContext() { return *metricContext; }
|
||||
|
||||
void DeviceImp::activateMetricGroups() {
|
||||
if (metricContext != nullptr) {
|
||||
if (metricContext->isMultiDeviceCapable()) {
|
||||
if (metricContext->isImplicitScalingCapable()) {
|
||||
for (uint32_t i = 0; i < numSubDevices; i++) {
|
||||
subDevices[i]->getMetricContext().activateMetricGroups();
|
||||
}
|
||||
@@ -779,7 +779,7 @@ Device *Device::create(DriverHandle *driverHandle, NEO::Device *neoDevice, bool
|
||||
neoDevice->incRefInternal();
|
||||
|
||||
device->execEnvironment = (void *)neoDevice->getExecutionEnvironment();
|
||||
device->multiDeviceCapable = NEO::ImplicitScalingHelper::isImplicitScalingEnabled(neoDevice->getDeviceBitfield(), true);
|
||||
device->implicitScalingCapable = NEO::ImplicitScalingHelper::isImplicitScalingEnabled(neoDevice->getDeviceBitfield(), true);
|
||||
device->metricContext = MetricContext::create(*device);
|
||||
device->builtins = BuiltinFunctionsLib::create(
|
||||
device, neoDevice->getBuiltIns());
|
||||
@@ -1117,7 +1117,7 @@ bool DeviceImp::toApiSliceId(const NEO::TopologyMap &topologyMap, uint32_t &slic
|
||||
|
||||
NEO::Device *DeviceImp::getActiveDevice() const {
|
||||
if (neoDevice->getNumGenericSubDevices() > 1u) {
|
||||
if (isMultiDeviceCapable()) {
|
||||
if (isImplicitScalingCapable()) {
|
||||
return this->neoDevice;
|
||||
}
|
||||
return this->neoDevice->getSubDevice(0);
|
||||
|
||||
@@ -188,7 +188,7 @@ ze_result_t DriverHandleImp::initialize(std::vector<std::unique_ptr<NEO::Device>
|
||||
auto device = Device::create(this, pNeoDevice, false, &returnValue);
|
||||
this->devices.push_back(device);
|
||||
|
||||
multiOsContextDriver |= device->isMultiDeviceCapable();
|
||||
multiOsContextDriver |= device->isImplicitScalingCapable();
|
||||
if (returnValue != ZE_RESULT_SUCCESS) {
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace ult {
|
||||
template <>
|
||||
struct WhiteBox<::L0::Device> : public ::L0::Device {
|
||||
using Base = L0::Device;
|
||||
using Base::multiDeviceCapable;
|
||||
using Base::implicitScalingCapable;
|
||||
};
|
||||
|
||||
using Device = WhiteBox<::L0::Device>;
|
||||
@@ -98,7 +98,7 @@ template <>
|
||||
struct Mock<L0::DeviceImp> : public L0::DeviceImp {
|
||||
using Base = L0::DeviceImp;
|
||||
using Base::debugSession;
|
||||
using Base::multiDeviceCapable;
|
||||
using Base::implicitScalingCapable;
|
||||
|
||||
explicit Mock(NEO::Device *device, NEO::ExecutionEnvironment *execEnv) {
|
||||
device->incRefInternal();
|
||||
|
||||
@@ -960,7 +960,7 @@ TEST_F(CommandListCreate, givenRootDeviceAndImplicitScalingDisabledWhenCreatingC
|
||||
queueDesc.ordinal = ordinal;
|
||||
queueDesc.index = 0;
|
||||
|
||||
l0RootDevice.multiDeviceCapable = true;
|
||||
l0RootDevice.implicitScalingCapable = true;
|
||||
auto returnValue = l0RootDevice.createCommandList(&cmdDesc, &commandList);
|
||||
EXPECT_EQ(ZE_RESULT_ERROR_INVALID_ARGUMENT, returnValue);
|
||||
EXPECT_EQ(nullptr, commandList);
|
||||
@@ -969,7 +969,7 @@ TEST_F(CommandListCreate, givenRootDeviceAndImplicitScalingDisabledWhenCreatingC
|
||||
EXPECT_EQ(ZE_RESULT_ERROR_INVALID_ARGUMENT, returnValue);
|
||||
EXPECT_EQ(nullptr, commandList);
|
||||
|
||||
l0RootDevice.multiDeviceCapable = false;
|
||||
l0RootDevice.implicitScalingCapable = false;
|
||||
returnValue = l0RootDevice.createCommandList(&cmdDesc, &commandList);
|
||||
EXPECT_EQ(ZE_RESULT_SUCCESS, returnValue);
|
||||
EXPECT_NE(nullptr, commandList);
|
||||
|
||||
@@ -87,12 +87,12 @@ HWTEST_F(ContextCreateCommandQueueTest, givenRootDeviceAndImplicitScalingDisable
|
||||
desc.ordinal = ordinal;
|
||||
desc.index = 0;
|
||||
|
||||
l0RootDevice.multiDeviceCapable = true;
|
||||
l0RootDevice.implicitScalingCapable = true;
|
||||
ze_result_t res = context->createCommandQueue(l0RootDevice.toHandle(), &desc, &commandQueue);
|
||||
EXPECT_EQ(ZE_RESULT_ERROR_INVALID_ARGUMENT, res);
|
||||
EXPECT_EQ(nullptr, commandQueue);
|
||||
|
||||
l0RootDevice.multiDeviceCapable = false;
|
||||
l0RootDevice.implicitScalingCapable = false;
|
||||
res = context->createCommandQueue(l0RootDevice.toHandle(), &desc, &commandQueue);
|
||||
EXPECT_EQ(ZE_RESULT_SUCCESS, res);
|
||||
EXPECT_NE(nullptr, commandQueue);
|
||||
|
||||
@@ -2494,26 +2494,26 @@ struct MultiSubDeviceFixture : public DeviceFixture {
|
||||
};
|
||||
|
||||
using MultiSubDeviceTest = Test<MultiSubDeviceFixture<true, true, -1>>;
|
||||
TEST_F(MultiSubDeviceTest, GivenApiSupportAndLocalMemoryEnabledWhenDeviceContainsSubDevicesThenItIsMultiDeviceCapable) {
|
||||
EXPECT_TRUE(device->isMultiDeviceCapable());
|
||||
TEST_F(MultiSubDeviceTest, GivenApiSupportAndLocalMemoryEnabledWhenDeviceContainsSubDevicesThenItIsImplicitScalingCapable) {
|
||||
EXPECT_TRUE(device->isImplicitScalingCapable());
|
||||
EXPECT_EQ(neoDevice, deviceImp->getActiveDevice());
|
||||
}
|
||||
|
||||
using MultiSubDeviceTestNoApi = Test<MultiSubDeviceFixture<true, false, -1>>;
|
||||
TEST_F(MultiSubDeviceTestNoApi, GivenNoApiSupportAndLocalMemoryEnabledWhenDeviceContainsSubDevicesThenItIsNotMultiDeviceCapable) {
|
||||
EXPECT_FALSE(device->isMultiDeviceCapable());
|
||||
TEST_F(MultiSubDeviceTestNoApi, GivenNoApiSupportAndLocalMemoryEnabledWhenDeviceContainsSubDevicesThenItIsNotImplicitScalingCapable) {
|
||||
EXPECT_FALSE(device->isImplicitScalingCapable());
|
||||
EXPECT_EQ(subDevice, deviceImp->getActiveDevice());
|
||||
}
|
||||
|
||||
using MultiSubDeviceTestNoLocalMemory = Test<MultiSubDeviceFixture<false, true, -1>>;
|
||||
TEST_F(MultiSubDeviceTestNoLocalMemory, GivenApiSupportAndLocalMemoryDisabledWhenDeviceContainsSubDevicesThenItIsNotMultiDeviceCapable) {
|
||||
EXPECT_FALSE(device->isMultiDeviceCapable());
|
||||
TEST_F(MultiSubDeviceTestNoLocalMemory, GivenApiSupportAndLocalMemoryDisabledWhenDeviceContainsSubDevicesThenItIsNotImplicitScalingCapable) {
|
||||
EXPECT_FALSE(device->isImplicitScalingCapable());
|
||||
EXPECT_EQ(subDevice, deviceImp->getActiveDevice());
|
||||
}
|
||||
|
||||
using MultiSubDeviceTestNoApiForceOn = Test<MultiSubDeviceFixture<true, false, 1>>;
|
||||
TEST_F(MultiSubDeviceTestNoApiForceOn, GivenNoApiSupportAndLocalMemoryEnabledWhenForcedImplicitScalingThenItIsMultiDeviceCapable) {
|
||||
EXPECT_TRUE(device->isMultiDeviceCapable());
|
||||
TEST_F(MultiSubDeviceTestNoApiForceOn, GivenNoApiSupportAndLocalMemoryEnabledWhenForcedImplicitScalingThenItIsImplicitScalingCapable) {
|
||||
EXPECT_TRUE(device->isImplicitScalingCapable());
|
||||
EXPECT_EQ(neoDevice, deviceImp->getActiveDevice());
|
||||
}
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ struct MetricContextImp : public MetricContext {
|
||||
bool isComputeUsed() override;
|
||||
uint32_t getSubDeviceIndex() override;
|
||||
void setSubDeviceIndex(const uint32_t index) override;
|
||||
bool isMultiDeviceCapable() override;
|
||||
bool isImplicitScalingCapable() override;
|
||||
|
||||
protected:
|
||||
ze_result_t initializationState = ZE_RESULT_ERROR_UNINITIALIZED;
|
||||
@@ -80,7 +80,7 @@ struct MetricContextImp : public MetricContext {
|
||||
MetricStreamer *pMetricStreamer = nullptr;
|
||||
uint32_t subDeviceIndex = 0;
|
||||
bool useCompute = false;
|
||||
bool multiDeviceCapable = false;
|
||||
bool implicitScalingCapable = false;
|
||||
};
|
||||
|
||||
MetricContextImp::MetricContextImp(Device &deviceInput)
|
||||
@@ -96,7 +96,7 @@ MetricContextImp::MetricContextImp(Device &deviceInput)
|
||||
? static_cast<NEO::SubDevice *>(deviceNeo)->getSubDeviceIndex()
|
||||
: 0;
|
||||
|
||||
multiDeviceCapable = !isSubDevice && device.isMultiDeviceCapable();
|
||||
implicitScalingCapable = !isSubDevice && device.isImplicitScalingCapable();
|
||||
}
|
||||
|
||||
MetricContextImp::~MetricContextImp() {
|
||||
@@ -169,8 +169,8 @@ void MetricContextImp::setSubDeviceIndex(const uint32_t index) {
|
||||
subDeviceIndex = index;
|
||||
}
|
||||
|
||||
bool MetricContextImp::isMultiDeviceCapable() {
|
||||
return multiDeviceCapable;
|
||||
bool MetricContextImp::isImplicitScalingCapable() {
|
||||
return implicitScalingCapable;
|
||||
}
|
||||
|
||||
ze_result_t
|
||||
|
||||
@@ -57,7 +57,7 @@ struct MetricContext {
|
||||
virtual bool isComputeUsed() = 0;
|
||||
virtual uint32_t getSubDeviceIndex() = 0;
|
||||
virtual void setSubDeviceIndex(const uint32_t index) = 0;
|
||||
virtual bool isMultiDeviceCapable() = 0;
|
||||
virtual bool isImplicitScalingCapable() = 0;
|
||||
};
|
||||
|
||||
struct Metric : _zet_metric_handle_t {
|
||||
|
||||
@@ -128,7 +128,7 @@ ze_result_t MetricEnumeration::openMetricsDiscovery() {
|
||||
|
||||
auto &device = metricContext.getDevice();
|
||||
const auto &deviceImp = *static_cast<DeviceImp *>(&device);
|
||||
if (metricContext.isMultiDeviceCapable()) {
|
||||
if (metricContext.isImplicitScalingCapable()) {
|
||||
|
||||
// Open metrics device for each sub device.
|
||||
for (size_t i = 0; i < deviceImp.numSubDevices; i++) {
|
||||
@@ -167,7 +167,7 @@ ze_result_t MetricEnumeration::cleanupMetricsDiscovery() {
|
||||
|
||||
auto &device = metricContext.getDevice();
|
||||
const auto &deviceImp = *static_cast<DeviceImp *>(&device);
|
||||
if (metricContext.isMultiDeviceCapable()) {
|
||||
if (metricContext.isImplicitScalingCapable()) {
|
||||
|
||||
for (size_t i = 0; i < deviceImp.numSubDevices; i++) {
|
||||
deviceImp.subDevices[i]->getMetricContext().getMetricEnumeration().cleanupMetricsDiscovery();
|
||||
@@ -201,7 +201,7 @@ ze_result_t MetricEnumeration::cacheMetricInformation() {
|
||||
|
||||
auto &device = metricContext.getDevice();
|
||||
const auto &deviceImp = *static_cast<DeviceImp *>(&device);
|
||||
if (metricContext.isMultiDeviceCapable()) {
|
||||
if (metricContext.isImplicitScalingCapable()) {
|
||||
|
||||
ze_result_t result = ZE_RESULT_SUCCESS;
|
||||
|
||||
|
||||
@@ -435,7 +435,7 @@ ze_result_t metricQueryPoolCreate(zet_context_handle_t hContext, zet_device_hand
|
||||
const auto &deviceImp = *static_cast<DeviceImp *>(device);
|
||||
auto metricPoolImp = new MetricQueryPoolImp(device->getMetricContext(), hMetricGroup, *pDesc);
|
||||
|
||||
if (metricContext.isMultiDeviceCapable()) {
|
||||
if (metricContext.isImplicitScalingCapable()) {
|
||||
|
||||
auto emptyMetricGroups = std::vector<zet_metric_group_handle_t>();
|
||||
auto &metricGroups = hMetricGroup
|
||||
@@ -557,7 +557,7 @@ bool MetricQueryPoolImp::allocateGpuMemory() {
|
||||
if (description.type == ZET_METRIC_QUERY_POOL_TYPE_PERFORMANCE) {
|
||||
// Get allocation size.
|
||||
const auto &deviceImp = *static_cast<DeviceImp *>(&metricContext.getDevice());
|
||||
allocationSize = (metricContext.isMultiDeviceCapable())
|
||||
allocationSize = (metricContext.isImplicitScalingCapable())
|
||||
? deviceImp.subDevices[0]->getMetricContext().getMetricsLibrary().getQueryReportGpuSize() * description.count * deviceImp.numSubDevices
|
||||
: metricsLibrary.getQueryReportGpuSize() * description.count;
|
||||
|
||||
@@ -895,7 +895,7 @@ ze_result_t MetricQuery::appendMemoryBarrier(CommandList &commandList) {
|
||||
|
||||
DeviceImp *pDeviceImp = static_cast<DeviceImp *>(commandList.device);
|
||||
|
||||
if (pDeviceImp->metricContext->isMultiDeviceCapable()) {
|
||||
if (pDeviceImp->metricContext->isImplicitScalingCapable()) {
|
||||
// Use one of the sub-device contexts to append to command list.
|
||||
pDeviceImp = static_cast<DeviceImp *>(pDeviceImp->subDevices[0]);
|
||||
}
|
||||
@@ -921,7 +921,7 @@ ze_result_t MetricQuery::appendStreamerMarker(CommandList &commandList,
|
||||
|
||||
DeviceImp *pDeviceImp = static_cast<DeviceImp *>(commandList.device);
|
||||
|
||||
if (pDeviceImp->metricContext->isMultiDeviceCapable()) {
|
||||
if (pDeviceImp->metricContext->isImplicitScalingCapable()) {
|
||||
// Use one of the sub-device contexts to append to command list.
|
||||
pDeviceImp = static_cast<DeviceImp *>(pDeviceImp->subDevices[0]);
|
||||
pDeviceImp->metricContext->getMetricsLibrary().enableWorkloadPartition();
|
||||
|
||||
@@ -294,7 +294,7 @@ ze_result_t MetricStreamer::open(zet_context_handle_t hContext, zet_device_handl
|
||||
auto pDevice = Device::fromHandle(hDevice);
|
||||
const auto pDeviceImp = static_cast<const DeviceImp *>(pDevice);
|
||||
|
||||
if (pDeviceImp->metricContext->isMultiDeviceCapable()) {
|
||||
if (pDeviceImp->metricContext->isImplicitScalingCapable()) {
|
||||
const uint32_t subDeviceCount = pDeviceImp->numSubDevices;
|
||||
auto pMetricStreamer = new MetricStreamerImp();
|
||||
UNRECOVERABLE_IF(pMetricStreamer == nullptr);
|
||||
|
||||
Reference in New Issue
Block a user