Rename dim2d to shape2d

This commit is contained in:
2024-05-27 21:14:51 +02:00
parent 07d505a0e5
commit df47a31f36
22 changed files with 120 additions and 120 deletions

View File

@@ -9,13 +9,13 @@ __global__ void Kernels::convolution(
const float* __restrict__ d_kernel,
const float* __restrict__ d_bias,
float* __restrict__ d_output,
const dim2d inputSize,
const shape2d inputSize,
const int nChannels,
const dim2d paddingSize,
const dim2d kernelSize,
const dim2d stride,
const shape2d paddingSize,
const shape2d kernelSize,
const shape2d stride,
const int nFilters,
const dim2d outputSize
const shape2d outputSize
) {
int j = blockDim.x * blockIdx.x + threadIdx.x;
int i = blockDim.y * blockIdx.y + threadIdx.y;

View File

@@ -7,12 +7,12 @@ using namespace CUDANet;
__global__ void Kernels::max_pooling(
const float* __restrict__ d_input,
float* __restrict__ d_output,
const dim2d inputSize,
const dim2d outputSize,
const shape2d inputSize,
const shape2d outputSize,
const int nChannels,
const dim2d poolingSize,
const dim2d stride,
const dim2d padding
const shape2d poolingSize,
const shape2d stride,
const shape2d padding
) {
int j = blockDim.x * blockIdx.x + threadIdx.x;
int i = blockDim.y * blockIdx.y + threadIdx.y;
@@ -48,12 +48,12 @@ __global__ void Kernels::max_pooling(
__global__ void Kernels::avg_pooling(
const float* __restrict__ d_input,
float* __restrict__ d_output,
const dim2d inputSize,
const dim2d outputSize,
const shape2d inputSize,
const shape2d outputSize,
const int nChannels,
const dim2d poolingSize,
const dim2d stride,
const dim2d padding
const shape2d poolingSize,
const shape2d stride,
const shape2d padding
) {
int j = blockDim.x * blockIdx.x + threadIdx.x;
int i = blockDim.y * blockIdx.y + threadIdx.y;

View File

@@ -5,11 +5,11 @@
using namespace CUDANet::Layers;
AvgPooling2d::AvgPooling2d(
dim2d inputSize,
shape2d inputSize,
int nChannels,
dim2d poolingSize,
dim2d stride,
dim2d padding,
shape2d poolingSize,
shape2d stride,
shape2d padding,
ActivationType activationType
)
: inputSize(inputSize),
@@ -66,6 +66,6 @@ int AvgPooling2d::getInputSize() {
return inputSize.first * inputSize.second * nChannels;
}
dim2d AvgPooling2d::getOutputDims() {
shape2d AvgPooling2d::getOutputDims() {
return outputSize;
}

View File

@@ -10,7 +10,7 @@
using namespace CUDANet::Layers;
BatchNorm2d::BatchNorm2d(
dim2d inputSize,
shape2d inputSize,
int inputChannels,
float epsilon,
ActivationType activationType
@@ -128,7 +128,7 @@ int BatchNorm2d::getOutputSize() {
return inputSize.first * inputSize.second * inputChannels;
}
dim2d BatchNorm2d::getOutputDims() {
shape2d BatchNorm2d::getOutputDims() {
return inputSize;
}

View File

@@ -12,12 +12,12 @@
using namespace CUDANet::Layers;
Conv2d::Conv2d(
dim2d inputSize,
shape2d inputSize,
int inputChannels,
dim2d kernelSize,
dim2d stride,
shape2d kernelSize,
shape2d stride,
int numFilters,
dim2d paddingSize,
shape2d paddingSize,
ActivationType activationType
)
: inputSize(inputSize),
@@ -139,6 +139,6 @@ int Conv2d::getInputSize() {
return inputSize.first * inputSize.second * inputChannels;
}
dim2d Conv2d::getOutputDims() {
shape2d Conv2d::getOutputDims() {
return outputSize;
}

View File

@@ -5,11 +5,11 @@
using namespace CUDANet::Layers;
MaxPooling2d::MaxPooling2d(
dim2d inputSize,
shape2d inputSize,
int nChannels,
dim2d poolingSize,
dim2d stride,
dim2d padding,
shape2d poolingSize,
shape2d stride,
shape2d padding,
ActivationType activationType
)
: inputSize(inputSize),
@@ -70,6 +70,6 @@ int MaxPooling2d::getInputSize() {
return inputSize.first * inputSize.second * nChannels;
}
dim2d MaxPooling2d::getOutputDims() {
shape2d MaxPooling2d::getOutputDims() {
return outputSize;
}

View File

@@ -11,7 +11,7 @@
using namespace CUDANet;
Model::Model(const dim2d inputSize, const int inputChannels, const int outputSize)
Model::Model(const shape2d inputSize, const int inputChannels, const int outputSize)
: inputSize(inputSize),
inputChannels(inputChannels),
outputSize(outputSize),