Implement max pooling layer

This commit is contained in:
2024-03-19 22:04:58 +01:00
parent 364715ff70
commit a0fc1b00ae
9 changed files with 245 additions and 21 deletions

View File

@@ -0,0 +1,30 @@
#ifndef CUDANET_POOLING_H
#define CUDANET_POOLING_H
#include <cuda_runtime.h>
namespace CUDANet::Kernels {
__global__ void max_pooling(
const float* __restrict__ d_input,
float* __restrict__ d_output,
const int inputSize,
const int nChannels,
const int poolingSize,
const int stride,
const int paddingSize
);
__global__ void avg_pooling(
const float* __restrict__ d_input,
float* __restrict__ d_output,
const int inputSize,
const int nChannels,
const int poolingSize,
const int stride,
const int paddingSize
);
} // namespace CUDANet::Kernels
#endif // CUDANET_POOLING_H