Skip to content

Commit 8aad52d

Browse files
[SYCL] Resolve namespace ambiguity in this_nd_item (#5258)
Since the `detail` namespace appears in both the `sycl` namespace and in the `sycl::ext::oneapi::experimental` namespace, the implementation of `sycl::ext::oneapi::experimental::this_nd_item` may fail due to `detail::declptr` not existing in the latter. These changes remove the ambiguity. Signed-off-by: Steffen Larsen <steffen.larsen@intel.com>
1 parent 504d533 commit 8aad52d

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

sycl/include/CL/sycl/nd_item.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,8 @@ namespace oneapi {
207207
namespace experimental {
208208
template <int Dims> nd_item<Dims> this_nd_item() {
209209
#ifdef __SYCL_DEVICE_ONLY__
210-
return sycl::detail::Builder::getElement(detail::declptr<nd_item<Dims>>());
210+
return sycl::detail::Builder::getElement(
211+
sycl::detail::declptr<nd_item<Dims>>());
211212
#else
212213
throw sycl::exception(
213214
sycl::make_error_code(sycl::errc::feature_not_supported),

sycl/test/basic_tests/free_function_queries/free_function_queries_interface.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ template <template <int, bool = true> class Item, int Dims> void test() {
5353
"Wrong return type of free function query for Item");
5454
}
5555

56-
int main() {
56+
SYCL_EXTERNAL void test_all() {
5757
test<sycl::id>(this_id_caller<1>{});
5858
test<sycl::id>(this_id_caller<2>{});
5959
test<sycl::id>(this_id_caller<3>{});

0 commit comments

Comments
 (0)