Comments (3)
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 nsimd_
each time is not that great and differentiating the C and the C++ APIs (having f32
in plain but not in C++) seems a bad idea too but I am open to suggestions:
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));
}
from nsimd.
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 nsimd_types.h
with #define
s that would remove the suffix. Alternatively, there could be a #define
that either enables or disables this behaviour, depending on the default you choose:
#define NSIMD_GLOBAL_TYPES
#include <nsimd/nsimd_all.h>
This behaviour is not causing a problem for me, but it is somewhat at odds with the otherwise very clean design of the library.
from nsimd.
This also conflicts with C++17 u8
character literal for UTF-8 strings.
We should either prefix these with nsimd_
or put them in a namespace inlined in nsimd
that can be pulled with using
. The latter would allow using the nice version when possible (I assume most of the time).
void f() {
nsimd::types::u8 a;
nsimd::u8 b;
{
using nsimd::types;
u8 c;
}
}
from nsimd.
Related Issues (20)
- Performance different on X86 and ARM service HOT 2
- Vector<nsimd::pack<T>> HOT 4
- Support Reg Size /2 HOT 1
- NSIMD generates too much assembly HOT 5
- There is not ‘&’ bitwise operator for ’packl‘ type and no conversion of 'pack' and 'packl' type
- Provide a C11 API for core
- NSIMD SVE intrinsics generates movprfx HOT 3
- Provide cbrt HOT 1
- Provide += operators etc.
- mask_for_loop_tail produces scalar code HOT 2
- Provide fabs, fmax, fmin HOT 2
- Use Sleef math functions to complete NSIMD
- Provide more "inline" operators such as copysign, isfinite, etc... HOT 2
- Implement a `flipsign` function HOT 1
- Provide a constexpr size function HOT 4
- Compile nsimd-2.2 on the ARM server HOT 2
- Document "andnot"
- Calculate i32 horizontal sum in nsimd. HOT 3
- Feature request: allow logical arguments for if_else1 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nsimd.