Commit 6790b8f3 authored by Chao Liu's avatar Chao Liu
Browse files

rename

parent d2a488dd
...@@ -5,7 +5,8 @@ ...@@ -5,7 +5,8 @@
#include "nvToolsExt.h" #include "nvToolsExt.h"
#include "tensor.hpp" #include "tensor.hpp"
#include "constant_tensor_descriptor.cuh" #include "constant_tensor_descriptor.cuh"
#include "device_direct_convolution_3.cuh" #include "device_direct_convolution_1.cuh"
#include "device_direct_convolution_2.cuh"
template <class T> template <class T>
struct GeneratorConstant struct GeneratorConstant
...@@ -177,7 +178,7 @@ int main() ...@@ -177,7 +178,7 @@ int main()
for(int i = 0; i < 20; ++i) for(int i = 0; i < 20; ++i)
{ {
device_convolution(in_desc, in, wei_desc, wei, out_desc, out_device); device_direct_convolution_2(in_desc, in, wei_desc, wei, out_desc, out_device);
} }
#if 0 #if 0
......
#pragma once #pragma once
#include "direct_convolution_3.cuh" #include "gridwise_direct_convolution_1.cuh"
template <class T, class InDesc, class WeiDesc, class OutDesc> template <class T, class InDesc, class WeiDesc, class OutDesc>
void device_convolution( void device_direct_convolution_1(
InDesc, const Tensor<T>& in, WeiDesc, const Tensor<T>& wei, OutDesc, Tensor<T>& out) InDesc, const Tensor<T>& in, WeiDesc, const Tensor<T>& wei, OutDesc, Tensor<T>& out)
{ {
std::size_t data_sz = sizeof(T); std::size_t data_sz = sizeof(T);
...@@ -26,16 +26,12 @@ void device_convolution( ...@@ -26,16 +26,12 @@ void device_convolution(
constexpr auto out_desc = OutDesc{}; constexpr auto out_desc = OutDesc{};
constexpr unsigned OutTileSizeH = 2; constexpr unsigned OutTileSizeH = 2;
constexpr unsigned OutTileSizeW = 2; constexpr unsigned OutTileSizeW = 2;
constexpr unsigned NPerBlock = 2; constexpr unsigned NPerBlock = 1;
constexpr unsigned KPerBlock = 32; constexpr unsigned KPerBlock = 4;
constexpr unsigned CPerBlock = 2; constexpr unsigned CPerBlock = 2;
constexpr unsigned YPerBlock = 1; constexpr unsigned YPerBlock = 8;
constexpr unsigned XPerBlock = 16; constexpr unsigned XPerBlock = 16;
constexpr unsigned NPerThread = 2;
constexpr unsigned KPerThread = 4;
constexpr unsigned CPerThread = 2;
constexpr unsigned NBlockOpLen0 = 1; constexpr unsigned NBlockOpLen0 = 1;
constexpr unsigned NBlockOpLen1 = 1; constexpr unsigned NBlockOpLen1 = 1;
constexpr unsigned NBlockOpLen2 = 4; constexpr unsigned NBlockOpLen2 = 4;
...@@ -70,9 +66,6 @@ void device_convolution( ...@@ -70,9 +66,6 @@ void device_convolution(
CPerBlock, CPerBlock,
YPerBlock, YPerBlock,
XPerBlock, XPerBlock,
NPerThread,
KPerThread,
CPerThread,
NBlockOpLen0, NBlockOpLen0,
NBlockOpLen1, NBlockOpLen1,
NBlockOpLen2, NBlockOpLen2,
......
#pragma once #pragma once
#include "direct_convolution_2.cuh" #include "gridwise_direct_convolution_2.cuh"
template <class T, class InDesc, class WeiDesc, class OutDesc> template <class T, class InDesc, class WeiDesc, class OutDesc>
void device_convolution( void device_direct_convolution_2(
InDesc, const Tensor<T>& in, WeiDesc, const Tensor<T>& wei, OutDesc, Tensor<T>& out) InDesc, const Tensor<T>& in, WeiDesc, const Tensor<T>& wei, OutDesc, Tensor<T>& out)
{ {
std::size_t data_sz = sizeof(T); std::size_t data_sz = sizeof(T);
...@@ -26,12 +26,16 @@ void device_convolution( ...@@ -26,12 +26,16 @@ void device_convolution(
constexpr auto out_desc = OutDesc{}; constexpr auto out_desc = OutDesc{};
constexpr unsigned OutTileSizeH = 2; constexpr unsigned OutTileSizeH = 2;
constexpr unsigned OutTileSizeW = 2; constexpr unsigned OutTileSizeW = 2;
constexpr unsigned NPerBlock = 1; constexpr unsigned NPerBlock = 2;
constexpr unsigned KPerBlock = 4; constexpr unsigned KPerBlock = 32;
constexpr unsigned CPerBlock = 2; constexpr unsigned CPerBlock = 2;
constexpr unsigned YPerBlock = 8; constexpr unsigned YPerBlock = 1;
constexpr unsigned XPerBlock = 16; constexpr unsigned XPerBlock = 16;
constexpr unsigned NPerThread = 2;
constexpr unsigned KPerThread = 4;
constexpr unsigned CPerThread = 2;
constexpr unsigned NBlockOpLen0 = 1; constexpr unsigned NBlockOpLen0 = 1;
constexpr unsigned NBlockOpLen1 = 1; constexpr unsigned NBlockOpLen1 = 1;
constexpr unsigned NBlockOpLen2 = 4; constexpr unsigned NBlockOpLen2 = 4;
...@@ -66,6 +70,9 @@ void device_convolution( ...@@ -66,6 +70,9 @@ void device_convolution(
CPerBlock, CPerBlock,
YPerBlock, YPerBlock,
XPerBlock, XPerBlock,
NPerThread,
KPerThread,
CPerThread,
NBlockOpLen0, NBlockOpLen0,
NBlockOpLen1, NBlockOpLen1,
NBlockOpLen2, NBlockOpLen2,
......
#pragma once #pragma once
#include "constant_tensor_descriptor.cuh" #include "constant_tensor_descriptor.cuh"
#include "threadwise_tensor_op.cuh" #include "threadwise_tensor_op.cuh"
#include "threadwise_convolution.cuh" #include "threadwise_direct_convolution.cuh"
template <class TFloat, template <class TFloat,
class InBlockDesc, class InBlockDesc,
......
#pragma once #pragma once
#include "constant_tensor_descriptor.cuh" #include "constant_tensor_descriptor.cuh"
#include "blockwise_tensor_op.cuh" #include "blockwise_tensor_op.cuh"
#include "blockwise_convolution.cuh" #include "blockwise_direct_convolution.cuh"
template <class TFloat, template <class TFloat,
class InGlobalDesc, class InGlobalDesc,
......
#pragma once #pragma once
#include "constant_tensor_descriptor.cuh" #include "constant_tensor_descriptor.cuh"
#include "blockwise_tensor_op.cuh" #include "blockwise_tensor_op.cuh"
#include "blockwise_convolution.cuh" #include "blockwise_direct_convolution.cuh"
#include "threadwise_tensor_op.cuh" #include "threadwise_tensor_op.cuh"
#include "threadwise_convolution.cuh" #include "threadwise_direct_convolution.cuh"
template <class TFloat, template <class TFloat,
class InGlobalDesc, class InGlobalDesc,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment