Do not obtain command stream if it will not be needed

Change-Id: Id7fa1c6b78e71a085084f8fcb66a7b8e873ad2bc
Signed-off-by: Maciej Dziuban <maciej.dziuban@intel.com>
Related-To: NEO-5120
This commit is contained in:
Maciej Dziuban
2020-09-30 16:58:20 +02:00
committed by sys_ocldev
parent 960860e4cb
commit 8fcd51c2c8
8 changed files with 133 additions and 25 deletions

View File

@@ -85,7 +85,7 @@ class CommandStreamReceiver {
virtual void processEviction();
void makeResidentHostPtrAllocation(GraphicsAllocation *gfxAllocation);
void ensureCommandBufferAllocation(LinearStream &commandStream, size_t minimumRequiredSize, size_t additionalAllocationSize);
MOCKABLE_VIRTUAL void ensureCommandBufferAllocation(LinearStream &commandStream, size_t minimumRequiredSize, size_t additionalAllocationSize);
MemoryManager *getMemoryManager() const;

View File

@@ -8,12 +8,23 @@
#include "shared/test/unit_test/test_macros/test_checks_shared.h"
#include "shared/source/device/device.h"
#include "shared/source/helpers/hw_helper.h"
#include "shared/test/unit_test/helpers/default_hw_info.h"
#include "test.h"
using namespace NEO;
bool NEO::TestChecks::supportsBlitter(const HardwareInfo *pHardwareInfo) {
auto engines = HwHelper::get(::renderCoreFamily).getGpgpuEngineInstances(*pHardwareInfo);
for (const auto &engine : engines) {
if (engine.first == aub_stream::EngineType::ENGINE_BCS) {
return true;
}
}
return false;
}
bool TestChecks::supportsSvm(const HardwareInfo *pHardwareInfo) {
return pHardwareInfo->capabilityTable.ftrSvm;
}
@@ -46,4 +57,4 @@ HWTEST2_P(TestMacrosWithParamIfNotMatchTearDownCall, givenNotMatchPlatformWhenUs
}
INSTANTIATE_TEST_CASE_P(givenNotMatchPlatformWhenUseHwTest2PThenSetUpAndTearDownAreNotCalled,
TestMacrosWithParamIfNotMatchTearDownCall,
::testing::Values(0));
::testing::Values(0));

View File

@@ -15,6 +15,7 @@ class Device;
struct HardwareInfo;
namespace TestChecks {
bool supportsBlitter(const HardwareInfo *pHardwareInfo);
bool supportsSvm(const HardwareInfo *pHardwareInfo);
bool supportsSvm(const std::unique_ptr<HardwareInfo> &pHardwareInfo);
bool supportsSvm(const Device *pDevice);
@@ -26,3 +27,8 @@ bool supportsSvm(const Device *pDevice);
if (NEO::TestChecks::supportsSvm(param) == false) { \
GTEST_SKIP(); \
}
#define REQUIRE_BLITTER_OR_SKIP(param) \
if (NEO::TestChecks::supportsBlitter(param) == false) { \
GTEST_SKIP(); \
}