Skip to content

Commit f0491f0

Browse files
againullbader
authored andcommitted
[SYCL] Follow-up fixes for stream class
* Enable constant propagation for stream manipulators * Enable LIT test on all devices except CPU * Remove unused builtins.hpp include Signed-off-by: Artur Gainullin <[email protected]>
1 parent 15d14fc commit f0491f0

File tree

3 files changed

+18
-19
lines changed

3 files changed

+18
-19
lines changed

sycl/include/CL/sycl/detail/stream_impl.hpp

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
#pragma once
1010

1111
#include <CL/sycl/accessor.hpp>
12-
#include <CL/sycl/builtins.hpp>
1312
#include <CL/sycl/detail/array.hpp>
1413
#include <CL/sycl/device_selector.hpp>
1514
#include <CL/sycl/queue.hpp>

sycl/include/CL/sycl/stream.hpp

+15-15
Original file line numberDiff line numberDiff line change
@@ -28,29 +28,29 @@ enum class stream_manipulator {
2828
defaultfloat
2929
};
3030

31-
const stream_manipulator dec = stream_manipulator::dec;
31+
constexpr stream_manipulator dec = stream_manipulator::dec;
3232

33-
const stream_manipulator hex = stream_manipulator::hex;
33+
constexpr stream_manipulator hex = stream_manipulator::hex;
3434

35-
const stream_manipulator oct = stream_manipulator::oct;
35+
constexpr stream_manipulator oct = stream_manipulator::oct;
3636

37-
const stream_manipulator noshowbase = stream_manipulator::noshowbase;
37+
constexpr stream_manipulator noshowbase = stream_manipulator::noshowbase;
3838

39-
const stream_manipulator showbase = stream_manipulator::showbase;
39+
constexpr stream_manipulator showbase = stream_manipulator::showbase;
4040

41-
const stream_manipulator noshowpos = stream_manipulator::noshowpos;
41+
constexpr stream_manipulator noshowpos = stream_manipulator::noshowpos;
4242

43-
const stream_manipulator showpos = stream_manipulator::showpos;
43+
constexpr stream_manipulator showpos = stream_manipulator::showpos;
4444

45-
const stream_manipulator endl = stream_manipulator::endl;
45+
constexpr stream_manipulator endl = stream_manipulator::endl;
4646

47-
const stream_manipulator fixed = stream_manipulator::fixed;
47+
constexpr stream_manipulator fixed = stream_manipulator::fixed;
4848

49-
const stream_manipulator scientific = stream_manipulator::scientific;
49+
constexpr stream_manipulator scientific = stream_manipulator::scientific;
5050

51-
const stream_manipulator hexfloat = stream_manipulator::hexfloat;
51+
constexpr stream_manipulator hexfloat = stream_manipulator::hexfloat;
5252

53-
const stream_manipulator defaultfloat = stream_manipulator::defaultfloat;
53+
constexpr stream_manipulator defaultfloat = stream_manipulator::defaultfloat;
5454

5555
class stream;
5656

@@ -145,7 +145,7 @@ class stream {
145145
}
146146

147147
// Set the flags which correspond to the input stream manipulator.
148-
void set_manipulator(const stream_manipulator &SM) const {
148+
void set_manipulator(const stream_manipulator SM) const {
149149
switch (SM) {
150150
case stream_manipulator::dec:
151151
set_flag(detail::Dec, detail::BaseField);
@@ -195,7 +195,7 @@ class stream {
195195
friend const stream &operator<<(const stream &, const float &);
196196
friend const stream &operator<<(const stream &, const double &);
197197
friend const stream &operator<<(const stream &, const half &);
198-
friend const stream &operator<<(const stream &, const stream_manipulator &);
198+
friend const stream &operator<<(const stream &, const stream_manipulator);
199199
friend const stream &operator<<(const stream &Out,
200200
const __precision_manipulator__ &RHS);
201201

@@ -319,7 +319,7 @@ inline const stream &operator<<(const stream &Out,
319319
}
320320

321321
inline const stream &operator<<(const stream &Out,
322-
const stream_manipulator &RHS) {
322+
const stream_manipulator RHS) {
323323
switch (RHS) {
324324
case stream_manipulator::endl:
325325
Out << '\n';

sycl/test/basic_tests/stream.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// RUN: %clang -std=c++11 -fsycl -lstdc++ %s -o %t.out -lOpenCL -lsycl
2-
// TEMPORARY_DISABLED_RUNx: env SYCL_DEVICE_TYPE=HOST %t.out | FileCheck %s
2+
// RUN: env SYCL_DEVICE_TYPE=HOST %t.out | FileCheck %s
33
// TEMPORARY_DISABLED_RUNx: %CPU_RUN_PLACEHOLDER %t.out %CPU_CHECK_PLACEHOLDER
4-
// TEMPORARY_DISABLED_RUNx: %GPU_RUN_PLACEHOLDER %t.out %GPU_CHECK_PLACEHOLDER
5-
// TEMPORARY_DISABLED_RUNx: %ACC_RUN_PLACEHOLDER %t.out %ACC_CHECK_PLACEHOLDER
4+
// RUN: %GPU_RUN_PLACEHOLDER %t.out %GPU_CHECK_PLACEHOLDER
5+
// RUN: %ACC_RUN_PLACEHOLDER %t.out %ACC_CHECK_PLACEHOLDER
66
//==------------------ stream.cpp - SYCL stream basic test -----------------==//
77
//
88
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.

0 commit comments

Comments
 (0)