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;
43  AFAPI array matmul(const array &lhs, const array &rhs,
44  const matProp optLhs = AF_MAT_NONE,
45  const matProp optRhs = AF_MAT_NONE);
46 
60  AFAPI array matmulNT(const array &lhs, const array &rhs);
61 
75  AFAPI array matmulTN(const array &lhs, const array &rhs);
76 
90  AFAPI array matmulTT(const array &lhs, const array &rhs);
91 
107  AFAPI array matmul(const array &a, const array &b, const array &c);
108 
109 
126  AFAPI array matmul(const array &a, const array &b, const array &c, const array &d);
127 
128 
145  AFAPI array dot (const array &lhs, const array &rhs,
146  const matProp optLhs = AF_MAT_NONE,
147  const matProp optRhs = AF_MAT_NONE);
148 
159  AFAPI array transpose(const array& in, const bool conjugate = false);
160 
171  AFAPI void transposeInPlace(array& in, const bool conjugate = false);
172 }
173 #endif
174 
175 #ifdef __cplusplus
176 extern "C" {
177 #endif
178 
194  const af_array lhs, const af_array rhs,
195  const af_mat_prop optLhs, const af_mat_prop optRhs);
196 
197 
209  AFAPI af_err af_dot( af_array *out,
210  const af_array lhs, const af_array rhs,
211  const af_mat_prop optLhs, const af_mat_prop optRhs);
212 
225  AFAPI af_err af_transpose(af_array *out, af_array in, const bool conjugate);
226 
237  AFAPI af_err af_transpose_inplace(af_array in, const bool conjugate);
238 
239 
240 #ifdef __cplusplus
241 }
242 #endif
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_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.
Definition: algorithm.h:14
AFAPI array matmulTN(const array &lhs, const array &rhs)
Matrix multiply of two arrays.
Default.
Definition: defines.h:243
AFAPI af_err af_transpose(af_array *out, af_array in, const bool conjugate)
Transposes a matrix.
AFAPI array matmulNT(const array &lhs, const array &rhs)
Matrix multiply of two arrays.
af_err
Definition: defines.h:58
AFAPI array matmulTT(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.
af_mat_prop matProp
Definition: defines.h:300
#define AFAPI
Definition: defines.h:31
AFAPI array 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_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:105
af_mat_prop
Definition: defines.h:242
void * af_array
Definition: defines.h:172
AFAPI void transposeInPlace(array &in, const bool conjugate=false)
Transposes a matrix in-place.
AFAPI array transpose(const array &in, const bool conjugate=false)
Transposes a matrix.