Skip to content

Commit

Permalink
minor fixes for seq blas
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexandr-Solovev committed Aug 26, 2024
1 parent 91ef4cf commit 9a28e33
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions cpp/daal/src/externals/service_blas_mkl.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,9 @@ struct MklBlas<double, cpu>
static void xxsyrk(char * uplo, char * trans, DAAL_INT * p, DAAL_INT * n, double * alpha, double * a, DAAL_INT * lda, double * beta, double * ata,
DAAL_INT * ldata)
{
int old_nthr = mkl_set_num_threads_local(1);
__DAAL_MKLFN_CALL(blas_, dsyrk, (uplo, trans, (MKL_INT *)p, (MKL_INT *)n, alpha, a, (MKL_INT *)lda, beta, ata, (MKL_INT *)ldata));
mkl_set_num_threads_local(old_nthr);
}

static void xsyr(const char * uplo, const DAAL_INT * n, const double * alpha, const double * x, const DAAL_INT * incx, double * a,
Expand Down Expand Up @@ -218,7 +220,9 @@ struct MklBlas<float, cpu>
static void xxsyrk(char * uplo, char * trans, DAAL_INT * p, DAAL_INT * n, float * alpha, float * a, DAAL_INT * lda, float * beta, float * ata,
DAAL_INT * ldata)
{
int old_nthr = mkl_set_num_threads_local(1);
__DAAL_MKLFN_CALL(blas_, ssyrk, (uplo, trans, (MKL_INT *)p, (MKL_INT *)n, alpha, a, (MKL_INT *)lda, beta, ata, (MKL_INT *)ldata));
mkl_set_num_threads_local(old_nthr);
}

static void xsyr(const char * uplo, const DAAL_INT * n, const float * alpha, const float * x, const DAAL_INT * incx, float * a,
Expand Down Expand Up @@ -248,9 +252,11 @@ struct MklBlas<float, cpu>
const float * a, const DAAL_INT * lda, const float * y, const DAAL_INT * ldy, const float * beta, float * aty,
const DAAL_INT * ldaty)
{
int old_nthr = mkl_set_num_threads_local(1);
__DAAL_MKLFN_CALL(
blas_, sgemm,
(transa, transb, (MKL_INT *)p, (MKL_INT *)ny, (MKL_INT *)n, alpha, a, (MKL_INT *)lda, y, (MKL_INT *)ldy, beta, aty, (MKL_INT *)ldaty));
mkl_set_num_threads_local(old_nthr);
}

static void xsymm(const char * side, const char * uplo, const DAAL_INT * m, const DAAL_INT * n, const float * alpha, const float * a,
Expand Down
2 changes: 1 addition & 1 deletion examples/daal/cpp/source/kmeans/kmeans_dense_distr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

#include "daal.h"
#include "service.h"
#include <iostream>

using namespace daal;
using namespace daal::algorithms;
using namespace daal::data_management;
Expand Down

0 comments on commit 9a28e33

Please sign in to comment.