2017-12-21 07:45:38 +08:00
|
|
|
/*
|
2019-02-27 18:39:32 +08:00
|
|
|
* Copyright (C) 2017-2019 Intel Corporation
|
2017-12-21 07:45:38 +08:00
|
|
|
*
|
2018-09-18 15:11:08 +08:00
|
|
|
* SPDX-License-Identifier: MIT
|
2017-12-21 07:45:38 +08:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2019-07-24 20:55:17 +08:00
|
|
|
#include "runtime/gen8/hw_cmds.h"
|
2019-06-12 15:13:06 +08:00
|
|
|
#include "runtime/helpers/hardware_commands_helper.h"
|
|
|
|
#include "runtime/helpers/hardware_commands_helper.inl"
|
|
|
|
#include "runtime/helpers/hardware_commands_helper_base.inl"
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2019-02-27 18:39:32 +08:00
|
|
|
#include <cstdint>
|
|
|
|
|
2019-03-26 18:59:46 +08:00
|
|
|
namespace NEO {
|
2017-12-21 07:45:38 +08:00
|
|
|
|
|
|
|
static uint32_t slmSizeId[] = {0, 1, 2, 4, 4, 8, 8, 8, 8, 16, 16, 16, 16, 16, 16, 16};
|
|
|
|
|
|
|
|
template <>
|
2019-06-12 15:13:06 +08:00
|
|
|
uint32_t HardwareCommandsHelper<BDWFamily>::computeSlmValues(uint32_t valueIn) {
|
2017-12-21 07:45:38 +08:00
|
|
|
valueIn += (4 * KB - 1);
|
|
|
|
valueIn = valueIn >> 12;
|
|
|
|
valueIn = std::min(valueIn, 15u);
|
|
|
|
valueIn = slmSizeId[valueIn];
|
|
|
|
return valueIn;
|
|
|
|
}
|
|
|
|
|
2019-06-12 15:13:06 +08:00
|
|
|
// Explicitly instantiate HardwareCommandsHelper for BDW device family
|
|
|
|
template struct HardwareCommandsHelper<BDWFamily>;
|
2019-03-26 18:59:46 +08:00
|
|
|
} // namespace NEO
|