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 abs with char and short cuda types. #747

Merged
merged 1 commit into from
Apr 12, 2017
Merged

Conversation

gchanan
Copy link
Contributor

@gchanan gchanan commented Apr 12, 2017

Fixes #746.

I'm not really sure how the current code doesn't infinite loop (compiler optimizes it away? It infinite loops for me if I try to printf in there).

There are also two abs functions defined: see: http://stackoverflow.com/questions/8226705/g-abs-on-a-short-int-appears-to-turn-it-into-a-double.

We want the int one; the template version doesn't compile since you get errors like: "calling a host function("std::abs ") from a global function("kernelPointwiseApply2< ::Tensor_abs_Short_Op, short, short, unsigned int, (int)-1, (int)2> ") is not allowed"

@soumith soumith merged commit 8f9a4fa into torch:master Apr 12, 2017
@soumith
Copy link
Member

soumith commented Apr 12, 2017

ha! good catch.

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.

2 participants