2014-05-10 02:14:52 +04:00
|
|
|
#include "opencl.h"
|
|
|
|
|
2014-01-29 04:28:42 +04:00
|
|
|
void pm(int M, int N, float *A);
|
|
|
|
void gemm(int TA, int TB, int M, int N, int K, float ALPHA,
|
|
|
|
float *A, int lda,
|
|
|
|
float *B, int ldb,
|
|
|
|
float BETA,
|
|
|
|
float *C, int ldc);
|
2014-04-11 12:00:27 +04:00
|
|
|
float *random_matrix(int rows, int cols);
|
2014-05-01 03:17:40 +04:00
|
|
|
void time_random_matrix(int TA, int TB, int m, int k, int n);
|
2014-05-10 02:14:52 +04:00
|
|
|
|
|
|
|
#ifdef GPU
|
|
|
|
void im2col_ongpu(cl_mem data_im, const int batch,
|
|
|
|
const int channels, const int height, const int width,
|
|
|
|
const int ksize, const int stride, cl_mem data_col);
|
|
|
|
|
|
|
|
void im2col_gpu(float *data_im,
|
|
|
|
const int batch, const int channels, const int height, const int width,
|
|
|
|
const int ksize, const int stride, float *data_col);
|
|
|
|
|
|
|
|
void gemm_ongpu(int TA, int TB, int M, int N, int K, float ALPHA,
|
|
|
|
cl_mem A_gpu, int lda,
|
|
|
|
cl_mem B_gpu, int ldb,
|
|
|
|
float BETA,
|
|
|
|
cl_mem C_gpu, int ldc);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
void im2col_cpu(float* data_im,
|
|
|
|
const int batch, const int channels, const int height, const int width,
|
2014-07-14 09:07:51 +04:00
|
|
|
const int ksize, const int stride, int pad, float* data_col);
|
2014-05-10 02:14:52 +04:00
|
|
|
|
2014-07-14 09:07:51 +04:00
|
|
|
void col2im_cpu(float* data_col,
|
|
|
|
const int batch, const int channels, const int height, const int width,
|
|
|
|
const int ksize, const int stride, int pad, float* data_im);
|
2014-01-29 04:28:42 +04:00
|
|
|
void test_blas();
|
2014-04-11 12:00:27 +04:00
|
|
|
|
2014-05-03 02:20:34 +04:00
|
|
|
void gemm_gpu(int TA, int TB, int M, int N, int K, float ALPHA,
|
2014-04-11 12:00:27 +04:00
|
|
|
float *A, int lda,
|
|
|
|
float *B, int ldb,
|
|
|
|
float BETA,
|
|
|
|
float *C, int ldc);
|
2014-05-03 02:20:34 +04:00
|
|
|
void gemm_cpu(int TA, int TB, int M, int N, int K, float ALPHA,
|
2014-04-11 12:00:27 +04:00
|
|
|
float *A, int lda,
|
|
|
|
float *B, int ldb,
|
|
|
|
float BETA,
|
|
|
|
float *C, int ldc);
|
2014-05-03 02:20:34 +04:00
|
|
|
void axpy_cpu(int N, float ALPHA, float *X, int INCX, float *Y, int INCY);
|
|
|
|
void scal_cpu(int N, float ALPHA, float *X, int INCX);
|
2014-04-11 12:00:27 +04:00
|
|
|
void test_gpu_blas();
|