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 #if AF_API_VERSION >= 35
138 
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 
193  AFAPI array transpose(const array &in, const bool conjugate = false);
194 
205  AFAPI void transposeInPlace(array &in, const bool conjugate = false);
206 }
207 #endif
208 
209 #ifdef __cplusplus
210 extern "C" {
211 #endif
212 
213 #if AF_API_VERSION >= 37
214 
278  AFAPI af_err af_gemm(af_array *C, const af_mat_prop opA, const af_mat_prop opB,
279  const void *alpha, const af_array A, const af_array B,
280  const void *beta);
281 #endif
282 
308  const af_array lhs, const af_array rhs,
309  const af_mat_prop optLhs, const af_mat_prop optRhs);
310 
311 
333  const af_array lhs, const af_array rhs,
334  const af_mat_prop optLhs, const af_mat_prop optRhs);
335 
336 #if AF_API_VERSION >= 35
337 
353  AFAPI af_err af_dot_all(double *real, double *imag,
354  const af_array lhs, const af_array rhs,
355  const af_mat_prop optLhs, const af_mat_prop optRhs);
356 #endif
357 
370  AFAPI af_err af_transpose(af_array *out, af_array in, const bool conjugate);
371 
382  AFAPI af_err af_transpose_inplace(af_array in, const bool conjugate);
383 
384 
385 #ifdef __cplusplus
386 }
387 #endif
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_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.
AFAPI
#define AFAPI
Definition: defines.h:38
af_transpose
AFAPI af_err af_transpose(af_array *out, af_array in, const bool conjugate)
Transposes a matrix.
af
Definition: algorithm.h:14
af::matmulTN
AFAPI array matmulTN(const array &lhs, const array &rhs)
Matrix multiply of two arrays.
af_mat_prop
af_mat_prop
Definition: defines.h:348
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)
BLAS general matrix multiply (GEMM) of two af_array objects.
af::matmulNT
AFAPI array matmulNT(const array &lhs, const array &rhs)
Matrix multiply of two arrays.
af_array
void * af_array
Definition: defines.h:240
af::matmulTT
AFAPI array matmulTT(const array &lhs, const array &rhs)
Matrix multiply of two arrays.
af::real
AFAPI array real(const array &in)
C++ Interface for getting real part from complex array.
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.
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::imag
AFAPI array imag(const array &in)
C++ Interface for getting imaginary part from complex array.
AF_MAT_NONE
@ AF_MAT_NONE
Default.
Definition: defines.h:349
af::dot
T dot(const array &lhs, const array &rhs, const matProp optLhs=AF_MAT_NONE, const matProp optRhs=AF_MAT_NONE)
Dot Product.
af::matProp
af_mat_prop matProp
Definition: defines.h:560
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_err
af_err
Definition: defines.h:71
af::transpose
AFAPI array transpose(const array &in, const bool conjugate=false)
Transposes a matrix.
defines.h
af_transpose_inplace
AFAPI af_err af_transpose_inplace(af_array in, const bool conjugate)
Transposes a matrix in-place.
af::transposeInPlace
AFAPI void transposeInPlace(array &in, const bool conjugate=false)
Transposes a matrix in-place.