Skip to content
This repository has been archived by the owner on Mar 15, 2019. It is now read-only.

Commit

Permalink
dont know but I know this is the latest
Browse files Browse the repository at this point in the history
  • Loading branch information
Kurt Robert Rudolph committed Apr 27, 2011
1 parent c5fc2a0 commit afe8144
Show file tree
Hide file tree
Showing 3 changed files with 146 additions and 25 deletions.
26 changes: 26 additions & 0 deletions src/headers/rudyCUDA_mazeSolve.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/**
* @file rudyCUDA_mazeSolve.h
* @author Kurt Robert Rudolph
* @description This is a set of functions intended
* to enable a maze to be solved
*/


#ifndef __RUDY_CUDA__MAZE_SOLVE_H__
#define __RUDY_CUDA__MAZE_SOLVE_H__














#endif // __RUDY_CUDA__MAZE_SOLVE_H__

138 changes: 113 additions & 25 deletions src/headers/rudyCUDA_vector.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,62 +10,150 @@
#define __RUDY_VECTOR_H__

#include <rudyCUDA.h>
/**
* @struct rudyCUDA_vector_element_t
* @brif holds a vector element
* @param element, the elment being stored
*/
typedef struct rudyCUDA_vector_element_t {
void * element;
} rudyCUDA_vector_element;

typedef struct rudyCUDAVectorElement_t {
double * element;
} rudyCUDAVectorElement;
typedef struct rudyCUDA_vector_t {
int elementCount;
rudyCUDA_vector_element **element;
} rudyCUDA_vector;

/**
* @struct rudyCUDAVector
* @struct rudyCUDA_vector_int_t
* @brief stores a vector
* @param elementCount The number of elements
* in the vector
* @param vector A double pointer array containaing
* #elementCount number of #rudyCUDAVecotrElement (s)
* #elementCount number of int* (s).
*/
typedef struct rudyCUDAVector_t {
int64_t elementCount;
rudyCUDAVectorElement ** vecotor;
} rudyCUDAVector;
typedef struct rudyCUDA_vector_int_t {
int elementCount;
int **vector;
} rudyCUDA_vector_int;

/**
* @brief Inializes a vector
* @param numElements the number of elements to set
* the vector to.
* @param zeroOut a bool value which indicates weather
* the vecotor should be initialized to zero.
* @struct rudyCUDA_vector_double_t
* @brief stores a vector
* @param elementCount The number of elements
* in the vector
* @param vector A double pointer array containaing
* #elementCount number of double* (s).
*/
void rudyCUDA_vector_initialize( int64_t * numElements, bool zeroOut);
typedef struct rudyCUDA_vector_double_t {
int elementCount;
double **vector;
} rudyCUDA_vector_double;

/**
* @struct rudyCUDA_vector_double_t
* @brief stores a vector
* @param elementCount The number of elements
* in the vector
* @param vector A double pointer array containaing
* #elementCount number of float* (s).
*/
typedef struct rudyCUDA_vector_float_t {
int elementCount;
float **vector;
} rudyCUDA_vector_float;

/**
* @brief Free's the memory of a rudyCUDAVecotor
* @param vecotor the vecotor to be freed and
* set to NULL.
*/
__global__ void rudyCUDA_vector_freeInt( rudyCUDA_vector_int * vector);

/**
* @brief Free's the memory of a rudyCUDAVecotor
* @param vecotor the vecotor to be freed and
* set to NULL.
*/
void rudyCUDA_vector_free( rudyCUDAVector * vector);
__global__ void rudyCUDA_vector_freeDouble( rudyCUDA_vector_double * vector);

/**
* @brief Sums the values of an array of vectors.
* @param sumVectors An array of the vectros to be summed.
* @brief Sums vectors.
* @param sumVectors The vectros to be summed.
* @param storeSumVector The vector where the sums are to be stored,
* NOTE: it is valid to store have a store vector also a sum vector
* @param vectorCount The number of vectors in the array.
* @param storeSumVector The vector where the sums are to be
* stored.
*/
void rudyCUDA_vector_sum( rudyCUDAVector ** sumVectors, int64_t * vectorCount, rudyCUDAVector * storeSumVector);
__global__ void rudyCUDA_vector_sumInt( rudyCUDA_vector_int ** sumVectors, rudyCUDA_vector_int * storeSumVector, int * vectorCount);

/**
* @brief Sums the values of a vector.
* @param vector The vector whos elements are to be summed.
* @param sum The sum of the vector elements.
* @brief Sums vectors.
* @param sumVectors The vectros to be summed.
* @param storeSumVector The vector where the sums are to be stored,
* NOTE: it is valid to store have a store vector also a sum vector
* @param vectorCount The number of vectors in the array.
* stored.
*/
void rudyCUDA_vector_sumElements( rudyCUDAVector * vector, rudyCUDAVectorElement * storeSumElement);
__global__ void rudyCUDA_vector_sumDouble( rudyCUDA_vector_int ** sumVectors, rudyCUDA_vector_int * storeSumVector, int * vectorCount);

/**
* @brief Sums vectors.
* @param sumVectors The vectros to be summed.
* @param storeSumVector The vector where the sums are to be stored,
* NOTE: it is valid to store have a store vector also a sum vector
* @param vectorCount The number of vectors in the array.
* stored.
*/
__global__ void rudyCUDA_vector_sumFloat( rudyCUDA_vector_int ** sumVectors, rudyCUDA_vector_int * storeSumVector, int * vectorCount);

typedef enum rudyCUDA_vecotor_reduceOp_t {
rudyCUDA_vector_reduceSum =0,
rudyCUDA_vector_reduceMin,
rudyCUDA_vector_reduceMax,
rudyCUDA_vector_reduceMean,
rudyCUDA_vector_reduceMedian,
rudyCUDA_vector_reduceTwoNorm
} rudyCUDA_vector_reduceOP;

/**
* @brief Ruduces a vector
* @param vectors The vectros to be reduced.
* @param storeRduce Where the reduced vector is to be stored,
* NOTE: it is valid to store have a store vector also a sum vector
* @param vectorCount The number of vectors in the array.
* stored.
*/
//__global__ void rudyCUDA_vector_reduceInt( rudyCUDA_vector_int *vector, int *storeRduce , rudyCUDA_vector_reduceOp_t *op);

/**
* @brief Ruduces a vector
* @param vectors The vectros to be reduced.
* @param storeRduce Where the reduced vector is to be stored,
* NOTE: it is valid to store a store the reduced vector in the
* zero element of the #vector
* @param op the operation to be completed
*/
//__global__ void rudyCUDA_vector_reduceDouble( rudyCUDA_vector_int *vector, int *storeRduce , rudyCUDA_vector_reduceOp *op);

/**
* @brief Ruduces a vector
* @param vectors The vectros to be reduced.
* @param storeRduce Where the reduced vector is to be stored,
* NOTE: it is valid to store have a store vector also a sum vector
* @param vectorCount The number of vectors in the array.
* stored.
*/
//__global__ void rudyCUDA_vector_reduceInt( rudyCUDA_vector_int *vector, int *storeRduce , rudyCUDA_vector_reduceOp *op);



/**
* @brief Computes the dotProduct of two equal length vectors.
* @param vector1 The first input vector.
* @param vector2 The second input vector.
* @param storeDotProductElement The result of the dotProduct
*/
void rudyCUDA_vector_dotProduct( rudyCUDAVector * vector1, rudyCUDAVector * vector2, rudyCUDAVectorElement * storeDotProductElement);
//__global__ void rudyCUDA_vector_dotProduct( rudyCUDAVector * vector1, rudyCUDAVector * vector2, rudyCUDAVectorElement * storeDotProductElement);

#endif
7 changes: 7 additions & 0 deletions src/rudyCUDA_vector.cu
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,10 @@
#include <rudyCUDA_vector.h>



/*__global__ void rudyCUDA_vector_sumFloat( rudyCUDA_vector_int ** sumVectors, rudyCUDA_vector_int * storeSumVector, int * vectorCount) {
blockIdx.x = tid;
}*/

0 comments on commit afe8144

Please sign in to comment.