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

Decide what to do with our default function conversion preference #135

Open
denisalevi opened this issue Jul 16, 2018 · 1 comment
Open

Comments

@denisalevi
Copy link
Member

denisalevi commented Jul 16, 2018

We have preference for all our default functions in device code (sin, cos etc.), which determines how to treat integral type arguments (those device functions only support float and double arguments, we implemented wrapper functions to convert integral types to floating point types, #45). This preference decides if integral types are converted to float or double. With floats we get fast single precision arithmetics, but might loose precision (we are warning in that case). With double we get correct precision but loose performance.

With the support for float32 types as default types everywhere, I feel like this the conversion preference becomes obsolete. Why should one only in default functions cast to float and use double elswhere? And when the default type is float, then the result form the default functions will be cast to float anyways, even if it was double before. Get rid of this preference all together? Need to check for the correct warnings in that case.

@denisalevi
Copy link
Member Author

brian2.tests.test_neurongroup.test_semantics_floor_division is currently failing since it checks for no warnings being printed. But in that test we print a warning because we encounter int64 to double convertion, which we can't avoid (since cuda doesn't support long double, still the case?).

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