A high-performance general-purpose compute library

- Main Page
- Tutorials
- Release Notes
- Examples

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
14 namespace 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
198 extern "C" {
199#endif
200
201#if AF_API_VERSION >= 37
257 AFAPI af_err af_gemm(af_array *C, const af_mat_prop opA, const af_mat_prop opB,
258 const void *alpha, const af_array A, const af_array B,
259 const void *beta);
260#endif
261
286 AFAPI af_err af_matmul( af_array *out ,
287 const af_array lhs, const af_array rhs,
288 const af_mat_prop optLhs, const af_mat_prop optRhs);
289
314 AFAPI af_err af_dot(af_array *out,
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
af::array
A multi dimensional data container.
Definition array.h:37
defines.h
af_mat_prop
af_mat_prop
Definition defines.h:348
AF_MAT_NONE
@ AF_MAT_NONE
Default.
Definition defines.h:349
af_err
af_err
Definition defines.h:71
af_array
void * af_array
Definition defines.h:240
AFAPI
#define AFAPI
Definition defines.h:38
af_dot
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.
af::dot
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.
af_dot_all
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.
af_gemm
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.
af::matmulTT
AFAPI array matmulTT(const array &lhs, const array &rhs)
C++ Interface to multiply two matrices.
af_matmul
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.
af::matmulTN
AFAPI array matmulTN(const array &lhs, const array &rhs)
C++ Interface to multiply two matrices.
af::matmul
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.
af::matmulNT
AFAPI array matmulNT(const array &lhs, const array &rhs)
C++ Interface to multiply two matrices.
af_transpose
AFAPI af_err af_transpose(af_array *out, af_array in, const bool conjugate)
C Interface to transpose a matrix.
af::transposeInPlace
AFAPI void transposeInPlace(array &in, const bool conjugate=false)
C++ Interface to transpose a matrix in-place.
af::transpose
AFAPI array transpose(const array &in, const bool conjugate=false)
C++ Interface to transpose a matrix.
af_transpose_inplace
AFAPI af_err af_transpose_inplace(af_array in, const bool conjugate)
C Interface to transpose a matrix in-place.
af
Definition algorithm.h:15