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

How to implement own c/cuda module in cunn and nn? #485

Open
mbcel opened this issue Oct 8, 2017 · 0 comments
Open

How to implement own c/cuda module in cunn and nn? #485

mbcel opened this issue Oct 8, 2017 · 0 comments

Comments

@mbcel
Copy link

mbcel commented Oct 8, 2017

I implemented my own module for the nn/cunn package. Therefore I wrote the MyModule_updateOutput() and MyModule_updateGradInput() functions in the .c and .cu files and I call them from MyModule.lua file.

That all works so far but I have problems or don't know in what files I have to include/register this module. Because I get the error

not found: THNN_CudaMyModule_updateGradInput/home/marcel/torch/install/share/lua/5.1/nn/THNN.lua:108: /home/marcel/torch/install/lib/lua/5.1/libTHCUNN.so: undefined symbol: THNN_CudaMyModule_updateGradInput
not found: THNN_CudaMyModule_updateOutput/home/marcel/torch/install/share/lua/5.1/nn/THNN.lua:108: /home/marcel/torch/install/lib/lua/5.1/libTHCUNN.so: undefined symbol: THNN_CudaMyModule_updateOutput
...
.../install/share/lua/5.1/nn/MyModule.lua:24: attempt to index field 'THNN' (a nil value)

which points to the line that the MyModule_updateOutput() .cu cennot be called in the .lua file because input.THNN is nil.

I registered/included the module here:

  • cunn/generic/THCUNN.h
  • nn/init.lua
  • nn/lib/THNN/init.c
  • nn/lib/THNN/generic/THNN.h

then I build nn first and cunn second.

am I missing something?

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

No branches or pull requests

1 participant