Files
compute-runtime/runtime/helpers/cache_policy.cpp
Piotr Fusik 33a9d3160b Simplify code.
Change-Id: If730d02312da01515ae53b5faaeb5d33419ec4ba
Signed-off-by: Piotr Fusik <piotr.fusik@intel.com>
2019-02-28 13:09:52 +01:00

26 lines
718 B
C++

/*
* Copyright (C) 2017-2019 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "runtime/helpers/cache_policy.h"
#include "runtime/helpers/aligned_memory.h"
#include "runtime/memory_manager/graphics_allocation.h"
namespace OCLRT {
bool isL3Capable(void *ptr, size_t size) {
return isAligned<MemoryConstants::cacheLineSize>(ptr) &&
isAligned<MemoryConstants::cacheLineSize>(size);
}
bool isL3Capable(const OCLRT::GraphicsAllocation &graphicsAllocation) {
auto ptr = ptrOffset(graphicsAllocation.getUnderlyingBuffer(), static_cast<size_t>(graphicsAllocation.allocationOffset));
return isL3Capable(ptr, graphicsAllocation.getUnderlyingBufferSize());
}
} // namespace OCLRT