2#ifndef STORMM_VECTOR_TYPES_H
3#define STORMM_VECTOR_TYPES_H
10#include <vector_types.h>
13#include "Reporting/error_format.h"
14#include "common_types.h"
95 unsigned long long int x;
96 unsigned long long int y;
100 unsigned long long int x;
101 unsigned long long int y;
102 unsigned long long int z;
106 unsigned long long int x;
107 unsigned long long int y;
108 unsigned long long int z;
109 unsigned long long int w;
185 unsigned short int x;
186 unsigned short int y;
190 unsigned short int x;
191 unsigned short int y;
192 unsigned short int z;
196 unsigned short int x;
197 unsigned short int y;
198 unsigned short int z;
199 unsigned short int w;
213static const size_t int2_type_index = std::type_index(
typeid(
int2)).hash_code();
214static const size_t int3_type_index = std::type_index(
typeid(
int3)).hash_code();
215static const size_t int4_type_index = std::type_index(
typeid(
int4)).hash_code();
216static const size_t double2_type_index = std::type_index(
typeid(
double2)).hash_code();
217static const size_t double3_type_index = std::type_index(
typeid(
double3)).hash_code();
218static const size_t double4_type_index = std::type_index(
typeid(
double4)).hash_code();
219static const size_t float2_type_index = std::type_index(
typeid(
float2)).hash_code();
220static const size_t float3_type_index = std::type_index(
typeid(
float3)).hash_code();
221static const size_t float4_type_index = std::type_index(
typeid(
float4)).hash_code();
222static const size_t char2_type_index = std::type_index(
typeid(
char2)).hash_code();
223static const size_t char3_type_index = std::type_index(
typeid(
char3)).hash_code();
224static const size_t char4_type_index = std::type_index(
typeid(
char4)).hash_code();
225static const size_t uchar2_type_index = std::type_index(
typeid(
uchar2)).hash_code();
226static const size_t uchar3_type_index = std::type_index(
typeid(
uchar3)).hash_code();
227static const size_t uchar4_type_index = std::type_index(
typeid(
uchar4)).hash_code();
228static const size_t uint2_type_index = std::type_index(
typeid(
uint2)).hash_code();
229static const size_t uint3_type_index = std::type_index(
typeid(
uint3)).hash_code();
230static const size_t uint4_type_index = std::type_index(
typeid(
uint4)).hash_code();
231static const size_t longlong2_type_index = std::type_index(
typeid(
longlong2)).hash_code();
232static const size_t longlong3_type_index = std::type_index(
typeid(
longlong3)).hash_code();
233static const size_t longlong4_type_index = std::type_index(
typeid(
longlong4)).hash_code();
234static const size_t ulonglong2_type_index = std::type_index(
typeid(
ulonglong2)).hash_code();
235static const size_t ulonglong3_type_index = std::type_index(
typeid(
ulonglong3)).hash_code();
236static const size_t ulonglong4_type_index = std::type_index(
typeid(
ulonglong4)).hash_code();
237static const size_t short2_type_index = std::type_index(
typeid(
short2)).hash_code();
238static const size_t short3_type_index = std::type_index(
typeid(
short3)).hash_code();
239static const size_t short4_type_index = std::type_index(
typeid(
short4)).hash_code();
240static const size_t ushort2_type_index = std::type_index(
typeid(
ushort2)).hash_code();
241static const size_t ushort3_type_index = std::type_index(
typeid(
ushort3)).hash_code();
242static const size_t ushort4_type_index = std::type_index(
typeid(
ushort4)).hash_code();
245template <
typename T>
bool isHpcVectorType();
248template <
typename T>
bool isSignedIntegralHpcVectorType();
251template <
typename T>
bool isUnsignedIntegralHpcVectorType();
254template <
typename T>
bool isFloatingPointHpcVectorType();
257template <
typename T>
int getHpcVectorTypeSize();
260template <
typename T> std::string getStormmHpcVectorTypeName();
273static const size_t int95t_type_index = std::type_index(
typeid(
int95_t)).hash_code();
277template <
typename T>
struct Vec2 {
282 template <
typename Tinput>
Vec2(
const Tinput v_in);
292template <
typename T>
struct Vec3 {
296 explicit Vec3(T x_in, T y_in, T z_in);
297 template <
typename Tinput>
Vec3(
const Tinput v_in);
307template <
typename T>
struct Vec4 {
311 explicit Vec4(T x_in, T y_in, T z_in, T w_in);
312 template <
typename Tinput>
Vec4(
const Tinput v_in);
332template <
typename T>
double2 vtConv2(
const T rhs);
333template <
typename T>
double3 vtConv3(
const T rhs);
334template <
typename T>
double4 vtConv4(
const T rhs);
335template <
typename T>
float2 vtConv2f(
const T rhs);
336template <
typename T>
float3 vtConv3f(
const T rhs);
337template <
typename T>
float4 vtConv4f(
const T rhs);
338template <
typename T> std::vector<double2> vtConv2(
const std::vector<T> &rhs);
339template <
typename T> std::vector<double3> vtConv3(
const std::vector<T> &rhs);
340template <
typename T> std::vector<double4> vtConv4(
const std::vector<T> &rhs);
341template <
typename T> std::vector<float2> vtConv2f(
const std::vector<T> &rhs);
342template <
typename T> std::vector<float3> vtConv3f(
const std::vector<T> &rhs);
343template <
typename T> std::vector<float4> vtConv4f(
const std::vector<T> &rhs);
350uint short2ToUint(
const short2 ituple);
351uint ushort2ToUint(
const ushort2 ituple);
352uint char4ToUint(
const char4 ctuple);
353uint uchar4ToUint(
const uchar4 ctuple);
360short2 uintToShort2(
const uint val);
361ushort2 uintToUshort2(
const uint val);
362char4 uintToChar4(
const uint val);
363uchar4 uintToUchar4(
const uint val);
385bool operator==(
const int2 lhs,
const int2 rhs);
386bool operator!=(
const int2 lhs,
const int2 rhs);
387bool operator==(
const int3 lhs,
const int3 rhs);
388bool operator!=(
const int3 lhs,
const int3 rhs);
389bool operator==(
const int4 lhs,
const int4 rhs);
390bool operator!=(
const int4 lhs,
const int4 rhs);
392bool operator==(
const uint2 lhs,
const uint2 rhs);
393bool operator!=(
const uint2 lhs,
const uint2 rhs);
394bool operator==(
const uint3 lhs,
const uint3 rhs);
395bool operator!=(
const uint3 lhs,
const uint3 rhs);
396bool operator==(
const uint4 lhs,
const uint4 rhs);
397bool operator!=(
const uint4 lhs,
const uint4 rhs);
399bool operator==(
const llint2 lhs,
const llint2 rhs);
400bool operator!=(
const llint2 lhs,
const llint2 rhs);
401bool operator==(
const llint3 lhs,
const llint3 rhs);
402bool operator!=(
const llint3 lhs,
const llint3 rhs);
403bool operator==(
const llint4 lhs,
const llint4 rhs);
404bool operator!=(
const llint4 lhs,
const llint4 rhs);
406bool operator==(
const ullint2 lhs,
const ullint2 rhs);
407bool operator!=(
const ullint2 lhs,
const ullint2 rhs);
408bool operator==(
const ullint3 lhs,
const ullint3 rhs);
409bool operator!=(
const ullint3 lhs,
const ullint3 rhs);
410bool operator==(
const ullint4 lhs,
const ullint4 rhs);
411bool operator!=(
const ullint4 lhs,
const ullint4 rhs);
413bool operator<(
const char4 lhs,
const char4 rhs);
414bool operator<=(
const char4 lhs,
const char4 rhs);
415bool operator>(
const char4 lhs,
const char4 rhs);
416bool operator>=(
const char4 lhs,
const char4 rhs);
417bool operator==(
const char4 lhs,
const char4 rhs);
418bool operator!=(
const char4 lhs,
const char4 rhs);
451#include "stormm_vector_types.tpp"
457#ifndef STORMM_USE_HPC
458using data_types::int2;
459using data_types::int3;
460using data_types::int4;
461using data_types::double2;
462using data_types::double3;
463using data_types::double4;
464using data_types::float2;
465using data_types::float3;
466using data_types::float4;
467using data_types::char2;
468using data_types::char3;
469using data_types::char4;
470using data_types::uchar2;
471using data_types::uchar3;
472using data_types::uchar4;
473using data_types::uint2;
474using data_types::uint3;
475using data_types::uint4;
476using data_types::longlong2;
477using data_types::longlong3;
478using data_types::longlong4;
479using data_types::ulonglong2;
480using data_types::ulonglong3;
481using data_types::ulonglong4;
482using data_types::short2;
483using data_types::short3;
484using data_types::short4;
485using data_types::ushort2;
486using data_types::ushort3;
487using data_types::ushort4;
491using data_types::llint2;
492using data_types::llint3;
493using data_types::llint4;
494using data_types::ullint2;
495using data_types::ullint3;
496using data_types::ullint4;
499using data_types::int95_t;
502using data_types::int2_type_index;
503using data_types::int3_type_index;
504using data_types::int4_type_index;
505using data_types::double2_type_index;
506using data_types::double3_type_index;
507using data_types::double4_type_index;
508using data_types::float2_type_index;
509using data_types::float3_type_index;
510using data_types::float4_type_index;
511using data_types::char2_type_index;
512using data_types::char3_type_index;
513using data_types::char4_type_index;
514using data_types::uchar2_type_index;
515using data_types::uchar3_type_index;
516using data_types::uchar4_type_index;
517using data_types::uint2_type_index;
518using data_types::uint3_type_index;
519using data_types::uint4_type_index;
520using data_types::longlong2_type_index;
521using data_types::longlong3_type_index;
522using data_types::longlong4_type_index;
523using data_types::ulonglong2_type_index;
524using data_types::ulonglong3_type_index;
525using data_types::ulonglong4_type_index;
526using data_types::short2_type_index;
527using data_types::short3_type_index;
528using data_types::short4_type_index;
529using data_types::ushort2_type_index;
530using data_types::ushort3_type_index;
531using data_types::ushort4_type_index;
532using data_types::int95t_type_index;
535using data_types::Vec2;
536using data_types::Vec3;
537using data_types::Vec4;
541using data_types::vtConv2;
542using data_types::vtConv3;
543using data_types::vtConv4;
544using data_types::vtConv2f;
545using data_types::vtConv3f;
546using data_types::vtConv4f;
547using data_types::short2ToUint;
548using data_types::ushort2ToUint;
549using data_types::char4ToUint;
550using data_types::uchar4ToUint;
551using data_types::uintToShort2;
552using data_types::uintToUshort2;
553using data_types::uintToChar4;
554using data_types::uintToUchar4;
557using data_types::Ecumenical2;
558using data_types::Ecumenical4;
559using data_types::Ecumenical8;
562using data_types::operator<;
563using data_types::operator<=;
564using data_types::operator>;
565using data_types::operator>=;
566using data_types::operator==;
567using data_types::operator!=;
Vec2(T x_in, T y_in)
Constructors will accept two scalars or one of the defined vector tuples.
T y
The second member, equivalent to the y member of a float2 or longlong2 tuple.
Definition stormm_vector_types.h:287
T x
The first member, equivalent to the x member of a float2 or longlong2 tuple.
Definition stormm_vector_types.h:286
T y
The second member, equivalent to the y member of a double3 or uint3 tuple.
Definition stormm_vector_types.h:301
Vec3(T x_in, T y_in, T z_in)
Constructors will accept three scalars or one of the defined vector tuples.
T z
The third member, equivalent to the z member of a double3 or uint3 tuple.
Definition stormm_vector_types.h:302
T x
The first member, equivalent to the x member of a double3 or uint3 tuple.
Definition stormm_vector_types.h:300
T w
The fourth member, equivalent to the w member of a float4 or int4 tuple.
Definition stormm_vector_types.h:318
T x
The first member, equivalent to the x member of a float4 or int4 tuple.
Definition stormm_vector_types.h:315
Vec4(T x_in, T y_in, T z_in, T w_in)
Constructors will accept four scalars or one of the defined vector tuples.
T z
The third member, equivalent to the z member of a float4 or int4 tuple.
Definition stormm_vector_types.h:317
T y
The second member, equivalent to the y member of a float4 or int4 tuple.
Definition stormm_vector_types.h:316
Definition stormm_vector_types.h:130
Definition stormm_vector_types.h:135
Definition stormm_vector_types.h:141
Definition stormm_vector_types.h:112
Definition stormm_vector_types.h:117
Definition stormm_vector_types.h:123
Definition stormm_vector_types.h:58
Definition stormm_vector_types.h:63
Definition stormm_vector_types.h:69
Definition stormm_vector_types.h:22
Definition stormm_vector_types.h:27
Definition stormm_vector_types.h:33
A mixed tuple for 95-bit integer accumulation. This is the proper way to take double-precision floati...
Definition stormm_vector_types.h:265
int y
Overflow accumulator, used when the primary value would be exceeded.
Definition stormm_vector_types.h:269
long long int x
Definition stormm_vector_types.h:266
Definition stormm_vector_types.h:76
Definition stormm_vector_types.h:81
Definition stormm_vector_types.h:87
Definition stormm_vector_types.h:166
Definition stormm_vector_types.h:171
Definition stormm_vector_types.h:177
Definition stormm_vector_types.h:148
Definition stormm_vector_types.h:153
Definition stormm_vector_types.h:159
Definition stormm_vector_types.h:40
Definition stormm_vector_types.h:45
Definition stormm_vector_types.h:51
Definition stormm_vector_types.h:94
Definition stormm_vector_types.h:99
Definition stormm_vector_types.h:105
Definition stormm_vector_types.h:184
Definition stormm_vector_types.h:189
Definition stormm_vector_types.h:195
Mimic critical CUDA typecasting intrinsics with simple unions {.
Definition stormm_vector_types.h:423
Definition stormm_vector_types.h:430
Definition stormm_vector_types.h:438