mirror of
https://github.com/lordmathis/CUDANet.git
synced 2025-12-24 23:34:24 +00:00
WIP Migrate Activation to Tensor
This commit is contained in:
23
include/backend/cuda_backend.cuh
Normal file
23
include/backend/cuda_backend.cuh
Normal file
@@ -0,0 +1,23 @@
|
||||
#pragma once
|
||||
|
||||
#include "backend/backend.hpp"
|
||||
#include "backend/tensor.hpp"
|
||||
|
||||
namespace CUDANet::Backend {
|
||||
|
||||
class CUDABackend : public IBackend {
|
||||
public:
|
||||
// Memory management
|
||||
void* allocate(size_t bytes) override;
|
||||
void deallocate(void* ptr) override;
|
||||
|
||||
// Layer operations
|
||||
void relu(CUDANet::Backend::Tensor &tensor) override;
|
||||
void sigmoid(CUDANet::Backend::Tensor &tensor) override;
|
||||
void softmax(CUDANet::Backend::Tensor &tensor, CUDANet::Backend::Tensor &temp_max, CUDANet::Backend::Tensor &temp_sum) override;
|
||||
|
||||
private:
|
||||
static constexpr int BLOCK_SIZE = 256;
|
||||
};
|
||||
|
||||
} // namespace CUDANet::Backend
|
||||
Reference in New Issue
Block a user