Update nn to 5989f82800a640ed0f5613c8ef3e417c4502661d and cunn to 64224a65eff88d1bfe5bc47d26a901ed8c0b4705.
Update nn to 5989f82800a640ed0f5613c8ef3e417c4502661d and cunn to 64224a65eff88d1bfe5bc47d26a901ed8c0b4705.

Summary:
Update nn and cunn.
Also added NN_HEAD and CUNN_HEAD for tracking upstream sync points; I wrote some scripts to do this sync automatically,
but didn't commit them yet because they probably need some resume functionality for the cases where there are merge conflicts.

This required some reworking of how THCUNN is defined in TARGETS, i.e. the non-generic .cu files are the source files,
everything else is a header file.  And need to pass -I to the preprocessor for our macro definitions to work correctly.

Finally, needed to implement the equivalent of "Fix shared function override for specific modules" from nn in fbcunn,
otherwise some tests would fail with stack overflows.

Reviewed By: soumith

Differential Revision: D4438135

fbshipit-source-id: 06ea19bd5208d545087e3702044155116fbd83a2

facebook/fbcunn,facebook/fbcunn,facebook/fbcunn