blas.h (2022-02-24 14:07:56 -0500, (build 8c2561559))
Go to the documentation of this file.
1/*******************************************************
2 * Copyright (c) 2014, ArrayFire
3 * All rights reserved.
4 *
5 * This file is distributed under 3-clause BSD license.
6 * The complete license agreement can be obtained at:
7 * http://arrayfire.com/licenses/BSD-3-Clause
8 ********************************************************/
9
17#pragma once
18
19#include <af/defines.h>
20
21#ifdef __cplusplus
22namespace af
23{
24 class array;
52 AFAPI array matmul(const array &lhs, const array &rhs,
53 const matProp optLhs = AF_MAT_NONE,
54 const matProp optRhs = AF_MAT_NONE);
55
69 AFAPI array matmulNT(const array &lhs, const array &rhs);
70
84 AFAPI array matmulTN(const array &lhs, const array &rhs);
85
99 AFAPI array matmulTT(const array &lhs, const array &rhs);
100
116 AFAPI array matmul(const array &a, const array &b, const array &c);
117
118
135 AFAPI array matmul(const array &a, const array &b, const array &c, const array &d);
136
137#if AF_API_VERSION >= 35
172 template <typename T>
173 T dot(const array &lhs, const array &rhs,
174 const matProp optLhs = AF_MAT_NONE,
175 const matProp optRhs = AF_MAT_NONE);
176#endif
177
179 AFAPI array dot(const array &lhs, const array &rhs,
180 const matProp optLhs = AF_MAT_NONE,
181 const matProp optRhs = AF_MAT_NONE);
182
193 AFAPI array transpose(const array &in, const bool conjugate = false);
194
205 AFAPI void transposeInPlace(array &in, const bool conjugate = false);
206}
207#endif
208
209#ifdef __cplusplus
210extern "C" {
211#endif
212
213#if AF_API_VERSION >= 37
279 const void *alpha, const af_array A, const af_array B,
280 const void *beta);
281#endif
282
308 const af_array lhs, const af_array rhs,
309 const af_mat_prop optLhs, const af_mat_prop optRhs);
310
311
333 const af_array lhs, const af_array rhs,
334 const af_mat_prop optLhs, const af_mat_prop optRhs);
335
336#if AF_API_VERSION >= 35
353 AFAPI af_err af_dot_all(double *real, double *imag,
354 const af_array lhs, const af_array rhs,
355 const af_mat_prop optLhs, const af_mat_prop optRhs);
356#endif
357
370 AFAPI af_err af_transpose(af_array *out, af_array in, const bool conjugate);
371
382 AFAPI af_err af_transpose_inplace(af_array in, const bool conjugate);
383
384
385#ifdef __cplusplus
386}
387#endif
A multi dimensional data container.
Definition: array.h:37
af_mat_prop
Definition: defines.h:348
@ AF_MAT_NONE
Default.
Definition: defines.h:349
af_err
Definition: defines.h:71
void * af_array
Definition: defines.h:240
#define AFAPI
Definition: defines.h:38
AFAPI array imag(const array &in)
C++ Interface for getting imaginary part from complex array.
AFAPI array real(const array &in)
C++ Interface for getting real part from complex array.
AFAPI af_err af_dot(af_array *out, const af_array lhs, const af_array rhs, const af_mat_prop optLhs, const af_mat_prop optRhs)
Scalar dot product between two vectors.
AFAPI af_err af_dot_all(double *real, double *imag, const af_array lhs, const af_array rhs, const af_mat_prop optLhs, const af_mat_prop optRhs)
Scalar dot product between two vectors.
T dot(const array &lhs, const array &rhs, const matProp optLhs=AF_MAT_NONE, const matProp optRhs=AF_MAT_NONE)
Dot Product.
AFAPI af_err af_gemm(af_array *C, const af_mat_prop opA, const af_mat_prop opB, const void *alpha, const af_array A, const af_array B, const void *beta)
BLAS general matrix multiply (GEMM) of two af_array objects.
AFAPI af_err af_matmul(af_array *out, const af_array lhs, const af_array rhs, const af_mat_prop optLhs, const af_mat_prop optRhs)
Matrix multiply of two af_array.
AFAPI array matmul(const array &lhs, const array &rhs, const matProp optLhs=AF_MAT_NONE, const matProp optRhs=AF_MAT_NONE)
Matrix multiply of two arrays.
AFAPI array matmulTN(const array &lhs, const array &rhs)
Matrix multiply of two arrays.
AFAPI array matmulTT(const array &lhs, const array &rhs)
Matrix multiply of two arrays.
AFAPI array matmulNT(const array &lhs, const array &rhs)
Matrix multiply of two arrays.
AFAPI array transpose(const array &in, const bool conjugate=false)
Transposes a matrix.
AFAPI af_err af_transpose(af_array *out, af_array in, const bool conjugate)
Transposes a matrix.
AFAPI void transposeInPlace(array &in, const bool conjugate=false)
Transposes a matrix in-place.
AFAPI af_err af_transpose_inplace(af_array in, const bool conjugate)
Transposes a matrix in-place.
static af::array array(af::dim4 idims, cl_mem buf, af::dtype type, bool retain=false)
Create an af::array object from an OpenCL cl_mem buffer.
Definition: opencl.h:327
Definition: algorithm.h:15