mirror of
https://github.com/paboyle/Grid.git
synced 2025-04-09 21:50:45 +01:00
Use Grid Integer type
This commit is contained in:
parent
0796696733
commit
95625a7bd1
@ -63,7 +63,7 @@ namespace Optimization {
|
|||||||
constexpr static unsigned int c = GEN_SIMD_WIDTH/8u;
|
constexpr static unsigned int c = GEN_SIMD_WIDTH/8u;
|
||||||
constexpr static unsigned int r = GEN_SIMD_WIDTH/4u;
|
constexpr static unsigned int r = GEN_SIMD_WIDTH/4u;
|
||||||
};
|
};
|
||||||
template <> struct W<int> {
|
template <> struct W<Integer> {
|
||||||
constexpr static unsigned int r = GEN_SIMD_WIDTH/4u;
|
constexpr static unsigned int r = GEN_SIMD_WIDTH/4u;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -75,6 +75,6 @@ namespace Optimization {
|
|||||||
|
|
||||||
typedef vec<float> vecf;
|
typedef vec<float> vecf;
|
||||||
typedef vec<double> vecd;
|
typedef vec<double> vecd;
|
||||||
typedef vec<int> veci;
|
typedef vec<Integer> veci;
|
||||||
|
|
||||||
}}
|
}}
|
||||||
|
@ -72,7 +72,7 @@ namespace Optimization {
|
|||||||
inline veci operator()(Integer a){
|
inline veci operator()(Integer a){
|
||||||
veci out;
|
veci out;
|
||||||
|
|
||||||
VECTOR_FOR(i, W<int>::r, 1)
|
VECTOR_FOR(i, W<Integer>::r, 1)
|
||||||
{
|
{
|
||||||
out.v[i] = a;
|
out.v[i] = a;
|
||||||
}
|
}
|
||||||
@ -220,7 +220,7 @@ namespace Optimization {
|
|||||||
inline veci operator()(veci a, veci b){
|
inline veci operator()(veci a, veci b){
|
||||||
veci out;
|
veci out;
|
||||||
|
|
||||||
VECTOR_FOR(i, W<int>::r, 1)
|
VECTOR_FOR(i, W<Integer>::r, 1)
|
||||||
{
|
{
|
||||||
out.v[i] = a.v[i] + b.v[i];
|
out.v[i] = a.v[i] + b.v[i];
|
||||||
}
|
}
|
||||||
@ -242,7 +242,7 @@ namespace Optimization {
|
|||||||
inline veci operator()(veci a, veci b){
|
inline veci operator()(veci a, veci b){
|
||||||
veci out;
|
veci out;
|
||||||
|
|
||||||
VECTOR_FOR(i, W<int>::r, 1)
|
VECTOR_FOR(i, W<Integer>::r, 1)
|
||||||
{
|
{
|
||||||
out.v[i] = a.v[i] - b.v[i];
|
out.v[i] = a.v[i] - b.v[i];
|
||||||
}
|
}
|
||||||
@ -282,7 +282,7 @@ namespace Optimization {
|
|||||||
inline veci operator()(veci a, veci b){
|
inline veci operator()(veci a, veci b){
|
||||||
veci out;
|
veci out;
|
||||||
|
|
||||||
VECTOR_FOR(i, W<int>::r, 1)
|
VECTOR_FOR(i, W<Integer>::r, 1)
|
||||||
{
|
{
|
||||||
out.v[i] = a.v[i]*b.v[i];
|
out.v[i] = a.v[i]*b.v[i];
|
||||||
}
|
}
|
||||||
@ -304,7 +304,7 @@ namespace Optimization {
|
|||||||
inline veci operator()(veci a, veci b){
|
inline veci operator()(veci a, veci b){
|
||||||
veci out;
|
veci out;
|
||||||
|
|
||||||
VECTOR_FOR(i, W<int>::r, 1)
|
VECTOR_FOR(i, W<Integer>::r, 1)
|
||||||
{
|
{
|
||||||
out.v[i] = a.v[i]/b.v[i];
|
out.v[i] = a.v[i]/b.v[i];
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user