Fix some compilation errors

This commit is contained in:
2025-11-23 18:50:57 +01:00
parent 51bcee01ab
commit 82a0e7c19d
14 changed files with 15 additions and 23 deletions

View File

@@ -25,7 +25,7 @@ cudaDeviceProp initializeCUDA() {
return deviceProp;
}
using namespace CUDANet::Backend;
using namespace CUDANet::Backends;
void* CUDA::allocate(size_t bytes) {
void* d_ptr = nullptr;

View File

@@ -1,5 +1,4 @@
#include "activation_functions.cuh"
#include "cuda_helper.cuh"
using namespace CUDANet;

View File

@@ -1,4 +1,4 @@
#include "cuda_helper.cuh"
#include "backend/cuda.cuh"
#include "matmul.cuh"
using namespace CUDANet;

View File

@@ -4,7 +4,7 @@
#include "kernels/matmul.cuh"
#include "kernels/pool.cuh"
using namespace CUDANet::Backend;
using namespace CUDANet::Backends;
void CUDA::relu(Tensor& tensor) {
int gridSize = (tensor.numel() + BLOCK_SIZE - 1) / BLOCK_SIZE;

View File

@@ -4,7 +4,7 @@
#include "backend/cuda.cuh"
#include "kernels/matmul.cuh"
using namespace CUDANet::Backend;
using namespace CUDANet::Backends;
void CUDA::print(const CUDANet::Tensor &input) {
auto length = input.numel();

View File

@@ -7,11 +7,11 @@
using namespace CUDANet::Layers;
Activation::Activation(CUDANet::Backend* backend, ActivationType activation, const CUDANet::Shape &shape)
Activation::Activation(ActivationType activation, const CUDANet::Shape &shape, CUDANet::Backend* backend)
: backend(backend), activationType(activation), shape(shape) {
if (shape.size() != 1) {
throw std::runtime_error(std::format("Invalid shape. Expected [1], got {}", shape));
throw InvalidShapeException("input", 1, shape.size());
}
auto length = shape[0];