A high-performance general-purpose compute library
blas.h
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
191 AFAPI array transpose(const array &in, const bool conjugate = false);
192
201 AFAPI void transposeInPlace(array &in, const bool conjugate = false);
202}
203#endif
204
205#ifdef __cplusplus
206extern "C" {
207#endif
208
209#if AF_API_VERSION >= 37
275 const void *alpha, const af_array A, const af_array B,
276 const void *beta);
277#endif
278
304 const af_array lhs, const af_array rhs,
305 const af_mat_prop optLhs, const af_mat_prop optRhs);
306
307
329 const af_array lhs, const af_array rhs,
330 const af_mat_prop optLhs, const af_mat_prop optRhs);
331
332#if AF_API_VERSION >= 35
349 AFAPI af_err af_dot_all(double *real, double *imag,
350 const af_array lhs, const af_array rhs,
351 const af_mat_prop optLhs, const af_mat_prop optRhs);
352#endif
353
364 AFAPI af_err af_transpose(af_array *out, af_array in, const bool conjugate);
365
374 AFAPI af_err af_transpose_inplace(af_array in, const bool conjugate);
375
376
377#ifdef __cplusplus
378}
379#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 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.
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_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.
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 array matmulTT(const array &lhs, const array &rhs)
Matrix multiply of two arrays.
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 matmulTN(const array &lhs, const array &rhs)
Matrix multiply of two arrays.
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 matmulNT(const array &lhs, const array &rhs)
Matrix multiply of two arrays.
AFAPI af_err af_transpose(af_array *out, af_array in, const bool conjugate)
C Interface for transposing a matrix.
AFAPI void transposeInPlace(array &in, const bool conjugate=false)
C++ Interface for transposing a matrix in-place.
AFAPI array transpose(const array &in, const bool conjugate=false)
C++ Interface for transposing a matrix.
AFAPI af_err af_transpose_inplace(af_array in, const bool conjugate)
C Interface for transposing a matrix in-place.
Definition: algorithm.h:15