#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