mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 06:49:52 +08:00
Simplifying debug settings classes
Change-Id: Ie7039b5ee7f5979564c4697c5d51c2b0a29e5bc2 Signed-off-by: Andrzej Koska <andrzej.koska@intel.com> Related-To: NEO-3239
This commit is contained in:
committed by
sys_ocldev
parent
a7daa599fd
commit
7fa3865f0b
@@ -46,33 +46,26 @@ class GraphicsAllocation;
|
||||
struct MultiDispatchInfo;
|
||||
class SettingsReader;
|
||||
|
||||
// clang-format off
|
||||
#define DECLARE_DEBUG_VARIABLE(dataType, variableName, defaultValue, description) \
|
||||
struct DebugVar##variableName \
|
||||
{ \
|
||||
DebugVar##variableName() { \
|
||||
value = (dataType)defaultValue; \
|
||||
} \
|
||||
dataType get() const { \
|
||||
return value; \
|
||||
} \
|
||||
void set(dataType data) { \
|
||||
value = data; \
|
||||
} \
|
||||
dataType &getRef() { \
|
||||
return value; \
|
||||
} \
|
||||
private: \
|
||||
dataType value; \
|
||||
};
|
||||
template <typename T>
|
||||
struct DebugVarBase {
|
||||
DebugVarBase(const T &defaultValue) : value(defaultValue) {}
|
||||
T get() const {
|
||||
return value;
|
||||
}
|
||||
void set(T data) {
|
||||
value = std::move(data);
|
||||
}
|
||||
T &getRef() {
|
||||
return value;
|
||||
}
|
||||
|
||||
#include "debug_variables.inl"
|
||||
#undef DECLARE_DEBUG_VARIABLE
|
||||
// clang-format on
|
||||
private:
|
||||
T value;
|
||||
};
|
||||
|
||||
struct DebugVariables {
|
||||
#define DECLARE_DEBUG_VARIABLE(dataType, variableName, defaultValue, description) \
|
||||
DebugVar##variableName variableName;
|
||||
DebugVarBase<dataType> variableName{defaultValue};
|
||||
#include "debug_variables.inl"
|
||||
#undef DECLARE_DEBUG_VARIABLE
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user