Skip to content

Commit 111c4af

Browse files
[SYCL][NFC] sub_group_mask.hpp cleanup (#18777)
Dropped include of SYCL math built-ins, removed use of non-standard `assert` from device code.
1 parent 093fcb0 commit 111c4af

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

sycl/include/sycl/ext/oneapi/sub_group_mask.hpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
//===----------------------------------------------------------------------===//
88
#pragma once
99

10-
#include <sycl/builtins.hpp> // for assert
1110
#include <sycl/detail/helpers.hpp> // for Builder
1211
#include <sycl/detail/memcpy.hpp> // detail::memcpy
1312
#include <sycl/exception.hpp> // for errc, exception
@@ -321,10 +320,14 @@ struct sub_group_mask {
321320

322321
sub_group_mask(BitsType rhs, size_t bn)
323322
: Bits(rhs & valuable_bits(bn)), bits_num(bn) {
323+
#ifndef __SYCL_DEVICE_ONLY__
324324
assert(bits_num <= max_bits);
325+
#endif
325326
}
326327
inline BitsType valuable_bits(size_t bn) const {
328+
#ifndef __SYCL_DEVICE_ONLY__
327329
assert(bn <= max_bits);
330+
#endif
328331
BitsType one = 1;
329332
if (bn == max_bits)
330333
return -one;

sycl/test-e2e/SubGroupMask/sub_group_mask_ver2.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// RUN: %{run} %t.out
33

44
#include <iostream>
5+
#include <sycl/builtins.hpp>
56
#include <sycl/detail/core.hpp>
67
#include <sycl/ext/oneapi/sub_group_mask.hpp>
78
#include <sycl/sub_group.hpp>

sycl/test-e2e/WorkGroupMemory/basic_usage.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,15 @@
55
// XFAIL: spirv-backend
66
// XFAIL-TRACKER: https://github.com/intel/llvm/issues/18230
77

8-
#include <cassert>
9-
#include <cstring>
8+
#include <sycl/builtins.hpp>
109
#include <sycl/detail/core.hpp>
1110
#include <sycl/ext/oneapi/experimental/work_group_memory.hpp>
1211
#include <sycl/group_barrier.hpp>
1312
#include <sycl/half_type.hpp>
1413

14+
#include <cassert>
15+
#include <cstring>
16+
1517
namespace syclexp = sycl::ext::oneapi::experimental;
1618

1719
sycl::queue q;

0 commit comments

Comments
 (0)