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

Add more convenience math functions #159

Merged
merged 8 commits into from
Mar 10, 2014
Merged

Add more convenience math functions #159

merged 8 commits into from
Mar 10, 2014

Conversation

kloudkl
Copy link
Contributor

@kloudkl kloudkl commented Feb 25, 2014

To fulfill the requests of the issue #146, the following math functions are added and tested: __builtin_popcount* based fast hamming distance, sum of absolute values, element wise sign and fabs, and non-in-place scaling.

Note the cherry pick from the boost-eigen branch. The commit was authored by Rowland Depp. I think it is time to merge the branch into either dev or master.

#include <mkl.h>
#include <cublas_v2.h>

#define USE_MKL
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be defined someplace else, probably Makefile.config

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Commit 4493ab5 (Remove mkl_alternate and move the define func macros to mkl_functions)
deleted the define.

@Yangqing
Copy link
Member

Question - why are all files showing as "all adds" instead of modifications? This makes reviewing quite hard.

@kloudkl
Copy link
Contributor Author

kloudkl commented Feb 25, 2014

The latest commit 4493ab5 (Remove mkl_alternate and move the define func macros to mkl_functions) avoided the confusion of adding mkl_alternate.hpp. Please make further comments.

@shelhamer
Copy link
Member

@kloudkl @Yangqing boost-eigen should most likely be merged into dev before this to make the history more clear and avoid the confusion of the copy-paste cherry picking. I'll look into doing it in such a way that osx 10.9 developers will have a workaround to compile.

@kloudkl
Copy link
Contributor Author

kloudkl commented Feb 25, 2014

As pointed out in my previous comment, commit 4493ab5 deleted all the copied contents from the boost-eigen branch to make this PR independent of other issues or PRs. So there is no more urgent need to merge that branch before this.

That being said, the long lasting feature branch boost-eigen has seen no contributing activities for a week and is obviously stabilized.

@shelhamer
Copy link
Member

@kloudkl, I did not miss your comment, but I could have explained better. I want boost-eigen in dev to make ongoing work compatible with the integration and avoid further conflicts in the future.

While your c0ceec1 and 4493ab5 manually accomplished this, it would have been unneeded if boost-eigen were already in. The manual code transplant confuses the history in my view, so ideally it could be rebased away, which would be easier if boost-eigen were merged to dev first. I will try this merge with an escape hatch for osx 10.9 to make development more convenient for you, us, and all active developers.

@sergeyk
Copy link
Contributor

sergeyk commented Feb 26, 2014

@shelhamer What's your ETA on what you're trying to do? Should we just merge this baby in? I feel bad about my Ubuntu-build-breaking HDF5 PR, and there's a commit here that fixes it.

@shelhamer
Copy link
Member

This is held on the boost-eigen merge right now. Sorry for the wait @kloudkl – this is a nice contribution. I'll write once boost-eigen is in so you can rebase and we can merge.

@kloudkl
Copy link
Contributor Author

kloudkl commented Mar 4, 2014

Rebased and tests passed.

shelhamer added a commit that referenced this pull request Mar 10, 2014
Add more convenience math functions: hamming distance, sum of absolute values, elementwise sign and abs, and non-in-place scaling.
@shelhamer shelhamer merged commit 980c00d into BVLC:dev Mar 10, 2014
@shelhamer
Copy link
Member

Thanks for the further math functions, and comment clarifying the history of the unary function macros. This might cause a slight conflict in the merge of boost-eigen, but that already has its problems and wasn't worth waiting for.

@shelhamer
Copy link
Member

@kloudkl this doesn't actually build. The break is at c9d9056 according to git bisect, so it seems to be a problem with the gpu macro.

make: *** Waiting for unfinished jobs....
./include/caffe/util/math_functions.hpp(168): error: expected an identifier

@shelhamer
Copy link
Member

@kloudkl I removed this PR from dev given the aforementioned build error. Please open a new PR once the problem is fixed. Thanks again for the contributed functions–looking forward to merging the fixed version.

Note that your demos #141 might conflict with this branch by the implementation of the hamming distance there. Since it is a nice demo, we would like to merge it soon, but please make sure that both are clean merges.

@kloudkl
Copy link
Contributor Author

kloudkl commented Mar 11, 2014

Thanks for your review!

I am very sorry for not testing again after rebasing. The new PR that resolves both of your concerns is #201.

gheinrich pushed a commit to gheinrich/caffe that referenced this pull request Jun 7, 2016
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.

5 participants