Skip to content

[NFC][UR] Don't check for __cplusplus in cpp files #19112

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: sycl
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions unified-runtime/scripts/templates/ldrddi.cpp.mako
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -179,6 +177,4 @@ ${tbl['export']['name']}(

%endfor

#if defined(__cplusplus)
}
#endif
4 changes: 0 additions & 4 deletions unified-runtime/scripts/templates/mockddi.cpp.mako
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -218,6 +216,4 @@ try {
%endif

%endfor
#if defined(__cplusplus)
}
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 0 additions & 4 deletions unified-runtime/source/adapters/hip/ur_interface_loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions unified-runtime/source/adapters/mock/ur_mockddi.cpp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
Expand Down
5 changes: 0 additions & 5 deletions unified-runtime/source/loader/ur_ldrddi.cpp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.