Files
compute-runtime/core/command_stream/linear_stream.cpp
Daria Hinz 6566eb3193 Move Linear Stream to core folder
Change-Id: I962ebd6e9075fcab9d7b6211524093109e62d382
Signed-off-by: Daria Hinz <daria.hinz@intel.com>
2019-08-26 17:00:53 +02:00

37 lines
952 B
C++

/*
* Copyright (C) 2017-2019 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "core/command_stream/linear_stream.h"
#include "runtime/memory_manager/graphics_allocation.h"
namespace NEO {
LinearStream::LinearStream(GraphicsAllocation *gfxAllocation, void *buffer, size_t bufferSize)
: sizeUsed(0), maxAvailableSpace(bufferSize), buffer(buffer), graphicsAllocation(gfxAllocation) {
}
LinearStream::LinearStream(void *buffer, size_t bufferSize)
: LinearStream(nullptr, buffer, bufferSize) {
}
LinearStream::LinearStream(GraphicsAllocation *gfxAllocation)
: sizeUsed(0), graphicsAllocation(gfxAllocation) {
if (gfxAllocation) {
maxAvailableSpace = gfxAllocation->getUnderlyingBufferSize();
buffer = gfxAllocation->getUnderlyingBuffer();
} else {
maxAvailableSpace = 0;
buffer = nullptr;
}
}
LinearStream::LinearStream()
: LinearStream(nullptr) {
}
} // namespace NEO