From d757baaf56ed7dc7b0ed4a9bc6f9a8e5fcd87842 Mon Sep 17 00:00:00 2001 From: Al Date: Wed, 29 Mar 2017 19:01:13 -0400 Subject: [PATCH] [fix] HAVE_CBLAS in matrix.h, memcpy needs to use sizeof(type) --- src/matrix.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/matrix.h b/src/matrix.h index 32f4a8ac..e8b03e84 100644 --- a/src/matrix.h +++ b/src/matrix.h @@ -13,7 +13,7 @@ #include "vector.h" #include "vector_math.h" -#ifdef HAVE_BLAS +#ifdef HAVE_CBLAS #include #else #warning "No CLBAS" @@ -145,7 +145,7 @@ static inline name##_t *name##_new_copy(name##_t *self) { \ name##_t *cpy = name##_new(self->m, self->n); \ size_t num_values = self->m * self->n; \ - memcpy(cpy->values, self->values, num_values); \ + memcpy(cpy->values, self->values, num_values * sizeof(type)); \ \ return cpy; \ } \ @@ -382,7 +382,7 @@ } -#ifdef HAVE_BLAS +#ifdef HAVE_CBLAS #define MATRIX_INIT_FLOAT(name, type, type_name, array_type, blas_prefix) \ MATRIX_INIT_FLOAT_BASE(name, type, type_name, array_type) \ \