diff --git a/unified-runtime/scripts/templates/ldrddi.cpp.mako b/unified-runtime/scripts/templates/ldrddi.cpp.mako index d70586aa77f79..8ca82ed53a924 100644 --- a/unified-runtime/scripts/templates/ldrddi.cpp.mako +++ b/unified-runtime/scripts/templates/ldrddi.cpp.mako @@ -93,9 +93,7 @@ namespace ur_loader %endfor } // namespace ur_loader -#if defined(__cplusplus) extern "C" { -#endif %for tbl in th.get_pfntables(specs, meta, n, tags): %if 'guard' in tbl: @@ -179,6 +177,4 @@ ${tbl['export']['name']}( %endfor -#if defined(__cplusplus) } -#endif diff --git a/unified-runtime/scripts/templates/mockddi.cpp.mako b/unified-runtime/scripts/templates/mockddi.cpp.mako index b405406682345..b636e673d1b28 100644 --- a/unified-runtime/scripts/templates/mockddi.cpp.mako +++ b/unified-runtime/scripts/templates/mockddi.cpp.mako @@ -162,9 +162,7 @@ namespace driver %endfor } // namespace driver -#if defined(__cplusplus) extern "C" { -#endif %for tbl in th.get_pfntables(specs, meta, n, tags): %if 'guard' in tbl: @@ -218,6 +216,4 @@ try { %endif %endfor -#if defined(__cplusplus) } -#endif diff --git a/unified-runtime/scripts/templates/ur_interface_loader.cpp.mako b/unified-runtime/scripts/templates/ur_interface_loader.cpp.mako index 2a26442985f75..a1fbf1d07c407 100644 --- a/unified-runtime/scripts/templates/ur_interface_loader.cpp.mako +++ b/unified-runtime/scripts/templates/ur_interface_loader.cpp.mako @@ -38,7 +38,7 @@ static ur_result_t validateProcInputs(ur_api_version_t version, void *pDdiTable) #ifdef UR_STATIC_ADAPTER_${Adapter} namespace ${n}::${adapter} { -#elif defined(__cplusplus) +#else extern "C" { #endif @@ -77,7 +77,7 @@ ${X}_APIEXPORT ${x}_result_t ${X}_APICALL ${tbl['export']['name']}( #ifdef UR_STATIC_ADAPTER_${Adapter} } // namespace ur::${adapter} -#elif defined(__cplusplus) +#else } // extern "C" #endif diff --git a/unified-runtime/source/adapters/cuda/ur_interface_loader.cpp b/unified-runtime/source/adapters/cuda/ur_interface_loader.cpp index e60bdd11c59d7..38903fe2e3722 100644 --- a/unified-runtime/source/adapters/cuda/ur_interface_loader.cpp +++ b/unified-runtime/source/adapters/cuda/ur_interface_loader.cpp @@ -29,9 +29,7 @@ ur_result_t validateProcInputs(ur_api_version_t version, void *pDdiTable) { } } // namespace -#if defined(__cplusplus) extern "C" { -#endif UR_DLLEXPORT ur_result_t UR_APICALL urGetPlatformProcAddrTable( ur_api_version_t version, ur_platform_dditable_t *pDdiTable) { @@ -485,9 +483,7 @@ UR_DLLEXPORT ur_result_t UR_APICALL urAllAddrTable(ur_api_version_t version, return UR_RESULT_SUCCESS; } -#if defined(__cplusplus) } // extern "C" -#endif const ur_dditable_t *ur::cuda::ddi_getter::value() { static std::once_flag flag; diff --git a/unified-runtime/source/adapters/hip/ur_interface_loader.cpp b/unified-runtime/source/adapters/hip/ur_interface_loader.cpp index be4491d4a7985..5b1372e611226 100644 --- a/unified-runtime/source/adapters/hip/ur_interface_loader.cpp +++ b/unified-runtime/source/adapters/hip/ur_interface_loader.cpp @@ -29,9 +29,7 @@ ur_result_t validateProcInputs(ur_api_version_t version, void *pDdiTable) { } } // namespace -#if defined(__cplusplus) extern "C" { -#endif UR_DLLEXPORT ur_result_t UR_APICALL urGetPlatformProcAddrTable( ur_api_version_t version, ur_platform_dditable_t *pDdiTable) { @@ -478,9 +476,7 @@ UR_DLLEXPORT ur_result_t UR_APICALL urAllAddrTable(ur_api_version_t version, return UR_RESULT_SUCCESS; } -#if defined(__cplusplus) } // extern "C" -#endif const ur_dditable_t *ur::hip::ddi_getter::value() { static std::once_flag flag; diff --git a/unified-runtime/source/adapters/level_zero/ur_interface_loader.cpp b/unified-runtime/source/adapters/level_zero/ur_interface_loader.cpp index fd3c5b126e1b1..a2ed4db446721 100644 --- a/unified-runtime/source/adapters/level_zero/ur_interface_loader.cpp +++ b/unified-runtime/source/adapters/level_zero/ur_interface_loader.cpp @@ -29,7 +29,7 @@ static ur_result_t validateProcInputs(ur_api_version_t version, #ifdef UR_STATIC_ADAPTER_LEVEL_ZERO namespace ur::level_zero { -#elif defined(__cplusplus) +#else extern "C" { #endif @@ -530,7 +530,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urGetDeviceProcAddrTable( #ifdef UR_STATIC_ADAPTER_LEVEL_ZERO } // namespace ur::level_zero -#elif defined(__cplusplus) +#else } // extern "C" #endif diff --git a/unified-runtime/source/adapters/mock/ur_mockddi.cpp b/unified-runtime/source/adapters/mock/ur_mockddi.cpp index b135876828efb..e281bc69e8a69 100644 --- a/unified-runtime/source/adapters/mock/ur_mockddi.cpp +++ b/unified-runtime/source/adapters/mock/ur_mockddi.cpp @@ -11844,9 +11844,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueNativeCommandExp( } // namespace driver -#if defined(__cplusplus) extern "C" { -#endif /////////////////////////////////////////////////////////////////////////////// /// @brief Exported function for filling application's Adapter table @@ -12826,7 +12824,4 @@ UR_DLLEXPORT ur_result_t UR_APICALL urGetDeviceProcAddrTable( } catch (...) { return exceptionToResult(std::current_exception()); } - -#if defined(__cplusplus) } -#endif diff --git a/unified-runtime/source/adapters/opencl/ur_interface_loader.cpp b/unified-runtime/source/adapters/opencl/ur_interface_loader.cpp index f74876d53d541..05117dd829dd5 100644 --- a/unified-runtime/source/adapters/opencl/ur_interface_loader.cpp +++ b/unified-runtime/source/adapters/opencl/ur_interface_loader.cpp @@ -29,9 +29,7 @@ ur_result_t validateProcInputs(ur_api_version_t Version, void *pDdiTable) { } } // namespace -#if defined(__cplusplus) extern "C" { -#endif UR_DLLEXPORT ur_result_t UR_APICALL urGetAdapterProcAddrTable( 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, return UR_RESULT_SUCCESS; } -#if defined(__cplusplus) } // extern "C" -#endif const ur_dditable_t *ur::opencl::ddi_getter::value() { static std::once_flag flag; diff --git a/unified-runtime/source/loader/ur_ldrddi.cpp b/unified-runtime/source/loader/ur_ldrddi.cpp index 34bec7392eccc..db5b659df65e9 100644 --- a/unified-runtime/source/loader/ur_ldrddi.cpp +++ b/unified-runtime/source/loader/ur_ldrddi.cpp @@ -5709,9 +5709,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueNativeCommandExp( } // namespace ur_loader -#if defined(__cplusplus) extern "C" { -#endif /////////////////////////////////////////////////////////////////////////////// /// @brief Exported function for filling application's Adapter table @@ -7011,7 +7009,4 @@ UR_DLLEXPORT ur_result_t UR_APICALL urGetDeviceProcAddrTable( return result; } - -#if defined(__cplusplus) } -#endif