mirror of
https://github.com/lordmathis/CUDANet.git
synced 2025-11-06 01:34:22 +00:00
Implement max pooling layer
This commit is contained in:
30
include/kernels/pooling.cuh
Normal file
30
include/kernels/pooling.cuh
Normal 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
|
||||
Reference in New Issue
Block a user