mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-19 16:24:18 +08:00
Revert "performance: improve pool handling"
This reverts commit a3c3b6533a.
Signed-off-by: Michal Mrozek <michal.mrozek@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
57e7147e7c
commit
d52ca080bd
@@ -89,7 +89,7 @@ TEST_F(AllocUsmHostDisabledMemoryTest, givenDriverHandleWhenCallingAllocHostMemT
|
|||||||
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
|
EXPECT_EQ(ZE_RESULT_SUCCESS, result);
|
||||||
}
|
}
|
||||||
|
|
||||||
using AllocUsmHostEnabledMemoryTest = AllocUsmPoolMemoryTest<16, -1>;
|
using AllocUsmHostEnabledMemoryTest = AllocUsmPoolMemoryTest<1, -1>;
|
||||||
|
|
||||||
TEST_F(AllocUsmHostEnabledMemoryTest, givenDriverHandleWhenCallingAllocHostMemWithVariousParametersThenUsePoolIfAllowed) {
|
TEST_F(AllocUsmHostEnabledMemoryTest, givenDriverHandleWhenCallingAllocHostMemWithVariousParametersThenUsePoolIfAllowed) {
|
||||||
auto mockHostMemAllocPool = reinterpret_cast<MockUsmMemAllocPool *>(&driverHandle->usmHostMemAllocPool);
|
auto mockHostMemAllocPool = reinterpret_cast<MockUsmMemAllocPool *>(&driverHandle->usmHostMemAllocPool);
|
||||||
|
|||||||
@@ -513,8 +513,7 @@ void Context::initializeUsmAllocationPools() {
|
|||||||
|
|
||||||
auto &productHelper = getDevices()[0]->getProductHelper();
|
auto &productHelper = getDevices()[0]->getProductHelper();
|
||||||
bool enabled = ApiSpecificConfig::isDeviceUsmPoolingEnabled() && productHelper.isUsmPoolAllocatorSupported();
|
bool enabled = ApiSpecificConfig::isDeviceUsmPoolingEnabled() && productHelper.isUsmPoolAllocatorSupported();
|
||||||
|
size_t poolSize = 2 * MemoryConstants::megaByte;
|
||||||
size_t poolSize = NEO::defaultPoolSize;
|
|
||||||
if (debugManager.flags.EnableDeviceUsmAllocationPool.get() != -1) {
|
if (debugManager.flags.EnableDeviceUsmAllocationPool.get() != -1) {
|
||||||
enabled = debugManager.flags.EnableDeviceUsmAllocationPool.get() > 0;
|
enabled = debugManager.flags.EnableDeviceUsmAllocationPool.get() > 0;
|
||||||
poolSize = debugManager.flags.EnableDeviceUsmAllocationPool.get() * MemoryConstants::megaByte;
|
poolSize = debugManager.flags.EnableDeviceUsmAllocationPool.get() * MemoryConstants::megaByte;
|
||||||
@@ -530,7 +529,7 @@ void Context::initializeUsmAllocationPools() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
enabled = ApiSpecificConfig::isHostUsmPoolingEnabled() && productHelper.isUsmPoolAllocatorSupported();
|
enabled = ApiSpecificConfig::isHostUsmPoolingEnabled() && productHelper.isUsmPoolAllocatorSupported();
|
||||||
poolSize = NEO::defaultPoolSize;
|
poolSize = 2 * MemoryConstants::megaByte;
|
||||||
if (debugManager.flags.EnableHostUsmAllocationPool.get() != -1) {
|
if (debugManager.flags.EnableHostUsmAllocationPool.get() != -1) {
|
||||||
enabled = debugManager.flags.EnableHostUsmAllocationPool.get() > 0;
|
enabled = debugManager.flags.EnableHostUsmAllocationPool.get() > 0;
|
||||||
poolSize = debugManager.flags.EnableHostUsmAllocationPool.get() * MemoryConstants::megaByte;
|
poolSize = debugManager.flags.EnableHostUsmAllocationPool.get() * MemoryConstants::megaByte;
|
||||||
|
|||||||
@@ -6,7 +6,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <stddef.h>
|
|
||||||
|
|
||||||
namespace NEO {
|
namespace NEO {
|
||||||
// AUB file folder location
|
// AUB file folder location
|
||||||
@@ -14,7 +13,4 @@ const char *folderAUB = ".";
|
|||||||
|
|
||||||
// Initial value for HW tag
|
// Initial value for HW tag
|
||||||
uint32_t initialHardwareTag = 0;
|
uint32_t initialHardwareTag = 0;
|
||||||
|
|
||||||
size_t defaultPoolSize = 16777216u;
|
|
||||||
|
|
||||||
} // namespace NEO
|
} // namespace NEO
|
||||||
|
|||||||
@@ -7,7 +7,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <stddef.h>
|
|
||||||
|
|
||||||
namespace NEO {
|
namespace NEO {
|
||||||
enum class CommandStreamReceiverType {
|
enum class CommandStreamReceiverType {
|
||||||
@@ -39,7 +38,4 @@ extern const char *folderAUB;
|
|||||||
// Initial value for HW tag
|
// Initial value for HW tag
|
||||||
// Set to 0 if using HW or simulator, otherwise 0xFFFFFF00, needs to be lower then CompletionStamp::notReady.
|
// Set to 0 if using HW or simulator, otherwise 0xFFFFFF00, needs to be lower then CompletionStamp::notReady.
|
||||||
extern uint32_t initialHardwareTag;
|
extern uint32_t initialHardwareTag;
|
||||||
|
|
||||||
// default size of memory pools
|
|
||||||
extern size_t defaultPoolSize;
|
|
||||||
} // namespace NEO
|
} // namespace NEO
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ bool UsmMemAllocPool::initialize(SVMAllocsManager *svmMemoryManager, const Unifi
|
|||||||
this->chunkAllocator.reset(new HeapAllocator(castToUint64(this->pool),
|
this->chunkAllocator.reset(new HeapAllocator(castToUint64(this->pool),
|
||||||
poolSize,
|
poolSize,
|
||||||
chunkAlignment,
|
chunkAlignment,
|
||||||
2 * MemoryConstants::megaByte));
|
allocationThreshold / 2));
|
||||||
this->poolSize = poolSize;
|
this->poolSize = poolSize;
|
||||||
this->poolMemoryType = memoryProperties.memoryType;
|
this->poolMemoryType = memoryProperties.memoryType;
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -35,9 +35,9 @@ class UsmMemAllocPool {
|
|||||||
void *getPooledAllocationBasePtr(const void *ptr);
|
void *getPooledAllocationBasePtr(const void *ptr);
|
||||||
size_t getOffsetInPool(const void *ptr);
|
size_t getOffsetInPool(const void *ptr);
|
||||||
|
|
||||||
static constexpr auto allocationThreshold = 2 * MemoryConstants::megaByte;
|
static constexpr auto allocationThreshold = 1 * MemoryConstants::megaByte;
|
||||||
static constexpr auto chunkAlignment = 512u;
|
static constexpr auto chunkAlignment = 512u;
|
||||||
static constexpr auto startingOffset = chunkAlignment;
|
static constexpr auto startingOffset = 2 * allocationThreshold;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
size_t poolSize{};
|
size_t poolSize{};
|
||||||
|
|||||||
@@ -6,12 +6,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <stddef.h>
|
|
||||||
|
|
||||||
namespace NEO {
|
namespace NEO {
|
||||||
const char *folderAUB = "aub_out";
|
const char *folderAUB = "aub_out";
|
||||||
|
|
||||||
uint32_t initialHardwareTag = static_cast<uint32_t>(0xFFFFFF00);
|
uint32_t initialHardwareTag = static_cast<uint32_t>(0xFFFFFF00);
|
||||||
|
|
||||||
size_t defaultPoolSize = 1048576u;
|
|
||||||
} // namespace NEO
|
} // namespace NEO
|
||||||
|
|||||||
Reference in New Issue
Block a user