Skip to content

Commit d25a336

Browse files
authored
[SYCL][CUDA] Remove SYCL dependencies from CUDA UR adapter (#10135)
This was preventing out-of-tree build of the adapter for standalone use with unified runtime. Signed-off-by: Piotr Balcer <piotr.balcer@intel.com>
1 parent 8d77da7 commit d25a336

File tree

11 files changed

+167
-177
lines changed

11 files changed

+167
-177
lines changed

sycl/plugins/unified_runtime/ur/adapters/cuda/command_buffer.cpp

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -19,35 +19,35 @@ UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferCreateExp(
1919
(void)hDevice;
2020
(void)pCommandBufferDesc;
2121
(void)phCommandBuffer;
22-
sycl::detail::ur::die("Experimental Command-buffer feature is not "
23-
"implemented for CUDA adapter.");
22+
detail::ur::die("Experimental Command-buffer feature is not "
23+
"implemented for CUDA adapter.");
2424
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
2525
}
2626

2727
UR_APIEXPORT ur_result_t UR_APICALL
2828
urCommandBufferRetainExp(ur_exp_command_buffer_handle_t hCommandBuffer) {
2929
(void)hCommandBuffer;
3030

31-
sycl::detail::ur::die("Experimental Command-buffer feature is not "
32-
"implemented for CUDA adapter.");
31+
detail::ur::die("Experimental Command-buffer feature is not "
32+
"implemented for CUDA adapter.");
3333
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
3434
}
3535

3636
UR_APIEXPORT ur_result_t UR_APICALL
3737
urCommandBufferReleaseExp(ur_exp_command_buffer_handle_t hCommandBuffer) {
3838
(void)hCommandBuffer;
3939

40-
sycl::detail::ur::die("Experimental Command-buffer feature is not "
41-
"implemented for CUDA adapter.");
40+
detail::ur::die("Experimental Command-buffer feature is not "
41+
"implemented for CUDA adapter.");
4242
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
4343
}
4444

4545
UR_APIEXPORT ur_result_t UR_APICALL
4646
urCommandBufferFinalizeExp(ur_exp_command_buffer_handle_t hCommandBuffer) {
4747
(void)hCommandBuffer;
4848

49-
sycl::detail::ur::die("Experimental Command-buffer feature is not "
50-
"implemented for CUDA adapter.");
49+
detail::ur::die("Experimental Command-buffer feature is not "
50+
"implemented for CUDA adapter.");
5151
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
5252
}
5353

@@ -68,8 +68,8 @@ UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferAppendKernelLaunchExp(
6868
(void)pSyncPointWaitList;
6969
(void)pSyncPoint;
7070

71-
sycl::detail::ur::die("Experimental Command-buffer feature is not "
72-
"implemented for CUDA adapter.");
71+
detail::ur::die("Experimental Command-buffer feature is not "
72+
"implemented for CUDA adapter.");
7373
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
7474
}
7575

@@ -86,8 +86,8 @@ UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferAppendMemcpyUSMExp(
8686
(void)pSyncPointWaitList;
8787
(void)pSyncPoint;
8888

89-
sycl::detail::ur::die("Experimental Command-buffer feature is not "
90-
"implemented for CUDA adapter.");
89+
detail::ur::die("Experimental Command-buffer feature is not "
90+
"implemented for CUDA adapter.");
9191
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
9292
}
9393

@@ -107,8 +107,8 @@ UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferAppendMembufferCopyExp(
107107
(void)pSyncPointWaitList;
108108
(void)pSyncPoint;
109109

110-
sycl::detail::ur::die("Experimental Command-buffer feature is not "
111-
"implemented for CUDA adapter.");
110+
detail::ur::die("Experimental Command-buffer feature is not "
111+
"implemented for CUDA adapter.");
112112
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
113113
}
114114

@@ -134,8 +134,8 @@ UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferAppendMembufferCopyRectExp(
134134
(void)pSyncPointWaitList;
135135
(void)pSyncPoint;
136136

137-
sycl::detail::ur::die("Experimental Command-buffer feature is not "
138-
"implemented for CUDA adapter.");
137+
detail::ur::die("Experimental Command-buffer feature is not "
138+
"implemented for CUDA adapter.");
139139
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
140140
}
141141

@@ -155,8 +155,8 @@ ur_result_t UR_APICALL urCommandBufferAppendMembufferWriteExp(
155155
(void)pSyncPointWaitList;
156156
(void)pSyncPoint;
157157

158-
sycl::detail::ur::die("Experimental Command-buffer feature is not "
159-
"implemented for CUDA adapter.");
158+
detail::ur::die("Experimental Command-buffer feature is not "
159+
"implemented for CUDA adapter.");
160160
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
161161
}
162162

@@ -175,8 +175,8 @@ ur_result_t UR_APICALL urCommandBufferAppendMembufferReadExp(
175175
(void)pSyncPointWaitList;
176176
(void)pSyncPoint;
177177

178-
sycl::detail::ur::die("Experimental Command-buffer feature is not "
179-
"implemented for CUDA adapter.");
178+
detail::ur::die("Experimental Command-buffer feature is not "
179+
"implemented for CUDA adapter.");
180180
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
181181
}
182182

@@ -203,8 +203,8 @@ ur_result_t UR_APICALL urCommandBufferAppendMembufferWriteRectExp(
203203
(void)pSyncPointWaitList;
204204
(void)pSyncPoint;
205205

206-
sycl::detail::ur::die("Experimental Command-buffer feature is not "
207-
"implemented for CUDA adapter.");
206+
detail::ur::die("Experimental Command-buffer feature is not "
207+
"implemented for CUDA adapter.");
208208
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
209209
}
210210

@@ -232,8 +232,8 @@ ur_result_t UR_APICALL urCommandBufferAppendMembufferReadRectExp(
232232
(void)pSyncPointWaitList;
233233
(void)pSyncPoint;
234234

235-
sycl::detail::ur::die("Experimental Command-buffer feature is not "
236-
"implemented for CUDA adapter.");
235+
detail::ur::die("Experimental Command-buffer feature is not "
236+
"implemented for CUDA adapter.");
237237
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
238238
}
239239

@@ -247,7 +247,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferEnqueueExp(
247247
(void)phEventWaitList;
248248
(void)phEvent;
249249

250-
sycl::detail::ur::die("Experimental Command-buffer feature is not "
251-
"implemented for CUDA adapter.");
250+
detail::ur::die("Experimental Command-buffer feature is not "
251+
"implemented for CUDA adapter.");
252252
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
253253
}

sycl/plugins/unified_runtime/ur/adapters/cuda/common.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,17 +72,17 @@ std::string getCudaVersionString() {
7272
return stream.str();
7373
}
7474

75-
void sycl::detail::ur::die(const char *Message) {
75+
void detail::ur::die(const char *Message) {
7676
std::cerr << "ur_die: " << Message << std::endl;
7777
std::terminate();
7878
}
7979

80-
void sycl::detail::ur::assertion(bool Condition, const char *Message) {
80+
void detail::ur::assertion(bool Condition, const char *Message) {
8181
if (!Condition)
8282
die(Message);
8383
}
8484

85-
void sycl::detail::ur::cuPrint(const char *Message) {
85+
void detail::ur::cuPrint(const char *Message) {
8686
std::cerr << "ur_print: " << Message << std::endl;
8787
}
8888

sycl/plugins/unified_runtime/ur/adapters/cuda/common.hpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
#pragma once
99

1010
#include <cuda.h>
11-
#include <sycl/detail/defines.hpp>
1211
#include <ur/ur.hpp>
1312

1413
ur_result_t mapErrorUR(CUresult Result);
@@ -39,8 +38,6 @@ extern thread_local char ErrorMessage[MaxMessageSize];
3938
void setPluginSpecificMessage(CUresult cu_res);
4039

4140
/// ------ Error handling, matching OpenCL plugin semantics.
42-
namespace sycl {
43-
__SYCL_INLINE_VER_NAMESPACE(_V1) {
4441
namespace detail {
4542
namespace ur {
4643

@@ -57,5 +54,3 @@ void assertion(bool Condition, const char *Message = nullptr);
5754

5855
} // namespace ur
5956
} // namespace detail
60-
} // __SYCL_INLINE_VER_NAMESPACE(_V1)
61-
} // namespace sycl

sycl/plugins/unified_runtime/ur/adapters/cuda/context.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urContextGetInfo(
6262
}
6363
case UR_CONTEXT_INFO_ATOMIC_MEMORY_SCOPE_CAPABILITIES: {
6464
int Major = 0;
65-
sycl::detail::ur::assertion(
65+
detail::ur::assertion(
6666
cuDeviceGetAttribute(&Major,
6767
CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR,
6868
hContext->getDevice()->get()) == CUDA_SUCCESS);

0 commit comments

Comments
 (0)