mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Refactoring preemption tests
Change-Id: I7e34f12e7d974e24cc63aaaad77d293b744d1c74
This commit is contained in:

committed by
sys_ocldev

parent
6cf7ac41c2
commit
f235ba015e
@ -29,6 +29,8 @@
|
||||
|
||||
#include <cinttypes>
|
||||
#include <memory>
|
||||
#include <type_traits>
|
||||
#include <unordered_map>
|
||||
|
||||
namespace iOpenCL {
|
||||
struct SPatchExecutionEnvironment;
|
||||
@ -90,3 +92,22 @@ struct MidThreadPreemptionEnqueueKernelTest : OCLRT::PreemptionEnqueueKernelTest
|
||||
OCLRT::HardwareInfo *globalHwInfo;
|
||||
OCLRT::PreemptionMode originalPreemptionMode;
|
||||
};
|
||||
|
||||
struct PreemptionTestHwDetails {
|
||||
struct PreemptionModeHashT {
|
||||
auto operator()(const OCLRT::PreemptionMode &preemptionMode) const -> std::underlying_type<OCLRT::PreemptionMode>::type {
|
||||
return static_cast<std::underlying_type<OCLRT::PreemptionMode>::type>(preemptionMode);
|
||||
}
|
||||
};
|
||||
|
||||
bool supportsPreemptionProgramming() const {
|
||||
return modeToRegValueMap.size() > 0;
|
||||
}
|
||||
|
||||
uint32_t regAddress = 0;
|
||||
std::unordered_map<OCLRT::PreemptionMode, uint32_t, PreemptionModeHashT> modeToRegValueMap;
|
||||
uint32_t defaultRegValue = 0;
|
||||
};
|
||||
|
||||
template <typename FamilyType>
|
||||
PreemptionTestHwDetails GetPreemptionTestHwDetails();
|
||||
|
Reference in New Issue
Block a user