forked from NVIDIA/cudnn-frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconv_sample.h
More file actions
175 lines (161 loc) · 6.35 KB
/
Copy pathconv_sample.h
File metadata and controls
175 lines (161 loc) · 6.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
/*
* Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
#pragma once
#include <iostream>
#include <inttypes.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <cuda_runtime.h>
#include <assert.h>
#include <tuple>
#include <functional>
#include <cudnn_frontend.h>
#include "./utils/fp16_dev.h"
#include "./utils/fp16_emu.h"
#include "./utils/helpers.h"
void
run_from_global_index(int64_t* dimA_padded,
int64_t* padA,
int64_t* convstrideA,
int64_t* dilationA,
int64_t* filterdimA_padded,
int64_t* outdimA_padded,
cudnnDataType_t dataType,
cudnnConvolutionMode_t mode,
float* devPtrI,
float* devPtrF,
float* devPtrO);
void
run_from_heuristics(int64_t* dimA_padded,
int64_t* padA,
int64_t* convstrideA,
int64_t* dilationA,
int64_t* filterdimA_padded,
int64_t* outdimA_padded,
cudnnDataType_t dataType,
cudnnConvolutionMode_t mode,
float* devPtrI,
float* devPtrF,
float* devPtrO,
cudnnBackendHeurMode_t heur_mode,
bool expect_in_cache = false);
cudnnStatus_t
run_with_external_config(int64_t* dimA_padded,
int64_t* padA,
int64_t* convstrideA,
int64_t* dilationA,
int64_t* filterdimA_padded,
int64_t* outdimA_padded,
cudnnDataType_t dataType,
cudnnConvolutionMode_t mode,
float* devPtrI,
float* devPtrF,
float* devPtrO);
void
run_conv_add_bias_activation(int64_t* x_dim_padded,
int64_t* pad,
int64_t* convstride,
int64_t* dilation,
int64_t* w_dim_padded,
int64_t* y_dim_padded,
cudnnDataType_t dataType,
float* devPtrX,
float* devPtrW,
float* devPtrY,
float* devPtrZ,
float* devPtrB);
void
run_from_cudnn_find(int64_t* dimA_padded,
int64_t* padA,
int64_t* convstrideA,
int64_t* dilationA,
int64_t* filterdimA_padded,
int64_t* outdimA_padded,
cudnnDataType_t dataType,
cudnnConvolutionMode_t mode,
void* devPtrI,
void* devPtrF,
void* devPtrO);
void
run_conv_add_bias_activation_with_cudnn_find(int64_t* x_dim_padded,
int64_t* pad,
int64_t* convstride,
int64_t* dilation,
int64_t* w_dim_padded,
int64_t* y_dim_padded,
cudnnDataType_t dataType,
float* devPtrX,
float* devPtrW,
float* devPtrY,
float* devPtrZ,
float* devPtrB);
void
run_from_cudnn_get(int64_t* dimA_padded,
int64_t* padA,
int64_t* convstrideA,
int64_t* dilationA,
int64_t* filterdimA_padded,
int64_t* outdimA_padded,
cudnnDataType_t dataType,
cudnnConvolutionMode_t mode,
float* devPtrI,
float* devPtrF,
float* devPtrO);
void
block_using_errata(int64_t* dimA_padded,
int64_t* padA,
int64_t* convstrideA,
int64_t* dilationA,
int64_t* filterdimA_padded,
int64_t* outdimA_padded,
cudnnDataType_t dataType,
cudnnConvolutionMode_t mode,
float* devPtrI,
float* devPtrF,
float* devPtrO);
void
run_dp4a(int64_t* dimA_padded,
int64_t* padA,
int64_t* convstrideA,
int64_t* dilationA,
int64_t* filterdimA_padded,
int64_t* outdimA_padded,
cudnnConvolutionMode_t mode,
void* devPtrI,
void* devPtrF,
void* devPtrO,
int64_t vectorCount,
int64_t vectorDimension);
void
run_imma(int64_t* dimA_padded,
int64_t* padA,
int64_t* convstrideA,
int64_t* dilationA,
int64_t* filterdimA_padded,
int64_t* outdimA_padded,
cudnnConvolutionMode_t mode,
void* devPtrI,
void* devPtrF,
void* devPtrO,
int64_t vectorCount,
int64_t vectorDimension);