build: add clang-tidy restriction for Enum case

Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2023-12-19 12:39:07 +00:00
committed by Compute-Runtime-Automation
parent 590418a588
commit a4888b39c6
107 changed files with 834 additions and 1367 deletions

View File

@@ -283,34 +283,34 @@ ze_result_t CommandQueueImp::CommandBufferManager::initialize(Device *device, si
secondBuffer = device->getNEODevice()->getMemoryManager()->allocateGraphicsMemoryWithProperties(properties);
}
buffers[BUFFER_ALLOCATION::FIRST] = firstBuffer;
buffers[BUFFER_ALLOCATION::SECOND] = secondBuffer;
buffers[BufferAllocation::first] = firstBuffer;
buffers[BufferAllocation::second] = secondBuffer;
if (!buffers[BUFFER_ALLOCATION::FIRST] || !buffers[BUFFER_ALLOCATION::SECOND]) {
if (!buffers[BufferAllocation::first] || !buffers[BufferAllocation::second]) {
return ZE_RESULT_ERROR_OUT_OF_DEVICE_MEMORY;
}
flushId[BUFFER_ALLOCATION::FIRST] = std::make_pair(0u, 0u);
flushId[BUFFER_ALLOCATION::SECOND] = std::make_pair(0u, 0u);
flushId[BufferAllocation::first] = std::make_pair(0u, 0u);
flushId[BufferAllocation::second] = std::make_pair(0u, 0u);
return ZE_RESULT_SUCCESS;
}
void CommandQueueImp::CommandBufferManager::destroy(Device *device) {
if (buffers[BUFFER_ALLOCATION::FIRST]) {
device->storeReusableAllocation(*buffers[BUFFER_ALLOCATION::FIRST]);
buffers[BUFFER_ALLOCATION::FIRST] = nullptr;
if (buffers[BufferAllocation::first]) {
device->storeReusableAllocation(*buffers[BufferAllocation::first]);
buffers[BufferAllocation::first] = nullptr;
}
if (buffers[BUFFER_ALLOCATION::SECOND]) {
device->storeReusableAllocation(*buffers[BUFFER_ALLOCATION::SECOND]);
buffers[BUFFER_ALLOCATION::SECOND] = nullptr;
if (buffers[BufferAllocation::second]) {
device->storeReusableAllocation(*buffers[BufferAllocation::second]);
buffers[BufferAllocation::second] = nullptr;
}
}
NEO::WaitStatus CommandQueueImp::CommandBufferManager::switchBuffers(NEO::CommandStreamReceiver *csr) {
if (bufferUse == BUFFER_ALLOCATION::FIRST) {
bufferUse = BUFFER_ALLOCATION::SECOND;
if (bufferUse == BufferAllocation::first) {
bufferUse = BufferAllocation::second;
} else {
bufferUse = BUFFER_ALLOCATION::FIRST;
bufferUse = BufferAllocation::first;
}
auto waitStatus{NEO::WaitStatus::ready};

View File

@@ -36,10 +36,10 @@ struct Kernel;
struct CommandQueueImp : public CommandQueue {
class CommandBufferManager {
public:
enum BUFFER_ALLOCATION : uint32_t {
FIRST = 0,
SECOND,
COUNT
enum BufferAllocation : uint32_t {
first = 0,
second,
count
};
ze_result_t initialize(Device *device, size_t sizeRequested);
@@ -58,9 +58,9 @@ struct CommandQueueImp : public CommandQueue {
}
private:
NEO::GraphicsAllocation *buffers[BUFFER_ALLOCATION::COUNT]{};
std::pair<TaskCountType, NEO::FlushStamp> flushId[BUFFER_ALLOCATION::COUNT];
BUFFER_ALLOCATION bufferUse = BUFFER_ALLOCATION::FIRST;
NEO::GraphicsAllocation *buffers[BufferAllocation::count]{};
std::pair<TaskCountType, NEO::FlushStamp> flushId[BufferAllocation::count];
BufferAllocation bufferUse = BufferAllocation::first;
};
static constexpr size_t defaultQueueCmdBufferSize = 128 * MemoryConstants::kiloByte;
static constexpr size_t minCmdBufferPtrAlign = 8;

View File

@@ -29,12 +29,10 @@ class Debugger;
namespace L0 {
typedef enum _ze_rtas_device_format_internal_t {
ZE_RTAS_DEVICE_FORMAT_EXP_INVALID = 0, // invalid acceleration structure format
ZE_RTAS_DEVICE_FORMAT_EXP_VERSION_1 = 1, // acceleration structure format version 1
ZE_RTAS_DEVICE_FORMAT_EXP_VERSION_2 = 2, // acceleration structure format version 2
ZE_RTAS_DEVICE_FORMAT_EXP_VERSION_MAX = 2
} ze_rtas_device_format_internal_t;
enum class RTASDeviceFormatInternal {
version1 = 1,
version2 = 2,
};
struct Event;
struct Device;

View File

@@ -74,7 +74,7 @@ NEO::HeapAddressModel L0GfxCoreHelperHw<Family>::getPlatformHeapAddressModel() c
template <typename Family>
ze_rtas_format_exp_t L0GfxCoreHelperHw<Family>::getSupportedRTASFormat() const {
return static_cast<ze_rtas_format_exp_t>(ZE_RTAS_DEVICE_FORMAT_EXP_VERSION_1);
return static_cast<ze_rtas_format_exp_t>(RTASDeviceFormatInternal::version1);
}
template <typename Family>