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
10#pragma once
11#include <af/defines.h>
12
13#ifdef __cplusplus
14namespace af
15{
16 class array;
44 AFAPI array matmul(const array &lhs, const array &rhs,
45 const matProp optLhs = AF_MAT_NONE,
46 const matProp optRhs = AF_MAT_NONE);
47
62 AFAPI array matmulNT(const array &lhs, const array &rhs);
63
78 AFAPI array matmulTN(const array &lhs, const array &rhs);
79
94 AFAPI array matmulTT(const array &lhs, const array &rhs);
95
110 AFAPI array matmul(const array &a, const array &b, const array &c);
111
112
128 AFAPI array matmul(const array &a, const array &b, const array &c, const array &d);
129
130#if AF_API_VERSION >= 35
163 template <typename T>
164 T dot(const array &lhs, const array &rhs,
165 const matProp optLhs = AF_MAT_NONE,
166 const matProp optRhs = AF_MAT_NONE);
167#endif
168
170 AFAPI array dot(const array &lhs, const array &rhs,
171 const matProp optLhs = AF_MAT_NONE,
172 const matProp optRhs = AF_MAT_NONE);
173
183 AFAPI array transpose(const array &in, const bool conjugate = false);
184
193 AFAPI void transposeInPlace(array &in, const bool conjugate = false);
194}
195#endif
196
197#ifdef __cplusplus
198extern "C" {
199#endif
200
201#if AF_API_VERSION >= 37
258 const void *alpha, const af_array A, const af_array B,
259 const void *beta);
260#endif
261
287 const af_array lhs, const af_array rhs,
288 const af_mat_prop optLhs, const af_mat_prop optRhs);
289
315 const af_array lhs, const af_array rhs,
316 const af_mat_prop optLhs, const af_mat_prop optRhs);
317
318#if AF_API_VERSION >= 35
338 AFAPI af_err af_dot_all(double *real, double *imag,
339 const af_array lhs, const af_array rhs,
340 const af_mat_prop optLhs, const af_mat_prop optRhs);
341#endif
342
354 AFAPI af_err af_transpose(af_array *out, af_array in, const bool conjugate);
355
366 AFAPI af_err af_transpose_inplace(af_array in, const bool conjugate);
367
368
369#ifdef __cplusplus
370}
371#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)
C Interface to compute the dot product.
T dot(const array &lhs, const array &rhs, const matProp optLhs=AF_MAT_NONE, const matProp optRhs=AF_MAT_NONE)
C++ Interface to compute the 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)
C Interface to compute the dot product, scalar result returned on host.
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)
C Interface to multiply two matrices.
AFAPI array matmulTT(const array &lhs, const array &rhs)
C++ Interface to multiply two matrices.
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)
C Interface to multiply two matrices.
AFAPI array matmulTN(const array &lhs, const array &rhs)
C++ Interface to multiply two matrices.
AFAPI array matmul(const array &lhs, const array &rhs, const matProp optLhs=AF_MAT_NONE, const matProp optRhs=AF_MAT_NONE)
C++ Interface to multiply two matrices.
AFAPI array matmulNT(const array &lhs, const array &rhs)
C++ Interface to multiply two matrices.
AFAPI af_err af_transpose(af_array *out, af_array in, const bool conjugate)
C Interface to transpose a matrix.
AFAPI void transposeInPlace(array &in, const bool conjugate=false)
C++ Interface to transpose a matrix in-place.
AFAPI array transpose(const array &in, const bool conjugate=false)
C++ Interface to transpose a matrix.
AFAPI af_err af_transpose_inplace(af_array in, const bool conjugate)
C Interface to transpose a matrix in-place.
Definition: algorithm.h:15