Skip to content

Commit

Permalink
Exclude from compilation
Browse files Browse the repository at this point in the history
Signed-off-by: Tomasz Jankowski <[email protected]>
  • Loading branch information
t-jankowski committed Jan 24, 2025
1 parent 40874b0 commit efc1fe1
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,7 @@ class CacheRotationKernelInstructionParameterizedTest

switch (instruction_set) {
using namespace ov::Extensions::Cpu::XARCH;
#if defined(HAVE_AVX2)
case TargetInstructionSet::AVX2:
rotate_kv_cache_chunk_avx2(chunk_x.data(),
chunk_y.data(),
Expand All @@ -424,6 +425,8 @@ class CacheRotationKernelInstructionParameterizedTest
num_elements_to_process,
/* is_tail = */ num_elements_to_process < vec_len_f32_avx2);
break;
#endif
#if defined(HAVE_AVX512F)
case TargetInstructionSet::AVX512:
rotate_kv_cache_chunk_avx512(chunk_x.data(),
chunk_y.data(),
Expand All @@ -432,6 +435,7 @@ class CacheRotationKernelInstructionParameterizedTest
num_elements_to_process,
/* is_tail = */ num_elements_to_process < vec_len_f32_avx512);
break;
#endif
default:
FAIL() << "unknown target instruction set";
}
Expand All @@ -454,6 +458,7 @@ TEST_P(CacheRotationKernelInstructionParameterizedTest, OptChunkRotationGivesRef
test_chunk_rotation_for_type<ov::bfloat16>();
}

#if defined(HAVE_AVX2) || defined(HAVE_AVX512F)
auto TEST_STRUCT_TO_NAME_FN =
[](const testing::TestParamInfo<CacheRotationKernelInstructionParameterizedTest::ParamType>& info) {
size_t num_elts = std::get<1>(info.param);
Expand All @@ -465,19 +470,24 @@ auto TEST_STRUCT_TO_NAME_FN =
}
return std::string("unknown");
};
#endif

#if defined(HAVE_AVX2)
INSTANTIATE_TEST_SUITE_P(AVX2,
CacheRotationKernelInstructionParameterizedTest,
::testing::Combine(::testing::Values(TargetInstructionSet::AVX2),
::testing::Range(size_t(0),
ov::Extensions::Cpu::XARCH::vec_len_f32_avx2 + 1)),
TEST_STRUCT_TO_NAME_FN);
#endif
#if defined(HAVE_AVX512F)
INSTANTIATE_TEST_SUITE_P(AVX512,
CacheRotationKernelInstructionParameterizedTest,
::testing::Combine(::testing::Values(TargetInstructionSet::AVX512),
::testing::Range(size_t(0),
ov::Extensions::Cpu::XARCH::vec_len_f32_avx512 + 1)),
TEST_STRUCT_TO_NAME_FN);
#endif

TYPED_TEST_P(CacheRotationKernelInputTypeParameterizedTest, OptBlockRotationGivesReferenceResults) {
auto raw_cache_mem_ptr = this->cache_mem.data();
Expand Down

0 comments on commit efc1fe1

Please sign in to comment.