aboutsummaryrefslogtreecommitdiff
path: root/nerv/lib/matrix/cumatrix.h
blob: 280035bbbc2cd505f53cb25dab496d902277ff42 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#ifndef NERV_CUMATRIX_H
#define NERV_CUMATRIX_H
#include "matrix.h"
#include "../common.h"
#include "cuda_helper.h"

typedef struct CuContext {
    cublasHandle_t cublas_handle;
    cudaEvent_t profile_start, profile_stop;
    curandGenerator_t curand_gen;
    HashMap *profile;
} CuContext;

void nerv_cuda_context_print_profile(CuContext *context);
void nerv_cuda_context_clear_profile(CuContext *context);
void nerv_cuda_context_accu_profile(CuContext *context, const char *name, float delta);
void nerv_cuda_context_select_gpu(CuContext *context, int dev, Status *status);
CuContext *nerv_cuda_context_create(Status *status);
void nerv_cuda_context_destroy(CuContext *contex, Status *status);
#endif