<commit_before>/*******************************************************
 * Copyright (c) 2014, ArrayFire
 * All rights reserved.
 *
 * This file is distributed under 3-clause BSD license.
 * The complete license agreement can be obtained at:
 * http://arrayfire.com/licenses/BSD-3-Clause
 ********************************************************/

#include <complex>

#include <blas.hpp>
#include <Array.hpp>
#include <err_opencl.hpp>
#include <math.hpp>
#include <transpose.hpp>
#include <arith.hpp>
#include <reduce.hpp>
#include <complex.hpp>

// Includes one of the supported OpenCL BLAS back-ends (e.g. clBLAS, CLBlast)
#include <magma/magma_blas.h>

#if defined(WITH_OPENCL_LINEAR_ALGEBRA)
#include <cpu/cpu_blas.hpp>
#endif

namespace opencl
{

// Converts an af_mat_prop options to a transpose type for one of the OpenCL BLAS back-ends
OPENCL_BLAS_TRANS_T
toBlasTranspose(af_mat_prop opt)
{
    switch(opt) {
        case AF_MAT_NONE    : return OPENCL_BLAS_NO_TRANS;
        case AF_MAT_TRANS   : return OPENCL_BLAS_TRANS;
        case AF_MAT_CTRANS  : return OPENCL_BLAS_CONJ_TRANS;
        default             : AF_ERROR("INVALID af_mat_prop", AF_ERR_ARG);
    }
}

// Initialization of the OpenCL BLAS library
void
initBlas()
{
    gpu_blas_init();
}

template<typename T>
Array<T> matmul(const Array<T> &lhs, const Array<T> &rhs,
                af_mat_prop optLhs, af_mat_prop optRhs)
{
#if defined(WITH_OPENCL_LINEAR_ALGEBRA)
    if(OpenCLCPUOffload(false)) {   // Do not force offload gemm on OSX Intel devices
        return cpu::matmul(lhs, rhs, optLhs, optRhs);
    }
#endif
<commit_msg>Fixed missing initBlas call<commit_after>/*******************************************************
 * Copyright (c) 2014, ArrayFire
 * All rights reserved.
 *
 * This file is distributed under 3-clause BSD license.
 * The complete license agreement can be obtained at:
 * http://arrayfire.com/licenses/BSD-3-Clause
 ********************************************************/

#include <complex>

#include <blas.hpp>
#include <Array.hpp>
#include <err_opencl.hpp>
#include <math.hpp>
#include <transpose.hpp>
#include <arith.hpp>
#include <reduce.hpp>
#include <complex.hpp>

// Includes one of the supported OpenCL BLAS back-ends (e.g. clBLAS, CLBlast)
#include <magma/magma_blas.h>

#if defined(WITH_OPENCL_LINEAR_ALGEBRA)
#include <cpu/cpu_blas.hpp>
#endif

namespace opencl
{

// Converts an af_mat_prop options to a transpose type for one of the OpenCL BLAS back-ends
OPENCL_BLAS_TRANS_T
toBlasTranspose(af_mat_prop opt)
{
    switch(opt) {
        case AF_MAT_NONE    : return OPENCL_BLAS_NO_TRANS;
        case AF_MAT_TRANS   : return OPENCL_BLAS_TRANS;
        case AF_MAT_CTRANS  : return OPENCL_BLAS_CONJ_TRANS;
        default             : AF_ERROR("INVALID af_mat_prop", AF_ERR_ARG);
    }
}

// Initialization of the OpenCL BLAS library
void
initBlas()
{
    gpu_blas_init();
}

template<typename T>
Array<T> matmul(const Array<T> &lhs, const Array<T> &rhs,
                af_mat_prop optLhs, af_mat_prop optRhs)
{
#if defined(WITH_OPENCL_LINEAR_ALGEBRA)
    if(OpenCLCPUOffload(false)) {   // Do not force offload gemm on OSX Intel devices
        return cpu::matmul(lhs, rhs, optLhs, optRhs);
    }
#endif
    initBlas();

{'fraction_non_alphanumeric': 0.16378778531770513, 'fraction_numerical': 0.003701418877236274, 'mean_word_length': 4.155802861685214, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1976837', 'n_tokens_mistral': 1140, 'n_tokens_neox': 1127, 'n_words': 280}