2017-12-21 00:45:38 +01:00
|
|
|
/*
|
2019-02-27 11:39:32 +01:00
|
|
|
* Copyright (C) 2017-2019 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
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "runtime/helpers/cache_policy.h"
|
|
|
|
|
2019-08-02 13:25:45 -07:00
|
|
|
#include "core/helpers/aligned_memory.h"
|
2019-02-27 14:52:10 +01:00
|
|
|
#include "runtime/memory_manager/graphics_allocation.h"
|
|
|
|
|
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
|