text
stringlengths
0
2.2M
const _dt_conf_t conf_f32s8 {conf_entry_f32, {}, {}, conf_entry_s8};
const _dt_conf_t conf_u8f32 {conf_entry_u8, {}, {}, conf_entry_f32};
const _dt_conf_t conf_f32u8 {conf_entry_f32, {}, {}, conf_entry_u8};
const _dt_conf_t conf_s8f16 {conf_entry_s8, {}, {}, conf_entry_f16};
const _dt_conf_t conf_f16s8 {conf_entry_f16, {}, {}, conf_entry_s8};
const _dt_conf_t conf_u8f16 {conf_entry_u8, {}, {}, conf_entry_f16};
const _dt_conf_t conf_f16u8 {conf_entry_f16, {}, {}, conf_entry_u8};
const dt_conf_t *str2cfg(const char *str) {
#define CASE(cfg) \
if (!strcasecmp(STRINGIFY(cfg), str)) return CONCAT2(conf_, cfg)
CASE(f32);
CASE(s32);
CASE(f16);
CASE(bf16);
CASE(s8);
CASE(u8);
CASE(s8u8);
CASE(u8s8);
CASE(s8f32);
CASE(f32s8);
CASE(u8f32);
CASE(f32u8);
CASE(s8f16);
CASE(f16s8);
CASE(u8f16);
CASE(f16u8);
#undef CASE
[]() {
SAFE(FAIL, CRIT);
return 0;
}();
return (const dt_conf_t *)1;
}
std::ostream &operator<<(std::ostream &s, const dt_conf_t *cfg) {
#define CASE(_cfg) \
if (cfg == CONCAT2(conf_, _cfg)) return s << STRINGIFY(_cfg)
CASE(f32);
CASE(s32);
CASE(f16);
CASE(bf16);
CASE(s8);
CASE(u8);
CASE(s8u8);
CASE(u8s8);
CASE(s8f32);
CASE(f32s8);
CASE(u8f32);
CASE(f32u8);
CASE(s8f16);
CASE(f16s8);
CASE(u8f16);
CASE(f16u8);
#undef CASE
SAFE_V(FAIL);
return s;
}
} // namespace pool
/*******************************************************************************
* Copyright 2017-2021 Intel Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*******************************************************************************/
#include <string.h>
#include <sstream>
#include "dnnl_common.hpp"
#include "dnnl_memory.hpp"
#include "utils/parser.hpp"
#include "reorder.hpp"
namespace reorder {
void check_correctness(const settings_t &s) {
for_(const auto &i_sdt : s.sdt)
for_(const auto &i_ddt : s.ddt)
for_(const auto &i_stag : s.stag)
for_(const auto &i_dtag : s.dtag)
for_(const auto &i_oflag : s.oflag)
for_(const auto &i_cross_engine : s.cross_engine)
for_(const auto &i_oscale : s.oscale)
for_(const auto &i_zero_points : s.zero_points)