<commit_before>//=======================================================================
// Copyright (c) 2014-2017 <NAME>
// Distributed under the terms of the MIT License.
// (See accompanying file LICENSE or copy at
//  http://opensource.org/licenses/MIT)
//=======================================================================

/*!
 * \file
 * \brief CUBLAS wrappers for the scal operation.
 */

#pragma once

#ifdef ETL_CUBLAS_MODE

#include "etl/impl/cublas/cuda.hpp"
#include "etl/impl/cublas/cublas.hpp"

#endif

namespace etl {

namespace impl {

namespace cublas {

#ifdef ETL_CUBLAS_MODE

/*!
 * \brief Wrappers for single-precision cublas scal operation
 * \param handle The CUBLAS handle
 * \param n The size of the vector
 * \param alpha The scaling factor alpha
 * \param A The memory of the vector a
 * \param lda The leading dimension of a
 */
inline void cublas_scal(cublasHandle_t handle, size_t n, float* alpha, float* A , size_t lda){
    cublas_check(cublasSscal(handle, n, alpha, A, lda));
}

/*!
 * \brief Wrappers for single-precision cublas scal operation
 * \param handle The CUBLAS handle
 * \param n The size of the vector
 * \param alpha The scaling factor alpha
 * \param A The memory of the vector a
 * \param lda The leading dimension of a
 */
inline void cublas_scal(cublasHandle_t handle, size_t n, double* alpha, double* A , size_t lda){
    cublas_check(cublasDscal(handle, n, alpha, A, lda));
}

/*!
 * \brief Wrappers for complex single-precision cublas axpy operation
 * \param handle The CUBLAS handle
 * \param n The size of the vector
 * \param alpha The scaling factor alpha
 * \param A The memory of the vector a
 * \param lda The leading dimension of a
 * \param B The memory of the vector b
 * \param ldb The leading dimension of b
 */
inline void cublas_axpy(cublasHandle_t handle, size_t n, std::complex<float>* alpha, std::complex<float>* A , size_t lda){
    cublas_check(cublasCscal(handle, n, reinterpret_cast<const cuComplex*>(alpha), reinterpret_cast<cuComplex*>(A), lda));
}

/*!
 * \brief Wrappers for complex double-precision cublas axpy operation
 * \param handle The CUBLAS handle
 * \param n The size of the vector
 * \param alpha The scaling factor alpha
 * \param A The memory of the vector a
 * \param lda The leading dimension of a
 * \param B The memory of the vector b
 * \param ldb The leading dimension of b
 */
inline void cublas_axpy(cublasHandle_t handle, size_t n, std::complex<double>* alpha, std::complex<double>* A , size_t lda){
    cublas_check(cublasZscal(handle, n, reinterpret_cast<const cuDoubleComplex*>(alpha), reinterpret_cast<cuDoubleComplex*>(A), lda));
}

/*!
 * \brief Wrappers for complex single-precision cublas axpy operation
 * \param handle The CUBLAS handle
 * \param n The size of the vector
 * \param alpha The scaling factor alpha
 * \param A The memory of the vector a
 * \param lda The leading dimension of a
 * \param B The memory of the vector b
 * \param ldb The leading dimension of b
 */
inline void cublas_axpy(cublasHandle_t handle, size_t n, etl::complex<float>* alpha, etl::complex<float>* A , size_t lda){
    cublas_check(cublasCscal(handle, n, reinterpret_cast<const cuComplex*>(alpha), reinterpret_cast<cuComplex*>(A), lda));
}

/*!
 * \brief Wrappers for complex double-precision cublas axpy operation
 * \param handle The CUBLAS handle
 * \param n The size of the vector
 * \param alpha The scaling factor alpha
 * \param A The memory of the vector a
 * \param lda The leading dimension of a
 * \param B The memory of the vector b
 * \param ldb The leading dimension of b
 */
inline void cublas_axpy(cublasHandle_t handle, size_t n, etl::complex<double>* alpha, etl::complex<double>* A , size_t lda){
    cublas_check(cublasZscal(handle, n, reinterpret_cast<const cuDoubleComplex*>(alpha), reinterpret_cast<cuDoubleComplex*>(A), lda));
}

#endif

} //end of namespace cublas
} //end of namespace impl
} //end of namespace etl<commit_msg>Fix CUBLAS scal wrappers<commit_after>//=======================================================================
// Copyright (c) 2014-2017 <NAME>
// Distributed under the terms of the MIT License.
// (See accompanying file LICENSE or copy at
//  http://opensource.org/licenses/MIT)
//=======================================================================

/*!
 * \file
 * \brief CUBLAS wrappers for the scal operation.
 */

#pragma once

#ifdef ETL_CUBLAS_MODE

#include "etl/impl/cublas/cuda.hpp"
#include "etl/impl/cublas/cublas.hpp"

#endif

namespace etl {

namespace impl {

namespace cublas {

#ifdef ETL_CUBLAS_MODE

/*!
 * \brief Wrappers for single-precision cublas scal operation
 * \param handle The CUBLAS handle
 * \param n The size of the vector
 * \param alpha The scaling factor alpha
 * \param A The memory of the vector a
 * \param lda The leading dimension of a
 */
inline void cublas_scal(cublasHandle_t handle, size_t n, float* alpha, float* A , size_t lda){
    cublas_check(cublasSscal(handle, n, alpha, A, lda));
}

/*!
 * \brief Wrappers for single-precision cublas scal operation
 * \param handle The CUBLAS handle
 * \param n The size of the vector
 * \param alpha The scaling factor alpha
 * \param A The memory of the vector a
 * \param lda The leading dimension of a
 */
inline void cublas_scal(cublasHandle_t handle, size_t n, double* alpha, double* A , size_t lda){
    cublas_check(cublasDscal(handle, n, alpha, A, lda));
}

/*!
 * \brief Wrappers for complex single-precision cublas axpy operation
 * \param handle The CUBLAS handle
 * \param n The size of the vector
 * \param alpha The scaling factor alpha
 * \param A The memory of the vector a
 * \param lda The leading dimension of a
 * \param B The memory of the vector b
 * \param ldb The leading dimension of b
 */
inline void cublas_scal(cublasHandle_t handle, size_t n, std::complex<float>* alpha, std::complex<float>* A , size_t lda){
    cublas_check(cublasCscal(handle, n, reinterpret_cast<const cuComplex*>(alpha), reinterpret_cast<cuComplex*>(A), lda));
}

/*!
 * \brief Wrappers for complex double-precision cublas axpy operation
 * \param handle The CUBLAS handle
 * \param n The size of the vector
 * \param alpha The scaling factor alpha
 * \param A The memory of the vector a
 * \param lda The leading dimension of a
 * \param B The memory of the vector b
 * \param ldb The leading dimension of b
 */
inline void cublas_scal(cublasHandle_t handle, size_t n, std::complex<double>* alpha, std::complex<double>* A , size_t lda){
    cublas_check(cublasZscal(handle, n, reinterpret_cast<const cuDoubleComplex*>(alpha), reinterpret_cast<cuDoubleComplex*>(A), lda));
}

/*!
 * \brief Wrappers for complex single-precision cublas axpy operation
 * \param handle The CUBLAS handle
 * \param n The size of the vector
 * \param alpha The scaling factor alpha
 * \param A The memory of the vector a
 * \param lda The leading dimension of a
 * \param B The memory of the vector b
 * \param ldb The leading dimension of b
 */
inline void cublas_scal(cublasHandle_t handle, size_t n, etl::complex<float>* alpha, etl::complex<float>* A , size_t lda){
    cublas_check(cublasCscal(handle, n, reinterpret_cast<const cuComplex*>(alpha), reinterpret_cast<cuComplex*>(A), lda));
}

/*!
 * \brief Wrappers for complex double-precision cublas axpy operation
 * \param handle The CUBLAS handle
 * \param n The size of the vector
 * \param alpha The scaling factor alpha
 * \param A The memory of the vector a
 * \param lda The leading dimension of a
 * \param B The memory of the vector b
 * \param ldb The leading dimension of b
 */
inline void cublas_scal(cublasHandle_t handle, size_t n, etl::complex<double>* alpha, etl::complex<double>* A , size_t lda){
    cublas_check(cublasZscal(handle, n, reinterpret_cast<const cuDoubleComplex*>(alpha), reinterpret_cast<cuDoubleComplex*>(A), lda));
}

#endif

} //end of namespace cublas
} //end of namespace impl
} //end of namespace etl
{'fraction_non_alphanumeric': 0.13183482762975124, 'fraction_numerical': 0.0020204571284253062, 'mean_word_length': 4.294117647058823, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 37, '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': '2468617', 'n_tokens_mistral': 2472, 'n_tokens_neox': 2460, 'n_words': 940}