mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-29 17:13:29 +08:00
Change maxNBitValue to a constexpr function
Now maxNBitValue can be used with run time variables. Change-Id: I323071400305e05e6303a33e24e90c521246d73f Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
0ba31a46cb
commit
0193b3ea69
@@ -156,7 +156,7 @@ int Drm::getQueueSliceCount(drm_i915_gem_context_param_sseu *sseu) {
|
||||
}
|
||||
|
||||
uint64_t Drm::getSliceMask(uint64_t sliceCount) {
|
||||
return static_cast<uint64_t>((1 << sliceCount) - 1);
|
||||
return maxNBitValue(sliceCount);
|
||||
}
|
||||
bool Drm::setQueueSliceCount(uint64_t sliceCount) {
|
||||
if (sliceCountChangeSupported) {
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace NEO {
|
||||
HwInfoConfig *hwInfoConfigFactory[IGFX_MAX_PRODUCT] = {};
|
||||
|
||||
uint32_t bitExact(uint32_t value, uint32_t highBit, uint32_t lowBit) {
|
||||
uint32_t bitVal = ((value >> lowBit) & ((1 << (highBit - lowBit + 1)) - 1));
|
||||
uint32_t bitVal = static_cast<uint32_t>((value >> lowBit) & maxNBitValue(highBit - lowBit + 1));
|
||||
return bitVal;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user