Files
compute-runtime/runtime/command_stream/linear_stream.cpp
Artur Harasimiuk 40146291ad Update copyright headers
Updating files modified in 2018 only. Older files remain with old style
copyright header

Change-Id: Ic99f2e190ad74b4b7f2bd79dd7b9fa5fbe36ec92
Signed-off-by: Artur Harasimiuk <artur.harasimiuk@intel.com>
2018-09-20 18:02:35 +02:00

32 lines
804 B
C++

/*
* Copyright (C) 2017-2018 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "runtime/command_stream/linear_stream.h"
#include "runtime/memory_manager/graphics_allocation.h"
namespace OCLRT {
LinearStream::LinearStream(void *buffer, size_t bufferSize)
: sizeUsed(0), maxAvailableSpace(bufferSize), buffer(buffer), graphicsAllocation(nullptr) {
}
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 OCLRT