$darkmode
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
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
131 
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
202 
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 
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
319 
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
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.
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.
Definition: algorithm.h:14
AFAPI array matmulTN(const array &lhs, const array &rhs)
C++ Interface to multiply two matrices.
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.
Default.
Definition: defines.h:349
AFAPI af_err af_transpose(af_array *out, af_array in, const bool conjugate)
C Interface to transpose a matrix.
AFAPI array matmulNT(const array &lhs, const array &rhs)
C++ Interface to multiply two matrices.
af_err
Definition: defines.h:71
AFAPI array matmulTT(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 imag(const array &in)
C++ Interface to return the imaginary part of a complex array.
af_mat_prop matProp
Definition: defines.h:564
AFAPI array real(const array &in)
C++ Interface to return the real part of a complex array.
#define AFAPI
Definition: defines.h:38
AFAPI af_err af_transpose_inplace(af_array in, const bool conjugate)
C Interface to transpose 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:330
af_mat_prop
Definition: defines.h:348
void * af_array
Definition: defines.h:240
AFAPI void transposeInPlace(array &in, const bool conjugate=false)
C++ Interface to transpose a matrix in-place.
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.
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 array transpose(const array &in, const bool conjugate=false)
C++ Interface to transpose a matrix.