text
stringlengths
0
2.2M
EXPECT_TRUE(op(3, 3));
EXPECT_FALSE(op(4, 3));
}
TEST_F(OrderingTest, compare_not_equal_to) {
compare_not_equal_to<OddCompare<int>> op;
EXPECT_TRUE(op(3, 4));
EXPECT_FALSE(op(3, 3));
EXPECT_TRUE(op(4, 3));
}
TEST_F(OrderingTest, compare_less) {
compare_less<OddCompare<int>> op;
EXPECT_FALSE(op(3, 4));
EXPECT_FALSE(op(3, 3));
EXPECT_TRUE(op(4, 3));
}
TEST_F(OrderingTest, compare_less_equal) {
compare_less_equal<OddCompare<int>> op;
EXPECT_FALSE(op(3, 4));
EXPECT_TRUE(op(3, 3));
EXPECT_TRUE(op(4, 3));
}
TEST_F(OrderingTest, compare_greater) {
compare_greater<OddCompare<int>> op;
EXPECT_TRUE(op(3, 4));
EXPECT_FALSE(op(3, 3));
EXPECT_FALSE(op(4, 3));
}
TEST_F(OrderingTest, compare_greater_equal) {
compare_greater_equal<OddCompare<int>> op;
EXPECT_TRUE(op(3, 4));
EXPECT_TRUE(op(3, 3));
EXPECT_FALSE(op(4, 3));
}
/*******************************************************************************
* Copyright 2020-2022 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 "common/c_types_map.hpp"
#include "common/memory_tracking.hpp"
#include "common/nstl.hpp"
#include "common/type_helpers.hpp"
#include "common/utils.hpp"
#include "cpu/platform.hpp"
#include "cpu/x64/injectors/jit_uni_postops_injector.hpp"
#include "cpu/x64/jit_avx512_core_amx_1x1_conv_kernel.hpp"
#define GET_OFF(field) offsetof(jit_conv_call_s, field)
namespace dnnl {
namespace impl {
namespace cpu {
namespace x64 {
using namespace dnnl::impl::memory_tracking::names;
using namespace dnnl::impl::data_type;
using namespace dnnl::impl::utils;
using namespace Xbyak;
jit_avx512_core_amx_1x1_fwd_kernel_t::jit_avx512_core_amx_1x1_fwd_kernel_t(
const jit_conv_conf_t &ajcp, const primitive_attr_t &attr,
const memory_desc_t &dst_md)
: jit_generator(nullptr, MAX_CODE_SIZE, true, avx512_core_amx)
, jcp(ajcp)
, attr_(attr) {
if (jcp.with_eltwise || jcp.with_binary || jcp.with_sum) {
using namespace binary_injector;
const auto &rhs_addr_reg = bin_injector_helper_reg_1;
const auto &rhs_helper_reg = bin_injector_helper_reg_2;
static constexpr bool preserve_gpr = false;
static constexpr bool preserve_vmm = false;
const size_t tail_size = jcp.oc_without_padding % isa_simd_width_;
static constexpr bool use_exact_tail_scalar_bcast = true;
const rhs_arg_static_params_t rhs_arg_static_params {31, rhs_addr_reg,
rhs_helper_reg, preserve_gpr, preserve_vmm,
GET_OFF(post_ops_binary_rhs_arg_vec), GET_OFF(dst_orig),
memory_desc_wrapper(dst_md), tail_size, ktail_mask,
use_exact_tail_scalar_bcast};
const static_params_t static_params {
this->param1, rhs_arg_static_params};