aboutsummaryrefslogblamecommitdiff
path: root/nerv/lib/matrix/cumatrix.h
blob: fd2a5cecaaa53d84734386d4fa0c066aff7d703c (plain) (tree)
1
2
3
4
5
6
7
8

                       
                   
                      


                          
                   









                                                                                       
                                                             
                                                                  
      
#ifndef NERV_CUMATRIX_H
#define NERV_CUMATRIX_H
#include "matrix.h"
#include "../common.h"
#include "cuda_helper.h"

typedef struct CuContext {
    int has_handle;
    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(int dev, Status *status);
void nerv_cuda_context_destroy(CuContext *contex, Status *status);
#endif