Migrate MaxPool2d layer to Tensors

This commit is contained in:
2025-11-19 21:44:19 +01:00
parent 7896ff0e24
commit e4d05931d4
17 changed files with 215 additions and 454 deletions

View File

@@ -1,33 +1,28 @@
#ifndef CUDANET_POOLING_H
#define CUDANET_POOLING_H
#pragma once
#include <cuda_runtime.h>
#include "layer.hpp"
namespace CUDANet::Kernels {
__global__ void max_pooling(
__global__ void max_pool(
const float* __restrict__ d_input,
float* __restrict__ d_output,
const shape2d inputSize,
const shape2d outputSize,
const int nChannels,
const shape2d poolingSize,
const shape2d stride,
const shape2d padding
const Shape input_shape,
const Shape output_shape,
const Shape pool_shape,
const Shape stride_shape,
const Shape padding_shape
);
__global__ void avg_pooling(
__global__ void avg_pool(
const float* __restrict__ d_input,
float* __restrict__ d_output,
const shape2d inputSize,
const shape2d outputSize,
const int nChannels,
const shape2d poolingSize,
const shape2d stride,
const shape2d padding
const Shape input_shape,
const Shape output_shape,
const Shape pool_shape,
const Shape stride_shape,
const Shape padding_shape
);
} // namespace CUDANet::Kernels
#endif // CUDANET_POOLING_H