blas.h Source File

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
22 namespace 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
165 AFAPI array dot (const array &lhs, const array &rhs,
166 const matProp optLhs = AF_MAT_NONE,
167 const matProp optRhs = AF_MAT_NONE);
168
169 #if AF_API_VERSION >= 35
170
197 template<typename T> T dot(const array &lhs, const array &rhs,
198 const matProp optLhs = AF_MAT_NONE,
199 const matProp optRhs = AF_MAT_NONE);
200 #endif
201
212 AFAPI array transpose(const array& in, const bool conjugate = false);
213
224 AFAPI void transposeInPlace(array& in, const bool conjugate = false);
225 }
226 #endif
227
228 #ifdef __cplusplus
229 extern "C" {
230 #endif
231
256 AFAPI af_err af_matmul( af_array *out ,
257 const af_array lhs, const af_array rhs,
258 const af_mat_prop optLhs, const af_mat_prop optRhs);
259
260
281 AFAPI af_err af_dot(af_array *out,
282 const af_array lhs, const af_array rhs,
283 const af_mat_prop optLhs, const af_mat_prop optRhs);
284
285 #if AF_API_VERSION >= 35
286
302 AFAPI af_err af_dot_all(double *real, double *imag,
303 const af_array lhs, const af_array rhs,
304 const af_mat_prop optLhs, const af_mat_prop optRhs);
305 #endif
306
319 AFAPI af_err af_transpose(af_array *out, af_array in, const bool conjugate);
320
331 AFAPI af_err af_transpose_inplace(af_array in, const bool conjugate);
332
333
334 #ifdef __cplusplus
335 }
336 #endif
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)
Scalar dot product between two vectors.
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)
Matrix multiply of two af_array.
af
Definition: algorithm.h:14
af::matmulTN
AFAPI array matmulTN(const array &lhs, const array &rhs)
Matrix multiply of two arrays.
af::dot
AFAPI array dot(const array &lhs, const array &rhs, const matProp optLhs=AF_MAT_NONE, const matProp optRhs=AF_MAT_NONE)
Dot Product.
AF_MAT_NONE
Default.
Definition: defines.h:321
af_transpose
AFAPI af_err af_transpose(af_array *out, af_array in, const bool conjugate)
Transposes a matrix.
af::matmulNT
AFAPI array matmulNT(const array &lhs, const array &rhs)
Matrix multiply of two arrays.
af_err
af_err
Definition: defines.h:63
defines.h
af::matmulTT
AFAPI array matmulTT(const array &lhs, const array &rhs)
Matrix multiply of two arrays.
af::matmul
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.
af::imag
AFAPI array imag(const array &in)
C++ Interface for getting imaginary part from complex array.
af::matProp
af_mat_prop matProp
Definition: defines.h:479
af::real
AFAPI array real(const array &in)
C++ Interface for getting real part from complex array.
AFAPI
#define AFAPI
Definition: defines.h:31
af_transpose_inplace
AFAPI af_err af_transpose_inplace(af_array in, const bool conjugate)
Transposes a matrix in-place.
afcl::array
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
af_mat_prop
af_mat_prop
Definition: defines.h:320
af_array
void * af_array
Definition: defines.h:222
af::transposeInPlace
AFAPI void transposeInPlace(array &in, const bool conjugate=false)
Transposes a matrix in-place.
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)
Scalar dot product between two vectors.
af::transpose
AFAPI array transpose(const array &in, const bool conjugate=false)
Transposes a matrix.