File tree Expand file tree Collapse file tree 1 file changed +11
-13
lines changed
sycl/include/CL/sycl/detail Expand file tree Collapse file tree 1 file changed +11
-13
lines changed Original file line number Diff line number Diff line change @@ -101,30 +101,28 @@ template <int N> struct Boolean {
101
101
};
102
102
103
103
template <> struct Boolean <1 > {
104
- using DataType = bool ;
105
-
106
- Boolean () : value(false ) {}
107
-
108
- Boolean (const Boolean &rhs) : value(rhs.value) {}
104
+ Boolean () = default ;
109
105
106
+ // Build from a signed interger type
110
107
template <typename T> Boolean (T val) : value(val) {
111
108
static_assert (is_sgeninteger<T>::value, " Invalid constructor" );
112
109
}
113
110
114
- #ifdef __SYCL_DEVICE_ONLY__
115
- using vector_t = DataType;
116
- Boolean (const vector_t rhs) : value(rhs) {}
117
-
118
- operator vector_t () const { return value; }
119
- #endif
120
-
111
+ // Cast to a signed interger type
121
112
template <typename T> operator T () const {
122
113
static_assert (is_sgeninteger<T>::value, " Invalid conversion" );
123
114
return value;
124
115
}
125
116
117
+ #ifdef __SYCL_DEVICE_ONLY__
118
+ // Build from a boolean type
119
+ Boolean (bool f) : value(f) {}
120
+ // Cast to a boolean type
121
+ operator bool () const { return value; }
122
+ #endif
123
+
126
124
private:
127
- alignas (1 ) DataType value;
125
+ alignas (1 ) bool value = false ;
128
126
};
129
127
130
128
} // namespace detail
You can’t perform that action at this time.
0 commit comments