Skip to content

Commit 0410c70

Browse files
authored
[NFC][UR] Don't check for __cplusplus in cpp files (#19112)
Unless something has gone terribly wrong, the compiler used to compile cpp files will be a cpp compiler.
1 parent 036370d commit 0410c70

File tree

9 files changed

+4
-34
lines changed

9 files changed

+4
-34
lines changed

unified-runtime/scripts/templates/ldrddi.cpp.mako

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,7 @@ namespace ur_loader
9090
%endfor
9191
} // namespace ur_loader
9292

93-
#if defined(__cplusplus)
9493
extern "C" {
95-
#endif
9694

9795
%for tbl in th.get_pfntables(specs, meta, n, tags):
9896
%if 'guard' in tbl:
@@ -176,6 +174,4 @@ ${tbl['export']['name']}(
176174

177175
%endfor
178176

179-
#if defined(__cplusplus)
180177
}
181-
#endif

unified-runtime/scripts/templates/mockddi.cpp.mako

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,7 @@ namespace driver
162162
%endfor
163163
} // namespace driver
164164

165-
#if defined(__cplusplus)
166165
extern "C" {
167-
#endif
168166

169167
%for tbl in th.get_pfntables(specs, meta, n, tags):
170168
%if 'guard' in tbl:
@@ -218,6 +216,4 @@ try {
218216
%endif
219217

220218
%endfor
221-
#if defined(__cplusplus)
222219
}
223-
#endif

unified-runtime/scripts/templates/ur_interface_loader.cpp.mako

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ static ur_result_t validateProcInputs(ur_api_version_t version, void *pDdiTable)
3838

3939
#ifdef UR_STATIC_ADAPTER_${Adapter}
4040
namespace ${n}::${adapter} {
41-
#elif defined(__cplusplus)
41+
#else
4242
extern "C" {
4343
#endif
4444

@@ -77,7 +77,7 @@ ${X}_APIEXPORT ${x}_result_t ${X}_APICALL ${tbl['export']['name']}(
7777

7878
#ifdef UR_STATIC_ADAPTER_${Adapter}
7979
} // namespace ur::${adapter}
80-
#elif defined(__cplusplus)
80+
#else
8181
} // extern "C"
8282
#endif
8383

unified-runtime/source/adapters/cuda/ur_interface_loader.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@ ur_result_t validateProcInputs(ur_api_version_t version, void *pDdiTable) {
2929
}
3030
} // namespace
3131

32-
#if defined(__cplusplus)
3332
extern "C" {
34-
#endif
3533

3634
UR_DLLEXPORT ur_result_t UR_APICALL urGetPlatformProcAddrTable(
3735
ur_api_version_t version, ur_platform_dditable_t *pDdiTable) {
@@ -487,9 +485,7 @@ UR_DLLEXPORT ur_result_t UR_APICALL urAllAddrTable(ur_api_version_t version,
487485
return UR_RESULT_SUCCESS;
488486
}
489487

490-
#if defined(__cplusplus)
491488
} // extern "C"
492-
#endif
493489

494490
const ur_dditable_t *ur::cuda::ddi_getter::value() {
495491
static std::once_flag flag;

unified-runtime/source/adapters/hip/ur_interface_loader.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@ ur_result_t validateProcInputs(ur_api_version_t version, void *pDdiTable) {
2929
}
3030
} // namespace
3131

32-
#if defined(__cplusplus)
3332
extern "C" {
34-
#endif
3533

3634
UR_DLLEXPORT ur_result_t UR_APICALL urGetPlatformProcAddrTable(
3735
ur_api_version_t version, ur_platform_dditable_t *pDdiTable) {
@@ -480,9 +478,7 @@ UR_DLLEXPORT ur_result_t UR_APICALL urAllAddrTable(ur_api_version_t version,
480478
return UR_RESULT_SUCCESS;
481479
}
482480

483-
#if defined(__cplusplus)
484481
} // extern "C"
485-
#endif
486482

487483
const ur_dditable_t *ur::hip::ddi_getter::value() {
488484
static std::once_flag flag;

unified-runtime/source/adapters/level_zero/ur_interface_loader.cpp

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

unified-runtime/source/adapters/mock/ur_mockddi.cpp

Lines changed: 0 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

unified-runtime/source/adapters/opencl/ur_interface_loader.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@ ur_result_t validateProcInputs(ur_api_version_t Version, void *pDdiTable) {
2929
}
3030
} // namespace
3131

32-
#if defined(__cplusplus)
3332
extern "C" {
34-
#endif
3533

3634
UR_DLLEXPORT ur_result_t UR_APICALL urGetAdapterProcAddrTable(
3735
ur_api_version_t version, ur_adapter_dditable_t *pDdiTable) {
@@ -467,9 +465,7 @@ UR_DLLEXPORT ur_result_t UR_APICALL urAllAddrTable(ur_api_version_t version,
467465
return UR_RESULT_SUCCESS;
468466
}
469467

470-
#if defined(__cplusplus)
471468
} // extern "C"
472-
#endif
473469

474470
const ur_dditable_t *ur::opencl::ddi_getter::value() {
475471
static std::once_flag flag;

unified-runtime/source/loader/ur_ldrddi.cpp

Lines changed: 0 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)