working on comples64
This commit is contained in:
@ -19,9 +19,9 @@
|
||||
class cuvect2;
|
||||
class cuvect3;
|
||||
class cuvect4;
|
||||
class cuvect2f;
|
||||
class cuvect3f;
|
||||
class cuvect4f;
|
||||
class cuvec2f;
|
||||
class cuvec3f;
|
||||
class cuvec4f;
|
||||
|
||||
//Need a way to define the same symbols using both host and device code
|
||||
//A solution was found here: https://stackoverflow.com/questions/9457572/cuda-host-and-device-using-same-constant-memory
|
||||
@ -51,9 +51,9 @@ namespace amscuda
|
||||
#include <amsculib2/cuvect2.hpp>
|
||||
#include <amsculib2/cuvect3.hpp>
|
||||
#include <amsculib2/cuvect4.hpp>
|
||||
#include <amsculib2/cuvect2f.hpp>
|
||||
#include <amsculib2/cuvect3f.hpp>
|
||||
#include <amsculib2/cuvect4f.hpp>
|
||||
#include <amsculib2/cuvec2f.hpp>
|
||||
#include <amsculib2/cuvec3f.hpp>
|
||||
#include <amsculib2/cuvec4f.hpp>
|
||||
#include <amsculib2/amscugeom.hpp>
|
||||
#include <amsculib2/amscuarray.hpp>
|
||||
#include <amsculib2/amscuda_binarrrw.hpp>
|
||||
|
||||
@ -1,28 +1,28 @@
|
||||
#ifndef __CUVECT2F_HPP__
|
||||
#define __CUVECT2F_HPP__
|
||||
#ifndef __cuvec2f_HPP__
|
||||
#define __cuvec2f_HPP__
|
||||
|
||||
namespace amscuda
|
||||
{
|
||||
|
||||
class cuvect2f
|
||||
class cuvec2f
|
||||
{
|
||||
public:
|
||||
float x;
|
||||
float y;
|
||||
|
||||
|
||||
__host__ __device__ cuvect2f();
|
||||
__host__ __device__ ~cuvect2f();
|
||||
__host__ __device__ cuvect2f(const float &_x, const float &_y);
|
||||
__host__ __device__ cuvec2f();
|
||||
__host__ __device__ ~cuvec2f();
|
||||
__host__ __device__ cuvec2f(const float &_x, const float &_y);
|
||||
|
||||
__host__ __device__ float& operator[](const int &I);
|
||||
__host__ __device__ const float& operator[](const int &I) const;
|
||||
|
||||
__host__ __device__ cuvect2f operator+(const cuvect2f &lhs);
|
||||
__host__ __device__ cuvect2f operator-(const cuvect2f &lhs);
|
||||
__host__ __device__ cuvect2f operator*(const float &lhs);
|
||||
__host__ __device__ cuvect2f operator/(const float &lhs);
|
||||
__host__ __device__ friend cuvect2f operator-(const cuvect2f &rhs);
|
||||
__host__ __device__ cuvec2f operator+(const cuvec2f &lhs);
|
||||
__host__ __device__ cuvec2f operator-(const cuvec2f &lhs);
|
||||
__host__ __device__ cuvec2f operator*(const float &lhs);
|
||||
__host__ __device__ cuvec2f operator/(const float &lhs);
|
||||
__host__ __device__ friend cuvec2f operator-(const cuvec2f &rhs);
|
||||
};
|
||||
|
||||
class cumat2f
|
||||
@ -40,7 +40,7 @@ namespace amscuda
|
||||
__host__ __device__ cumat2f operator-(cumat2f lhs);
|
||||
__host__ __device__ cumat2f operator*(float lhs);
|
||||
__host__ __device__ cumat2f operator/(float lhs);
|
||||
__host__ __device__ cuvect2f operator*(cuvect2f lhs);
|
||||
__host__ __device__ cuvec2f operator*(cuvec2f lhs);
|
||||
__host__ __device__ cumat2f operator*(cumat2f lhs);
|
||||
__host__ __device__ friend cumat2f operator-(cumat2f rhs);
|
||||
|
||||
@ -49,11 +49,11 @@ namespace amscuda
|
||||
__host__ __device__ cumat2f inverse();
|
||||
};
|
||||
|
||||
__host__ __device__ float cuvect2f_dot(const cuvect2f &a, const cuvect2f &b);
|
||||
__host__ __device__ float cuvect2f_cross(const cuvect2f &a, const cuvect2f &b);
|
||||
__host__ __device__ float cuvect2f_norm(const cuvect2f &a);
|
||||
__host__ __device__ cuvect2f cuvect2f_normalize(const cuvect2f &a);
|
||||
__host__ __device__ cuvect2f cuvect2f_proj(const cuvect2f &a, const cuvect2f &b);
|
||||
__host__ __device__ float cuvec2f_dot(const cuvec2f &a, const cuvec2f &b);
|
||||
__host__ __device__ float cuvec2f_cross(const cuvec2f &a, const cuvec2f &b);
|
||||
__host__ __device__ float cuvec2f_norm(const cuvec2f &a);
|
||||
__host__ __device__ cuvec2f cuvec2f_normalize(const cuvec2f &a);
|
||||
__host__ __device__ cuvec2f cuvec2f_proj(const cuvec2f &a, const cuvec2f &b);
|
||||
|
||||
//2x2 matrix operations
|
||||
//matrix order is assumed to be mat[I,J] = mat[I+3*J]
|
||||
@ -74,10 +74,10 @@ namespace amscuda
|
||||
__host__ __device__ void mat2f_mult(float *mat2a, float *mat2b, float *mat2c);
|
||||
|
||||
// ret = a*b
|
||||
__host__ __device__ cuvect2f mat2f_mult(float *mat2a, const cuvect2f &b);
|
||||
__host__ __device__ cuvec2f mat2f_mult(float *mat2a, const cuvec2f &b);
|
||||
|
||||
|
||||
void test_cuvect2f_1();
|
||||
void test_cuvec2f_1();
|
||||
|
||||
|
||||
};
|
||||
|
||||
@ -1,34 +1,34 @@
|
||||
#ifndef __CUVECT3F_HPP__
|
||||
#define __CUVECT3F_HPP__
|
||||
#ifndef __cuvec3f_HPP__
|
||||
#define __cuvec3f_HPP__
|
||||
|
||||
namespace amscuda
|
||||
{
|
||||
|
||||
class cuvect3f
|
||||
class cuvec3f
|
||||
{
|
||||
public:
|
||||
float x;
|
||||
float y;
|
||||
float z;
|
||||
|
||||
__host__ __device__ cuvect3f();
|
||||
__host__ __device__ ~cuvect3f();
|
||||
__host__ __device__ cuvect3f(const float &_x, const float &_y, const float &_z);
|
||||
__host__ __device__ cuvec3f();
|
||||
__host__ __device__ ~cuvec3f();
|
||||
__host__ __device__ cuvec3f(const float &_x, const float &_y, const float &_z);
|
||||
|
||||
|
||||
__host__ __device__ float& operator[](const int &I);
|
||||
__host__ __device__ const float& operator[](const int &I) const;
|
||||
|
||||
__host__ __device__ cuvect3f operator+(const cuvect3f &rhs);
|
||||
__host__ __device__ cuvect3f operator-(const cuvect3f &rhs);
|
||||
__host__ __device__ cuvect3f operator*(const float &rhs);
|
||||
__host__ __device__ cuvect3f operator/(const float &rhs);
|
||||
__host__ __device__ friend cuvect3f operator-(const cuvect3f &rhs);
|
||||
__host__ __device__ cuvec3f operator+(const cuvec3f &rhs);
|
||||
__host__ __device__ cuvec3f operator-(const cuvec3f &rhs);
|
||||
__host__ __device__ cuvec3f operator*(const float &rhs);
|
||||
__host__ __device__ cuvec3f operator/(const float &rhs);
|
||||
__host__ __device__ friend cuvec3f operator-(const cuvec3f &rhs);
|
||||
|
||||
__host__ __device__ cuvect3f& operator+=(const cuvect3f &rhs);
|
||||
__host__ __device__ cuvect3f& operator-=(const cuvect3f &rhs);
|
||||
__host__ __device__ cuvect3f& operator/=(const float &rhs);
|
||||
__host__ __device__ cuvect3f& operator*=(const float &rhs);
|
||||
__host__ __device__ cuvec3f& operator+=(const cuvec3f &rhs);
|
||||
__host__ __device__ cuvec3f& operator-=(const cuvec3f &rhs);
|
||||
__host__ __device__ cuvec3f& operator/=(const float &rhs);
|
||||
__host__ __device__ cuvec3f& operator*=(const float &rhs);
|
||||
|
||||
};
|
||||
|
||||
@ -59,7 +59,7 @@ namespace amscuda
|
||||
__host__ __device__ cumat3f operator-(const cumat3f &rhs);
|
||||
__host__ __device__ cumat3f operator*(const float &rhs);
|
||||
__host__ __device__ cumat3f operator/(const float &rhs);
|
||||
__host__ __device__ cuvect3f operator*(const cuvect3f &rhs);
|
||||
__host__ __device__ cuvec3f operator*(const cuvec3f &rhs);
|
||||
__host__ __device__ cumat3f operator*(const cumat3f &rhs);
|
||||
__host__ __device__ friend cumat3f operator-(const cumat3f &rhs);
|
||||
|
||||
@ -79,15 +79,15 @@ namespace amscuda
|
||||
|
||||
};
|
||||
|
||||
__host__ __device__ float cuvect3f_dot(const cuvect3f &a,const cuvect3f &b);
|
||||
__host__ __device__ cuvect3f cuvect3f_cross(const cuvect3f &a, const cuvect3f &b);
|
||||
__host__ __device__ float cuvect3f_norm(const cuvect3f &a);
|
||||
__host__ __device__ cuvect3f cuvect3f_normalize(const cuvect3f &a);
|
||||
__host__ __device__ cuvect3f cuvect3f_proj(const cuvect3f &a, const cuvect3f &b);
|
||||
__host__ __device__ float cuvec3f_dot(const cuvec3f &a,const cuvec3f &b);
|
||||
__host__ __device__ cuvec3f cuvec3f_cross(const cuvec3f &a, const cuvec3f &b);
|
||||
__host__ __device__ float cuvec3f_norm(const cuvec3f &a);
|
||||
__host__ __device__ cuvec3f cuvec3f_normalize(const cuvec3f &a);
|
||||
__host__ __device__ cuvec3f cuvec3f_proj(const cuvec3f &a, const cuvec3f &b);
|
||||
|
||||
__host__ __device__ cumat3f hodge_dual(const cuvect3f &vin);
|
||||
__host__ __device__ cuvect3f hodge_dual(const cumat3f &min);
|
||||
__host__ __device__ cumat3f rotmat_from_axisangle(const cuvect3f &axis, const float &angle);
|
||||
__host__ __device__ cumat3f hodge_dual(const cuvec3f &vin);
|
||||
__host__ __device__ cuvec3f hodge_dual(const cumat3f &min);
|
||||
__host__ __device__ cumat3f rotmat_from_axisangle(const cuvec3f &axis, const float &angle);
|
||||
|
||||
|
||||
//3x3 matrix operations
|
||||
@ -105,14 +105,14 @@ namespace amscuda
|
||||
//inverts a 3x3 (9 element) matrix
|
||||
__host__ __device__ void mat3f_inverse(float *mat3inout);
|
||||
|
||||
__host__ __device__ cuvect3f mat3f_mult(float *mat3in, const cuvect3f &cvin);
|
||||
__host__ __device__ cuvec3f mat3f_mult(float *mat3in, const cuvec3f &cvin);
|
||||
__host__ __device__ void mat3f_mult(float *matina, float *matinb, float *matout);
|
||||
|
||||
__host__ __device__ void mat3f_hodgedual(const cuvect3f &vecin, float *matout);
|
||||
__host__ __device__ void mat3f_hodgedual(float *matin, cuvect3f &vecout);
|
||||
__host__ __device__ void mat3f_hodgedual(const cuvec3f &vecin, float *matout);
|
||||
__host__ __device__ void mat3f_hodgedual(float *matin, cuvec3f &vecout);
|
||||
|
||||
//returns direction cosine rotation matrix from axis and angle
|
||||
__host__ __device__ void mat3f_rot_from_axisangle(cuvect3f axis, float angle, float *matout);
|
||||
__host__ __device__ void mat3f_rot_from_axisangle(cuvec3f axis, float angle, float *matout);
|
||||
|
||||
__host__ void test_cudavectf_logic1();
|
||||
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
#ifndef __CUVECT4F_HPP__
|
||||
#define __CUVECT4F_HPP__
|
||||
#ifndef __cuvec4f_HPP__
|
||||
#define __cuvec4f_HPP__
|
||||
|
||||
namespace amscuda
|
||||
{
|
||||
|
||||
class cuvect4f
|
||||
class cuvec4f
|
||||
{
|
||||
public:
|
||||
float x;
|
||||
@ -12,18 +12,18 @@ namespace amscuda
|
||||
float z;
|
||||
float w;
|
||||
|
||||
__host__ __device__ cuvect4f();
|
||||
__host__ __device__ ~cuvect4f();
|
||||
__host__ __device__ cuvect4f(float _x, float _y, float _z, float _w);
|
||||
__host__ __device__ cuvec4f();
|
||||
__host__ __device__ ~cuvec4f();
|
||||
__host__ __device__ cuvec4f(float _x, float _y, float _z, float _w);
|
||||
|
||||
__host__ __device__ float& operator[](const int I);
|
||||
__host__ __device__ const float& operator[](const int I) const;
|
||||
|
||||
__host__ __device__ cuvect4f operator+(cuvect4f lhs);
|
||||
__host__ __device__ cuvect4f operator-(cuvect4f lhs);
|
||||
__host__ __device__ cuvect4f operator*(float lhs);
|
||||
__host__ __device__ cuvect4f operator/(float lhs);
|
||||
__host__ __device__ friend cuvect4f operator-(cuvect4f rhs);
|
||||
__host__ __device__ cuvec4f operator+(cuvec4f lhs);
|
||||
__host__ __device__ cuvec4f operator-(cuvec4f lhs);
|
||||
__host__ __device__ cuvec4f operator*(float lhs);
|
||||
__host__ __device__ cuvec4f operator/(float lhs);
|
||||
__host__ __device__ friend cuvec4f operator-(cuvec4f rhs);
|
||||
};
|
||||
|
||||
class cumat4f
|
||||
@ -41,7 +41,7 @@ namespace amscuda
|
||||
__host__ __device__ cumat4f operator-(cumat4f lhs);
|
||||
__host__ __device__ cumat4f operator*(float lhs);
|
||||
__host__ __device__ cumat4f operator/(float lhs);
|
||||
__host__ __device__ cuvect4f operator*(cuvect4f lhs);
|
||||
__host__ __device__ cuvec4f operator*(cuvec4f lhs);
|
||||
__host__ __device__ cumat4f operator*(cumat4f lhs);
|
||||
__host__ __device__ friend cumat4f operator-(cumat4f rhs);
|
||||
|
||||
@ -50,10 +50,10 @@ namespace amscuda
|
||||
__host__ __device__ cumat4f inverse();
|
||||
};
|
||||
|
||||
__host__ __device__ float cuvect4f_dot(cuvect4f a, cuvect4f b);
|
||||
__host__ __device__ float cuvect4f_norm(cuvect4f a);
|
||||
__host__ __device__ cuvect4f cuvect4f_normalize(cuvect4f a);
|
||||
__host__ __device__ cuvect4f cuvect4f_proj(cuvect4f a, cuvect4f b);
|
||||
__host__ __device__ float cuvec4f_dot(cuvec4f a, cuvec4f b);
|
||||
__host__ __device__ float cuvec4f_norm(cuvec4f a);
|
||||
__host__ __device__ cuvec4f cuvec4f_normalize(cuvec4f a);
|
||||
__host__ __device__ cuvec4f cuvec4f_proj(cuvec4f a, cuvec4f b);
|
||||
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user