2017-12-21 00:45:38 +01:00
|
|
|
/*
|
2021-05-16 20:51:16 +02:00
|
|
|
* Copyright (C) 2018-2021 Intel Corporation
|
2017-12-21 00:45:38 +01:00
|
|
|
*
|
2019-02-27 11:39:32 +01:00
|
|
|
* SPDX-License-Identifier: MIT
|
2017-12-21 00:45:38 +01:00
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
2020-02-23 22:44:01 +01:00
|
|
|
#include "shared/source/helpers/cache_policy.h"
|
2017-12-21 00:45:38 +01:00
|
|
|
|
2020-02-23 22:44:01 +01:00
|
|
|
#include "shared/source/helpers/aligned_memory.h"
|
|
|
|
|
#include "shared/source/memory_manager/graphics_allocation.h"
|
2019-02-27 14:52:10 +01:00
|
|
|
|
2019-03-26 11:59:46 +01:00
|
|
|
namespace NEO {
|
2019-02-27 11:39:32 +01:00
|
|
|
|
2017-12-21 00:45:38 +01:00
|
|
|
bool isL3Capable(void *ptr, size_t size) {
|
2019-02-28 11:21:01 +01:00
|
|
|
return isAligned<MemoryConstants::cacheLineSize>(ptr) &&
|
|
|
|
|
isAligned<MemoryConstants::cacheLineSize>(size);
|
2019-02-27 14:52:10 +01:00
|
|
|
}
|
|
|
|
|
|
2019-03-26 11:59:46 +01:00
|
|
|
bool isL3Capable(const NEO::GraphicsAllocation &graphicsAllocation) {
|
2019-08-14 16:23:57 -07:00
|
|
|
return isL3Capable(graphicsAllocation.getUnderlyingBuffer(), graphicsAllocation.getUnderlyingBufferSize());
|
2019-02-27 14:52:10 +01:00
|
|
|
}
|
|
|
|
|
|
2019-03-26 11:59:46 +01:00
|
|
|
} // namespace NEO
|