working on comples64

This commit is contained in:
2026-04-10 16:28:25 -04:00
parent a8ed51a904
commit f315dfb6f6
48 changed files with 551 additions and 2523 deletions

View File

@ -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();
};