Implement max pooling test

This commit is contained in:
2024-03-20 21:44:04 +01:00
parent c062e89972
commit dfff0360d9
9 changed files with 134 additions and 32 deletions

View File

@@ -9,6 +9,7 @@ __global__ void max_pooling(
const float* __restrict__ d_input,
float* __restrict__ d_output,
const int inputSize,
const int outputSize,
const int nChannels,
const int poolingSize,
const int stride
@@ -18,6 +19,7 @@ __global__ void avg_pooling(
const float* __restrict__ d_input,
float* __restrict__ d_output,
const int inputSize,
const int outputSize,
const int nChannels,
const int poolingSize,
const int stride

View File

@@ -3,8 +3,8 @@
#include <cuda_runtime.h>
#include "layer.cuh"
#include "activation.cuh"
#include "layer.cuh"
namespace CUDANet::Layers {
@@ -21,6 +21,15 @@ class MaxPooling2D : public SequentialLayer {
float* forward(const float* d_input);
/**
* @brief Get the output width (/ height) of the layer
*
* @return int
*/
int getOutputSize() {
return outputSize;
}
private:
int inputSize;
int nChannels;