-
Notifications
You must be signed in to change notification settings - Fork 29
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
nsimd defines i64
etc. in global namespace
#84
Comments
We thought of that during the first drafts of NSIMD. I agree that it is not that good to pollute the global namespace. But when programming in plain C typing for (int i = 0; i < n; i+= vlen(nsimd_f32)) {
vec(nsimd_f32) va, vb;
va = vloadu(ptr_a + i, nsimd_f32);
vb = vloadu(ptr_b + i, nsimd_f32);
vstore(ptr_dst + i, vadd(va, vb, nsimd_f32));
} |
In C++, they could be in a namespace. Using that namespace would then make it easy to access these types. In C, there could be a separate include file
This behaviour is not causing a problem for me, but it is somewhat at odds with the otherwise very clean design of the library. |
This also conflicts with C++17 We should either prefix these with void f() {
nsimd::types::u8 a;
nsimd::u8 b;
{
using nsimd::types;
u8 c;
}
} |
It seems that nsimd defines types
i64
etc. in the global namespace (see filensimd.h
, lines 793 ff.). These should probably be prefixed withnsimd_
.The text was updated successfully, but these errors were encountered: