mirror of
https://github.com/lordmathis/CUDANet.git
synced 2025-11-06 01:34:22 +00:00
Remove cublas dependency
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
#ifndef CONV_LAYER_H
|
||||
#define CONV_LAYER_H
|
||||
|
||||
#include <cublas_v2.h>
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
@@ -19,8 +17,7 @@ class Conv2d {
|
||||
int stride,
|
||||
std::string padding,
|
||||
int numFilters,
|
||||
Activation activation,
|
||||
cublasHandle_t cublasHandle
|
||||
Activation activation
|
||||
);
|
||||
~Conv2d();
|
||||
|
||||
@@ -44,7 +41,6 @@ class Conv2d {
|
||||
std::vector<float> kernels;
|
||||
|
||||
// Cuda
|
||||
cublasHandle_t cublasHandle;
|
||||
float* d_kernels;
|
||||
float* d_padded;
|
||||
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
#ifndef DENSE_LAYER_H
|
||||
#define DENSE_LAYER_H
|
||||
|
||||
#include <cublas_v2.h>
|
||||
|
||||
#include <functional>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
@@ -16,8 +14,7 @@ class Dense : public ILayer {
|
||||
Dense(
|
||||
int inputSize,
|
||||
int outputSize,
|
||||
Activation activation,
|
||||
cublasHandle_t cublasHandle
|
||||
Activation activation
|
||||
);
|
||||
~Dense();
|
||||
|
||||
@@ -29,8 +26,6 @@ class Dense : public ILayer {
|
||||
int inputSize;
|
||||
int outputSize;
|
||||
|
||||
cublasHandle_t cublasHandle;
|
||||
|
||||
float* d_weights;
|
||||
float* d_biases;
|
||||
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
#ifndef I_LAYER_H
|
||||
#define I_LAYER_H
|
||||
|
||||
#include <cublas_v2.h>
|
||||
|
||||
#include <vector>
|
||||
|
||||
namespace Layers {
|
||||
|
||||
@@ -2,9 +2,6 @@
|
||||
#define CUDA_HELPER_H
|
||||
|
||||
#include <cuda_runtime.h>
|
||||
#include <cublas_v2.h>
|
||||
|
||||
#define IDX2C(i,j,ld) (((j)*(ld))+(i))
|
||||
|
||||
// CUDA error checking macro
|
||||
#define CUDA_CHECK(call) \
|
||||
@@ -18,15 +15,4 @@ do { \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
// cuBLAS error checking macro
|
||||
#define CUBLAS_CHECK(call) \
|
||||
do { \
|
||||
cublasStatus_t result = call; \
|
||||
if (result != CUBLAS_STATUS_SUCCESS) { \
|
||||
fprintf(stderr, "cuBLAS error at %s:%d code=%d\n", \
|
||||
__FILE__, __LINE__, static_cast<unsigned int>(result)); \
|
||||
exit(EXIT_FAILURE); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#endif // CUDA_HELPER_H
|
||||
|
||||
Reference in New Issue
Block a user