2015-01-23 03:38:24 +03:00
|
|
|
#ifndef CUDA_H
|
|
|
|
#define CUDA_H
|
|
|
|
|
2015-01-31 09:05:23 +03:00
|
|
|
extern int gpu_index;
|
|
|
|
|
|
|
|
#ifdef GPU
|
|
|
|
|
2015-08-11 09:22:27 +03:00
|
|
|
#define BLOCK 512
|
2015-01-23 03:38:24 +03:00
|
|
|
|
|
|
|
#include "cuda_runtime.h"
|
2015-03-21 22:25:14 +03:00
|
|
|
#include "curand.h"
|
2015-01-23 03:38:24 +03:00
|
|
|
#include "cublas_v2.h"
|
|
|
|
|
2016-05-13 21:59:43 +03:00
|
|
|
#ifdef CUDNN
|
|
|
|
#include "cudnn.h"
|
|
|
|
#endif
|
|
|
|
|
2015-01-23 03:38:24 +03:00
|
|
|
void check_error(cudaError_t status);
|
|
|
|
cublasHandle_t blas_handle();
|
2016-05-13 21:59:43 +03:00
|
|
|
float *cuda_make_array(float *x, size_t n);
|
|
|
|
int *cuda_make_int_array(size_t n);
|
|
|
|
void cuda_push_array(float *x_gpu, float *x, size_t n);
|
|
|
|
void cuda_pull_array(float *x_gpu, float *x, size_t n);
|
2015-01-23 03:38:24 +03:00
|
|
|
void cuda_free(float *x_gpu);
|
2016-05-13 21:59:43 +03:00
|
|
|
void cuda_random(float *x_gpu, size_t n);
|
|
|
|
float cuda_compare(float *x_gpu, float *x, size_t n, char *s);
|
2015-01-23 03:38:24 +03:00
|
|
|
dim3 cuda_gridsize(size_t n);
|
|
|
|
|
2016-05-13 21:59:43 +03:00
|
|
|
#ifdef CUDNN
|
|
|
|
cudnnHandle_t cudnn_handle();
|
|
|
|
#endif
|
|
|
|
|
2015-01-23 03:38:24 +03:00
|
|
|
#endif
|
2015-01-31 09:05:23 +03:00
|
|
|
#endif
|