Skip to content

Commit 404f93f

Browse files
author
Alexander Batashev
authored
[SYCL] Fix inline namespaces (#1525)
Signed-off-by: Alexander Batashev <alexander.batashev@intel.com>
1 parent eeca872 commit 404f93f

File tree

5 files changed

+13
-10
lines changed

5 files changed

+13
-10
lines changed

sycl/include/CL/sycl/backend_types.hpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@
88

99
#pragma once
1010

11-
namespace cl {
11+
#include <CL/sycl/detail/defines.hpp>
12+
13+
__SYCL_INLINE_NAMESPACE(cl) {
1214
namespace sycl {
1315

1416
enum class backend { host, opencl, cuda };
1517

1618
template <backend name, typename SYCLObjectT> struct interop;
1719

1820
} // namespace sycl
19-
} // namespace cl
21+
} // __SYCL_INLINE_NAMESPACE(cl)

sycl/include/CL/sycl/detail/cg.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,7 @@ class interop_handler {
7878
template <backend BackendName, typename DataT, int Dims,
7979
access::mode AccessMode, access::target AccessTarget,
8080
access::placeholder IsPlaceholder>
81-
__SYCL_EXPORT auto
82-
getMemImpl(detail::Requirement *Req) const -> typename interop<
81+
auto getMemImpl(detail::Requirement *Req) const -> typename interop<
8382
BackendName,
8483
accessor<DataT, Dims, AccessMode, AccessTarget, IsPlaceholder>>::type {
8584
return (typename interop<BackendName,

sycl/plugins/cuda/pi_cuda.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
/// \ingroup sycl_pi_cuda
1313

1414
#include <CL/sycl/detail/cuda_definitions.hpp>
15+
#include <CL/sycl/detail/defines.hpp>
1516
#include <CL/sycl/detail/pi.hpp>
1617
#include <pi_cuda.hpp>
1718

@@ -229,7 +230,7 @@ int getAttribute(pi_device device, CUdevice_attribute attribute) {
229230
} // anonymous namespace
230231

231232
/// ------ Error handling, matching OpenCL plugin semantics.
232-
namespace cl {
233+
__SYCL_INLINE_NAMESPACE(cl) {
233234
namespace sycl {
234235
namespace detail {
235236
namespace pi {
@@ -251,7 +252,7 @@ void assertion(bool Condition, const char *Message) {
251252
} // namespace pi
252253
} // namespace detail
253254
} // namespace sycl
254-
} // namespace cl
255+
} // __SYCL_INLINE_NAMESPACE(cl)
255256

256257
//--------------
257258
// PI object implementation

sycl/source/detail/cg.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
#include "CL/sycl/detail/cg.hpp"
9+
#include <CL/sycl/detail/cg.hpp>
10+
#include <CL/sycl/detail/defines.hpp>
1011
#include <CL/sycl/detail/memory_manager.hpp>
1112
#include <CL/sycl/detail/pi.hpp>
1213
#include <detail/queue_impl.hpp>
@@ -18,7 +19,7 @@
1819
#include <type_traits>
1920
#include <vector>
2021

21-
namespace cl {
22+
__SYCL_INLINE_NAMESPACE(cl) {
2223
namespace sycl {
2324

2425
pi_native_handle interop_handler::GetNativeQueue() const {
@@ -41,4 +42,4 @@ pi_native_handle interop_handler::GetNativeMem(detail::Requirement *Req) const {
4142
}
4243

4344
} // sycl
44-
} // cl
45+
} // __SYCL_INLINE_NAMESPACE(cl)

sycl/tools/get_device_count_by_type.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ int main(int argc, char *argv[]) {
193193
} else if (backend == "cuda" || backend == "pi_cuda") {
194194
querySuccess = queryCUDA(deviceType, deviceCount, msg);
195195
} else {
196-
msg + "ERROR: Unknown backend " + backend + "\n" + help + "\n";
196+
msg = "ERROR: Unknown backend " + backend + "\n" + help + "\n";
197197
}
198198

199199
std::cout << deviceCount << ":" << msg << std::endl;

0 commit comments

Comments
 (0)