Skip to content

Commit ed115ba

Browse files
AlexeySachkovbader
authored andcommitted
[SYCL][NFC] Improve testing of ConvertToOpenCLType_t (#1036)
Signed-off-by: Alexey Sachkov <[email protected]>
1 parent 5416f32 commit ed115ba

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

sycl/test/basic_tests/generic_type_traits.cpp

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,32 @@ int main() {
235235
s::access::address_space::global_space>>::value,
236236
"");
237237

238+
#ifdef __SYCL_DEVICE_ONLY__
239+
static_assert(
240+
std::is_same<d::ConvertToOpenCLType_t<s::vec<s::cl_int, 2>>,
241+
s::vec<s::cl_int, 2>::vector_t>::value,
242+
"");
243+
static_assert(
244+
std::is_same<d::ConvertToOpenCLType_t<s::vec<s::longlong, 2>>,
245+
s::vec<s::cl_long, 2>::vector_t>::value,
246+
"");
247+
static_assert(
248+
std::is_same<
249+
d::ConvertToOpenCLType_t<
250+
s::multi_ptr<s::cl_int, s::access::address_space::global_space>>,
251+
s::multi_ptr<s::cl_int, s::access::address_space::global_space>::
252+
pointer_t>::value,
253+
"");
254+
static_assert(
255+
std::is_same<
256+
d::ConvertToOpenCLType_t<s::multi_ptr<
257+
s::vec<s::cl_int, 4>, s::access::address_space::global_space>>,
258+
s::multi_ptr<s::vec<s::cl_int, 4>::vector_t,
259+
s::access::address_space::global_space>::pointer_t>::
260+
value,
261+
"");
262+
#endif
263+
238264
s::multi_ptr<int, s::access::address_space::global_space> mp;
239265
int *dp = mp;
240266
}

0 commit comments

Comments
 (0)