1 // Copyright (c) 2016-2018 Intel Corporation
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
7 // http://www.apache.org/licenses/LICENSE-2.0
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
21 namespace kernel_selector
23 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
25 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
52 CONVOLUTION_GRAD_WEIGHTS,
55 FULLY_CONNECTED_GRAD_INPUT,
56 FULLY_CONNECTED_GRAD_WEIGHTS,
69 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
71 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
86 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
88 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
89 enum class WeightsType
97 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
98 // NonLinearActivation
99 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
100 enum class ActivationFunction
114 RELU_NEGATIVE_SLOPE_GRAD,
128 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
130 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
139 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
141 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
142 enum class PoolRemainder
148 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
150 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
157 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
159 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
160 enum class LookUpTableAxis
169 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
171 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
181 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
183 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
184 enum class ArgMaxMinAxis
193 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
195 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
196 enum class ArgMaxMinOut
202 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
204 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
205 enum class NormalizeMode
211 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
213 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
220 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
222 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
223 enum class KernelDividerMode
231 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
233 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
234 enum class EltwiseMode
249 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
251 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
252 enum class EltwiseInputMode
256 UNORDERED_ACCESS_INPUT_BUFFER,
257 INTERMEDIATE_RESULTS_INDEX,
261 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
263 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
264 enum class SoftmaxDim
271 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
273 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
274 enum class ReorderMode
285 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
287 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
288 enum class MeanSubtractMode
291 INSIDE_PARAMS, // the index is feature id (modulu size)
295 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
297 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
306 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
308 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
309 enum class ConcatAxis
317 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
319 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
328 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
330 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
331 enum class SampleType
337 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
339 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
340 enum class BorderType
348 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
350 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
351 enum class IndexSelectAxis
359 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
361 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
362 struct NonLinearParams
367 NonLinearParams() = default;
368 NonLinearParams(const float m, const float n) : m(m), n(n) {}
371 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
373 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
374 template <typename T>
380 Size(T x, T y) : x(x), y(y) {}
383 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
385 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
386 template <typename T = std::uint32_t>
393 DimTensor() = default;
394 DimTensor(T b, T f, T y, T x) : b(b), f(f), y(y), x(x) {}
397 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
399 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
400 enum class TuningMode
402 TUNING_DISABLED, // Tuning is disabled.
403 TUNING_USE_CACHE, // Tuning using the cached data (no on-line tuning for non-existing data).
404 TUNING_TUNE_AND_CACHE // Tuning using the cached data if exist, tune and update cache otherwise.attention_params
407 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
409 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
410 using uSize = Size<std::uint32_t>;
411 using stSize = Size<std::size_t>;