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

Fix windows link error by expose the entry point for REGISTER_NODE_TYPE #1562

Merged
merged 1 commit into from
Aug 8, 2018

Conversation

souptc
Copy link
Contributor

@souptc souptc commented Aug 7, 2018

This PR is to fix issue #1547 , The original plan is to expose the dmlc::Registry::Get symbol in dmlc-core project, but later I found it does not work because nnvm is not only the consumer of dmlc::Registry symbol, but also need to enable registry on some new types, like:
DMLC_REGISTRY_ENABLE(nnvm::PassFunctionReg);

If we add MACRO like DMLC_DLL in registry.h, it will fail in nnvm because Windows does not allow to implement a function that declared as dllimport. I am currently use a workaround that in tvm lib, we expose another method that allow other component to access the dmlc::Registry<::tvm::NodeFactoryReg> instance, so nnvm could consume that one instead directly invoke the Get method in dmlc header file.

This is the simplest solution I can think of at this moment, but not sure does it align with tvm's design. Let me know if you have any concern.

@tqchen tqchen merged commit 60da470 into apache:master Aug 8, 2018
@tqchen
Copy link
Member

tqchen commented Aug 8, 2018

Thanks @souptc for the contribution! This works, and is merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants