mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Fix type redefinition
Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
This commit is contained in:

committed by
Compute-Runtime-Automation

parent
4bd53be195
commit
9763d42379
@ -55,9 +55,9 @@ namespace L0 {
|
|||||||
template <GFXCORE_FAMILY gfxCoreFamily>
|
template <GFXCORE_FAMILY gfxCoreFamily>
|
||||||
struct EncodeStateBaseAddress;
|
struct EncodeStateBaseAddress;
|
||||||
|
|
||||||
inline ze_result_t parseErrorCode(NEO::ErrorCode returnValue) {
|
inline ze_result_t parseErrorCode(NEO::CommandContainer::ErrorCode returnValue) {
|
||||||
switch (returnValue) {
|
switch (returnValue) {
|
||||||
case NEO::ErrorCode::OUT_OF_DEVICE_MEMORY:
|
case NEO::CommandContainer::ErrorCode::OUT_OF_DEVICE_MEMORY:
|
||||||
return ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY;
|
return ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY;
|
||||||
default:
|
default:
|
||||||
return ZE_RESULT_SUCCESS;
|
return ZE_RESULT_SUCCESS;
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
#include "shared/source/device_binary_format/ar/ar_encoder.h"
|
#include "shared/source/device_binary_format/ar/ar_encoder.h"
|
||||||
|
|
||||||
namespace NEO {
|
namespace NEO {
|
||||||
ErrorCode OclocConcat::initialize(const std::vector<std::string> &args) {
|
OclocConcat::ErrorCode OclocConcat::initialize(const std::vector<std::string> &args) {
|
||||||
auto error = parseArguments(args);
|
auto error = parseArguments(args);
|
||||||
if (error) {
|
if (error) {
|
||||||
return error;
|
return error;
|
||||||
@ -26,7 +26,7 @@ Ar::Ar OclocConcat::decodeAr(const std::vector<char> &arFile, std::string &outEr
|
|||||||
return NEO::Ar::decodeAr({reinterpret_cast<const uint8_t *>(arFile.data()), arFile.size()}, outErrors, outWarnings);
|
return NEO::Ar::decodeAr({reinterpret_cast<const uint8_t *>(arFile.data()), arFile.size()}, outErrors, outWarnings);
|
||||||
}
|
}
|
||||||
|
|
||||||
ErrorCode OclocConcat::parseArguments(const std::vector<std::string> &args) {
|
OclocConcat::ErrorCode OclocConcat::parseArguments(const std::vector<std::string> &args) {
|
||||||
for (size_t i = 2; i < args.size(); i++) {
|
for (size_t i = 2; i < args.size(); i++) {
|
||||||
if (NEO::ConstStringRef("-out") == args[i]) {
|
if (NEO::ConstStringRef("-out") == args[i]) {
|
||||||
if (i + 1 >= args.size()) {
|
if (i + 1 >= args.size()) {
|
||||||
@ -47,7 +47,7 @@ ErrorCode OclocConcat::parseArguments(const std::vector<std::string> &args) {
|
|||||||
return OclocErrorCode::SUCCESS;
|
return OclocErrorCode::SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
ErrorCode OclocConcat::checkIfFatBinariesExist() {
|
OclocConcat::ErrorCode OclocConcat::checkIfFatBinariesExist() {
|
||||||
bool filesExist = true;
|
bool filesExist = true;
|
||||||
for (auto &fileName : fileNamesToConcat) {
|
for (auto &fileName : fileNamesToConcat) {
|
||||||
if (false == argHelper->fileExists(fileName)) {
|
if (false == argHelper->fileExists(fileName)) {
|
||||||
@ -59,7 +59,7 @@ ErrorCode OclocConcat::checkIfFatBinariesExist() {
|
|||||||
return filesExist ? OclocErrorCode::SUCCESS : OclocErrorCode::INVALID_COMMAND_LINE;
|
return filesExist ? OclocErrorCode::SUCCESS : OclocErrorCode::INVALID_COMMAND_LINE;
|
||||||
}
|
}
|
||||||
|
|
||||||
ErrorCode OclocConcat::concatenate() {
|
OclocConcat::ErrorCode OclocConcat::concatenate() {
|
||||||
NEO::Ar::ArEncoder arEncoder(true);
|
NEO::Ar::ArEncoder arEncoder(true);
|
||||||
for (auto &fileName : fileNamesToConcat) {
|
for (auto &fileName : fileNamesToConcat) {
|
||||||
auto arFile = argHelper->readBinaryFile(fileName);
|
auto arFile = argHelper->readBinaryFile(fileName);
|
||||||
|
@ -18,9 +18,10 @@ namespace Ar {
|
|||||||
struct Ar;
|
struct Ar;
|
||||||
}
|
}
|
||||||
|
|
||||||
using ErrorCode = uint32_t;
|
|
||||||
class OclocConcat {
|
class OclocConcat {
|
||||||
public:
|
public:
|
||||||
|
using ErrorCode = uint32_t;
|
||||||
|
|
||||||
OclocConcat() = delete;
|
OclocConcat() = delete;
|
||||||
OclocConcat(const OclocConcat &) = delete;
|
OclocConcat(const OclocConcat &) = delete;
|
||||||
OclocConcat &operator=(const OclocConcat &) = delete;
|
OclocConcat &operator=(const OclocConcat &) = delete;
|
||||||
|
@ -58,7 +58,7 @@ CommandContainer::CommandContainer(uint32_t maxNumAggregatedIdds) : CommandConta
|
|||||||
numIddsPerBlock = maxNumAggregatedIdds;
|
numIddsPerBlock = maxNumAggregatedIdds;
|
||||||
}
|
}
|
||||||
|
|
||||||
ErrorCode CommandContainer::initialize(Device *device, AllocationsList *reusableAllocationList, bool requireHeaps) {
|
CommandContainer::ErrorCode CommandContainer::initialize(Device *device, AllocationsList *reusableAllocationList, bool requireHeaps) {
|
||||||
this->device = device;
|
this->device = device;
|
||||||
this->reusableAllocationList = reusableAllocationList;
|
this->reusableAllocationList = reusableAllocationList;
|
||||||
|
|
||||||
|
@ -28,13 +28,13 @@ using CmdBufferContainer = std::vector<GraphicsAllocation *>;
|
|||||||
using HeapContainer = std::vector<GraphicsAllocation *>;
|
using HeapContainer = std::vector<GraphicsAllocation *>;
|
||||||
using HeapType = IndirectHeapType;
|
using HeapType = IndirectHeapType;
|
||||||
|
|
||||||
enum class ErrorCode {
|
|
||||||
SUCCESS = 0,
|
|
||||||
OUT_OF_DEVICE_MEMORY = 1
|
|
||||||
};
|
|
||||||
|
|
||||||
class CommandContainer : public NonCopyableOrMovableClass {
|
class CommandContainer : public NonCopyableOrMovableClass {
|
||||||
public:
|
public:
|
||||||
|
enum class ErrorCode {
|
||||||
|
SUCCESS = 0,
|
||||||
|
OUT_OF_DEVICE_MEMORY = 1
|
||||||
|
};
|
||||||
|
|
||||||
static constexpr size_t defaultListCmdBufferSize = 1u * MemoryConstants ::megaByte;
|
static constexpr size_t defaultListCmdBufferSize = 1u * MemoryConstants ::megaByte;
|
||||||
static constexpr size_t cmdBufferReservedSize = MemoryConstants::cacheLineSize +
|
static constexpr size_t cmdBufferReservedSize = MemoryConstants::cacheLineSize +
|
||||||
CSRequirements::csOverfetchSize;
|
CSRequirements::csOverfetchSize;
|
||||||
|
@ -123,7 +123,7 @@ TEST_F(CommandContainerTest, givenCmdContainerWhenAllocatingHeapsThenSetCorrectA
|
|||||||
TEST_F(CommandContainerTest, givenCommandContainerWhenInitializeThenEverythingIsInitialized) {
|
TEST_F(CommandContainerTest, givenCommandContainerWhenInitializeThenEverythingIsInitialized) {
|
||||||
CommandContainer cmdContainer;
|
CommandContainer cmdContainer;
|
||||||
auto status = cmdContainer.initialize(pDevice, nullptr, true);
|
auto status = cmdContainer.initialize(pDevice, nullptr, true);
|
||||||
EXPECT_EQ(ErrorCode::SUCCESS, status);
|
EXPECT_EQ(CommandContainer::ErrorCode::SUCCESS, status);
|
||||||
|
|
||||||
EXPECT_EQ(pDevice, cmdContainer.getDevice());
|
EXPECT_EQ(pDevice, cmdContainer.getDevice());
|
||||||
EXPECT_NE(cmdContainer.getHeapHelper(), nullptr);
|
EXPECT_NE(cmdContainer.getHeapHelper(), nullptr);
|
||||||
@ -153,7 +153,7 @@ TEST_F(CommandContainerTest, givenCommandContainerWhenInitializeThenEverythingIs
|
|||||||
TEST_F(CommandContainerTest, givenCommandContainerWhenHeapNotRequiredThenHeapIsNotInitialized) {
|
TEST_F(CommandContainerTest, givenCommandContainerWhenHeapNotRequiredThenHeapIsNotInitialized) {
|
||||||
CommandContainer cmdContainer;
|
CommandContainer cmdContainer;
|
||||||
auto status = cmdContainer.initialize(pDevice, nullptr, false);
|
auto status = cmdContainer.initialize(pDevice, nullptr, false);
|
||||||
EXPECT_EQ(ErrorCode::SUCCESS, status);
|
EXPECT_EQ(CommandContainer::ErrorCode::SUCCESS, status);
|
||||||
|
|
||||||
EXPECT_EQ(pDevice, cmdContainer.getDevice());
|
EXPECT_EQ(pDevice, cmdContainer.getDevice());
|
||||||
EXPECT_EQ(cmdContainer.getHeapHelper(), nullptr);
|
EXPECT_EQ(cmdContainer.getHeapHelper(), nullptr);
|
||||||
@ -190,7 +190,7 @@ TEST_F(CommandContainerTest, givenEnabledLocalMemoryAndIsaInSystemMemoryWhenCmdC
|
|||||||
|
|
||||||
CommandContainer cmdContainer;
|
CommandContainer cmdContainer;
|
||||||
auto status = cmdContainer.initialize(device.get(), nullptr, true);
|
auto status = cmdContainer.initialize(device.get(), nullptr, true);
|
||||||
EXPECT_EQ(ErrorCode::SUCCESS, status);
|
EXPECT_EQ(CommandContainer::ErrorCode::SUCCESS, status);
|
||||||
|
|
||||||
EXPECT_EQ(instructionHeapBaseAddress, cmdContainer.getInstructionHeapBaseAddress());
|
EXPECT_EQ(instructionHeapBaseAddress, cmdContainer.getInstructionHeapBaseAddress());
|
||||||
}
|
}
|
||||||
@ -199,7 +199,7 @@ TEST_F(CommandContainerTest, givenCommandContainerDuringInitWhenAllocateGfxMemor
|
|||||||
CommandContainer cmdContainer;
|
CommandContainer cmdContainer;
|
||||||
pDevice->executionEnvironment->memoryManager.reset(new FailMemoryManager(0, *pDevice->executionEnvironment));
|
pDevice->executionEnvironment->memoryManager.reset(new FailMemoryManager(0, *pDevice->executionEnvironment));
|
||||||
auto status = cmdContainer.initialize(pDevice, nullptr, true);
|
auto status = cmdContainer.initialize(pDevice, nullptr, true);
|
||||||
EXPECT_EQ(ErrorCode::OUT_OF_DEVICE_MEMORY, status);
|
EXPECT_EQ(CommandContainer::ErrorCode::OUT_OF_DEVICE_MEMORY, status);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(CommandContainerTest, givenCmdContainerWithAllocsListWhenAllocateAndResetThenCmdBufferAllocIsReused) {
|
TEST_F(CommandContainerTest, givenCmdContainerWithAllocsListWhenAllocateAndResetThenCmdBufferAllocIsReused) {
|
||||||
@ -241,7 +241,7 @@ TEST_F(CommandContainerTest, givenCommandContainerDuringInitWhenAllocateHeapMemo
|
|||||||
auto tempMemoryManager = pDevice->executionEnvironment->memoryManager.release();
|
auto tempMemoryManager = pDevice->executionEnvironment->memoryManager.release();
|
||||||
pDevice->executionEnvironment->memoryManager.reset(new FailMemoryManager(1, *pDevice->executionEnvironment));
|
pDevice->executionEnvironment->memoryManager.reset(new FailMemoryManager(1, *pDevice->executionEnvironment));
|
||||||
auto status = cmdContainer.initialize(pDevice, nullptr, true);
|
auto status = cmdContainer.initialize(pDevice, nullptr, true);
|
||||||
EXPECT_EQ(ErrorCode::OUT_OF_DEVICE_MEMORY, status);
|
EXPECT_EQ(CommandContainer::ErrorCode::OUT_OF_DEVICE_MEMORY, status);
|
||||||
delete tempMemoryManager;
|
delete tempMemoryManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ GEN12LPTEST_F(CommandEncoderTest, WhenAdjustComputeModeIsCalledThenStateComputeM
|
|||||||
CommandContainer cmdContainer;
|
CommandContainer cmdContainer;
|
||||||
|
|
||||||
auto ret = cmdContainer.initialize(pDevice, nullptr, true);
|
auto ret = cmdContainer.initialize(pDevice, nullptr, true);
|
||||||
ASSERT_EQ(ErrorCode::SUCCESS, ret);
|
ASSERT_EQ(CommandContainer::ErrorCode::SUCCESS, ret);
|
||||||
|
|
||||||
auto usedSpaceBefore = cmdContainer.getCommandStream()->getUsed();
|
auto usedSpaceBefore = cmdContainer.getCommandStream()->getUsed();
|
||||||
|
|
||||||
@ -79,7 +79,7 @@ GEN12LPTEST_F(CommandEncodeStatesTest, givenVariousEngineTypesWhenEncodeSbaThenA
|
|||||||
CommandContainer cmdContainer;
|
CommandContainer cmdContainer;
|
||||||
|
|
||||||
auto ret = cmdContainer.initialize(pDevice, nullptr, true);
|
auto ret = cmdContainer.initialize(pDevice, nullptr, true);
|
||||||
ASSERT_EQ(ErrorCode::SUCCESS, ret);
|
ASSERT_EQ(CommandContainer::ErrorCode::SUCCESS, ret);
|
||||||
|
|
||||||
auto gmmHelper = cmdContainer.getDevice()->getRootDeviceEnvironment().getGmmHelper();
|
auto gmmHelper = cmdContainer.getDevice()->getRootDeviceEnvironment().getGmmHelper();
|
||||||
uint32_t statelessMocsIndex = (gmmHelper->getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER) >> 1);
|
uint32_t statelessMocsIndex = (gmmHelper->getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER) >> 1);
|
||||||
|
Reference in New Issue
Block a user