2017-12-21 07:45:38 +08:00
|
|
|
/*
|
2019-02-27 18:39:32 +08:00
|
|
|
* Copyright (C) 2017-2019 Intel Corporation
|
2017-12-21 07:45:38 +08:00
|
|
|
*
|
2018-09-18 15:11:08 +08:00
|
|
|
* SPDX-License-Identifier: MIT
|
2017-12-21 07:45:38 +08:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "runtime/command_stream/linear_stream.h"
|
2019-02-27 18:39:32 +08:00
|
|
|
|
2017-12-21 07:45:38 +08:00
|
|
|
#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) {
|
|
|
|
}
|
2018-06-13 03:54:39 +08:00
|
|
|
} // namespace OCLRT
|