Add CCS1-3 to EngineNodeHelper

Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:
Bartosz Dunajski
2021-06-25 17:41:13 +00:00
committed by Compute-Runtime-Automation
parent 05cff2501a
commit fefd2d2429
5 changed files with 34 additions and 8 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2020 Intel Corporation
* Copyright (C) 2018-2021 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@ -15,12 +15,18 @@ TEST(WddmMapperTests, givenRcsEngineTypeWhenAskedForNodeOrdinalThenReturn3d) {
GPUNODE_ORDINAL rcsNode = WddmEngineMapper::engineNodeMap(aub_stream::ENGINE_RCS);
GPUNODE_ORDINAL bcsNode = WddmEngineMapper::engineNodeMap(aub_stream::ENGINE_BCS);
GPUNODE_ORDINAL ccsNode = WddmEngineMapper::engineNodeMap(aub_stream::ENGINE_CCS);
GPUNODE_ORDINAL ccsNode1 = WddmEngineMapper::engineNodeMap(aub_stream::ENGINE_CCS1);
GPUNODE_ORDINAL ccsNode2 = WddmEngineMapper::engineNodeMap(aub_stream::ENGINE_CCS2);
GPUNODE_ORDINAL ccsNode3 = WddmEngineMapper::engineNodeMap(aub_stream::ENGINE_CCS3);
GPUNODE_ORDINAL expectedRcsNode = GPUNODE_3D;
GPUNODE_ORDINAL expectedBcsNode = GPUNODE_BLT;
GPUNODE_ORDINAL expectedCcsNode = GPUNODE_CCS0;
EXPECT_EQ(expectedRcsNode, rcsNode);
EXPECT_EQ(expectedBcsNode, bcsNode);
EXPECT_EQ(expectedCcsNode, ccsNode);
EXPECT_EQ(expectedCcsNode, ccsNode1);
EXPECT_EQ(expectedCcsNode, ccsNode2);
EXPECT_EQ(expectedCcsNode, ccsNode3);
}
TEST(WddmMapperTests, givenNotSupportedEngineWhenAskedForNodeThenAbort) {

View File

@ -34,8 +34,19 @@ std::string engineTypeToString(aub_stream::EngineType engineType) {
return "VECS";
case aub_stream::EngineType::ENGINE_CCS:
return "CCS";
case aub_stream::EngineType::ENGINE_CCS1:
return "CCS1";
case aub_stream::EngineType::ENGINE_CCS2:
return "CCS2";
case aub_stream::EngineType::ENGINE_CCS3:
return "CCS3";
default:
return engineTypeToStringAdditional(engineType);
}
}
bool isCcs(aub_stream::EngineType engineType) {
return engineType >= aub_stream::ENGINE_CCS && engineType <= aub_stream::ENGINE_CCS3;
}
} // namespace NEO::EngineHelpers

View File

@ -9,10 +9,6 @@
namespace NEO {
namespace EngineHelpers {
bool isCcs(aub_stream::EngineType engineType) {
return engineType == aub_stream::ENGINE_CCS;
}
bool isBcs(aub_stream::EngineType engineType) {
return engineType == aub_stream::ENGINE_BCS;
}

View File

@ -8,16 +8,17 @@
#include "shared/source/os_interface/windows/wddm_engine_mapper.h"
#include "shared/source/helpers/debug_helpers.h"
#include "shared/source/helpers/engine_node_helper.h"
namespace NEO {
GPUNODE_ORDINAL WddmEngineMapper::engineNodeMap(aub_stream::EngineType engineType) {
if (aub_stream::ENGINE_RCS == engineType) {
if (EngineHelpers::isCcs(engineType)) {
return GPUNODE_CCS0;
} else if (aub_stream::ENGINE_RCS == engineType) {
return GPUNODE_3D;
} else if (aub_stream::ENGINE_BCS == engineType) {
return GPUNODE_BLT;
} else if (aub_stream::ENGINE_CCS == engineType) {
return GPUNODE_CCS0;
}
UNRECOVERABLE_IF(true);
}

View File

@ -29,9 +29,21 @@ TEST(EngineNodeHelperTests, givenValidEngineTypeWhenGettingStringRepresentationT
CHECK_ENGINE(VCS);
CHECK_ENGINE(VECS);
CHECK_ENGINE(CCS);
CHECK_ENGINE(CCS1);
CHECK_ENGINE(CCS2);
CHECK_ENGINE(CCS3);
#undef CHECK_ENGINE
}
TEST(EngineNodeHelperTests, givenCcsEngineWhenHelperIsUsedThenReturnTrue) {
EXPECT_TRUE(EngineHelpers::isCcs(aub_stream::EngineType::ENGINE_CCS));
EXPECT_TRUE(EngineHelpers::isCcs(aub_stream::EngineType::ENGINE_CCS1));
EXPECT_TRUE(EngineHelpers::isCcs(aub_stream::EngineType::ENGINE_CCS2));
EXPECT_TRUE(EngineHelpers::isCcs(aub_stream::EngineType::ENGINE_CCS3));
EXPECT_FALSE(EngineHelpers::isCcs(aub_stream::EngineType::ENGINE_RCS));
EXPECT_FALSE(EngineHelpers::isCcs(aub_stream::EngineType::NUM_ENGINES));
}
TEST(EngineNodeHelperTests, givenInvalidEngineTypeWhenGettingStringRepresentationThenItIsCorrect) {
EXPECT_EQ(std::string{"Unknown"}, EngineHelpers::engineTypeToString(aub_stream::EngineType::NUM_ENGINES));
EXPECT_EQ(std::string{"Unknown"}, EngineHelpers::engineTypeToString(static_cast<aub_stream::EngineType>(0xcc)));