Skip to content
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

Expose provider factory C API, especially for CUDA users #1461

Merged

Conversation

shahasad
Copy link
Contributor

Description: Describe your changes.

Motivation and Context

@shahasad shahasad requested a review from a team as a code owner July 22, 2019 19:58
@pranavsharma
Copy link
Contributor

Why did we have to move the provider factory header files to session?
It's fine to copy them to the include folder during packaging time.

@shahasad
Copy link
Contributor Author

Why did we have to move the provider factory header files to session?
It's fine to copy them to the include folder during packaging time.

They need to refer to the onnxruntime_c_api.h without sourc-tree path. I think these headers are not included in any of the .cc files, so build won't currently break if I do this. However, if someone tries to include them in any source file, the build will break.

include_directories(${ONNXRUNTIME_INCLUDE_DIR})
include_directories(
${ONNXRUNTIME_INCLUDE_DIR}
${REPO_ROOT}/include/onnxruntime/core/session
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this change is needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless we refactor the provider_factory headers, they need to include the onnxruntime_c_api.h. we don't want to export all the path structure in the package, rather put header files under the root. So they need to include the c_api.h without path. To get the current build working, we thus need to put the core/session in the include path.

Cleaner option would be to completely separate out the c_api.h and provider_factory headers in the root of the include similar to what we export. Would defer that to some change that refactors the providers.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a hack. It's ok for now, but we should fix it at a later time.

@shahasad shahasad merged commit 768ced7 into master Jul 23, 2019
@yuslepukhin yuslepukhin deleted the dev/shahasad/fix-missing-header-file-for-win-gpu-build branch August 6, 2019 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants