Skip to content

Commit

Permalink
Merge pull request #2 from GerHobbelt/tfloat-patch-1
Browse files Browse the repository at this point in the history
consistent TFloat prototypes
  • Loading branch information
stweil authored Jul 13, 2021
2 parents b3adfdd + efc7601 commit 3b8f329
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/arch/dotproductsse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ TFloat DotProductSSE(const TFloat *u, const TFloat *v, int n) {
return total;
}
#else
double DotProductSSE(const double *u, const double *v, int n) {
TFloat DotProductSSE(const TFloat *u, const TFloat *v, int n) {
int max_offset = n - 2;
int offset = 0;
// Accumulate a set of 2 sums in sum, by loading pairs of 2 values from u and
Expand Down
10 changes: 5 additions & 5 deletions src/arch/intsimdmatrixsse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,15 @@ static int32_t IntDotProductSSE(const int8_t *u, const int8_t *v, int n) {
}

// Computes part of matrix.vector v = Wu. Computes 1 result.
static void PartialMatrixDotVector1(const int8_t *wi, const double *scales, const int8_t *u,
int num_in, double *v) {
double total = IntDotProductSSE(u, wi, num_in);
static void PartialMatrixDotVector1(const int8_t *wi, const TFloat *scales, const int8_t *u,
int num_in, TFloat *v) {
TFloat total = IntDotProductSSE(u, wi, num_in);
// Add in the bias and correct for integer values.
*v = (total + wi[num_in] * INT8_MAX) * *scales;
}

static void matrixDotVector(int dim1, int dim2, const int8_t *wi, const double *scales,
const int8_t *u, double *v) {
static void matrixDotVector(int dim1, int dim2, const int8_t *wi, const TFloat *scales,
const int8_t *u, TFloat *v) {
const int num_out = dim1;
const int num_in = dim2 - 1;
int output = 0;
Expand Down

0 comments on commit 3b8f329

Please sign in to comment.