Skip to content

Commit 9ff0401

Browse files
againullbader
authored andcommitted
[SYCL] Minor fixes after stream class implementation.
* Warnings were fixed. * Bug in assertion was fixed. Signed-off-by: Artur Gainullin <[email protected]>
1 parent 9ceb9e2 commit 9ff0401

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

sycl/include/CL/sycl/buffer.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,8 @@ class buffer {
120120

121121
buffer(buffer<T, dimensions, AllocatorT> &b, const id<dimensions> &baseIndex,
122122
const range<dimensions> &subRange)
123-
: impl(b.impl), Offset(baseIndex + b.Offset), Range(subRange), MemRange(b.MemRange),
124-
IsSubBuffer(true) {}
123+
: impl(b.impl), Range(subRange), MemRange(b.MemRange), IsSubBuffer(true),
124+
Offset(baseIndex + b.Offset) {}
125125

126126
template <int N = dimensions, typename = EnableIfOneDimension<N>>
127127
buffer(cl_mem MemObject, const context &SyclContext,
@@ -237,11 +237,11 @@ class buffer {
237237
template <typename DataT, int dims, access::mode mode,
238238
access::target target, access::placeholder isPlaceholder>
239239
friend class accessor;
240+
range<dimensions> Range;
240241
// If this buffer is subbuffer - this range represents range of the parent
241242
// buffer
242243
range<dimensions> MemRange;
243244
bool IsSubBuffer = false;
244-
range<dimensions> Range;
245245
// If this buffer is sub-buffer - offset field specifies the origin of the
246246
// sub-buffer inside the parent buffer
247247
id<dimensions> Offset;

sycl/source/detail/scheduler/commands.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ AllocaCommand *ExecCGCommand::getAllocaForReq(Requirement *Req) {
204204
}
205205

206206
void ExecCGCommand::flushStreams() {
207-
assert(CommandGroup->getType() == CG::KERNEL && "Expected kernel");
207+
assert(MCommandGroup->getType() == CG::KERNEL && "Expected kernel");
208208
for (auto StreamImplPtr :
209209
((CGExecKernel *)MCommandGroup.get())->getStreams()) {
210210
StreamImplPtr->flush();

sycl/source/detail/stream_impl.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,15 @@ namespace detail {
1515

1616
stream_impl::stream_impl(size_t BufferSize, size_t MaxStatementSize,
1717
handler &CGH)
18-
: BufferSize_(BufferSize),
18+
: BufferSize_(BufferSize), MaxStatementSize_(MaxStatementSize),
1919
// Allocate additional place for the offset variable and the end of line
2020
// symbol. Initialize buffer with zeros, this is needed for two reasons:
2121
// 1. We don't need to care about end of line when printing out streamed
2222
// data.
2323
// 2. Offset is properly initialized.
2424
Data(BufferSize + OffsetSize + 1, 0),
2525
Buf(Data.data(), range<1>(BufferSize + OffsetSize + 1),
26-
{property::buffer::use_host_ptr()}),
27-
MaxStatementSize_(MaxStatementSize) {}
26+
{property::buffer::use_host_ptr()}) {}
2827

2928
size_t stream_impl::get_size() const { return BufferSize_; }
3029

0 commit comments

Comments
 (0)