From 43af2c11c06ece484adaee15e23df33ba7984651 Mon Sep 17 00:00:00 2001 From: aodongliu Date: Fri, 3 May 2024 10:10:35 -0700 Subject: [PATCH] change epc checking logic in tests --- src/libxc.cxx | 4 ++-- test/xc_kernel_test.cxx | 39 +++++++++++++++++++++++++++++---------- 2 files changed, 31 insertions(+), 12 deletions(-) diff --git a/src/libxc.cxx b/src/libxc.cxx index 91094de..db4e67f 100644 --- a/src/libxc.cxx +++ b/src/libxc.cxx @@ -231,8 +231,8 @@ bool LibxcKernelImpl::is_polarized_() const noexcept { } bool LibxcKernelImpl::is_epc_() const noexcept { - //EXCHCXX_BOOL_CHECK("Libxc EPC Wrapper NYI", false); - return false; + int xcNumber = xc_info()->number; + return xcNumber == 328 or xcNumber == 329 or xcNumber == 330 or xcNumber or 331; } diff --git a/test/xc_kernel_test.cxx b/test/xc_kernel_test.cxx index 678a59c..8a5a560 100644 --- a/test/xc_kernel_test.cxx +++ b/test/xc_kernel_test.cxx @@ -769,9 +769,8 @@ void compare_libxc_builtin( TestInterface interface, EvalType evaltype, const int npts = npts_lda; - XCKernel func_builtin( Backend::builtin, kern, polar ); - if( func_builtin.is_epc() ) return; XCKernel func_libxc ( Backend::libxc, kern, polar ); + XCKernel func_builtin( Backend::builtin, kern, polar ); const int len_rho = func_libxc.rho_buffer_len( npts ); @@ -902,20 +901,25 @@ void compare_libxc_builtin( TestInterface interface, EvalType evaltype, TEST_CASE( "Builtin Corectness Test", "[xc-builtin]" ) { SECTION( "Unpolarized Regular Eval : EXC" ) { - for( auto kern : builtin_supported_kernels ) + for( auto kern : builtin_supported_kernels ) { + if(is_epc(kern)) continue; compare_libxc_builtin( TestInterface::EXC, EvalType::Regular, kern, Spin::Unpolarized ); + } } SECTION( "Unpolarized Regular Eval : EXC + VXC" ) { - for( auto kern : builtin_supported_kernels ) + for( auto kern : builtin_supported_kernels ) { + if(is_epc(kern)) continue; compare_libxc_builtin( TestInterface::EXC_VXC, EvalType::Regular, kern, Spin::Unpolarized ); + } } SECTION( "Unpolarized Small Eval : EXC" ) { for( auto kern : builtin_supported_kernels ) { if(is_unstable_small(kern)) continue; + if(is_epc(kern)) continue; compare_libxc_builtin( TestInterface::EXC, EvalType::Small, kern, Spin::Unpolarized ); } @@ -924,21 +928,26 @@ TEST_CASE( "Builtin Corectness Test", "[xc-builtin]" ) { SECTION( "Unpolarized Small Eval : EXC + VXC" ) { for( auto kern : builtin_supported_kernels ) { if(is_unstable_small(kern)) continue; + if(is_epc(kern)) continue; compare_libxc_builtin( TestInterface::EXC_VXC, EvalType::Small, kern, Spin::Unpolarized ); } } SECTION( "Unpolarized Zero Eval : EXC" ) { - for( auto kern : builtin_supported_kernels ) + for( auto kern : builtin_supported_kernels ) { + if(is_epc(kern)) continue; compare_libxc_builtin( TestInterface::EXC, EvalType::Zero, kern, Spin::Unpolarized ); + } } SECTION( "Unpolarized Zero Eval : EXC + VXC" ) { - for( auto kern : builtin_supported_kernels ) + for( auto kern : builtin_supported_kernels ) { + if(is_epc(kern)) continue; compare_libxc_builtin( TestInterface::EXC_VXC, EvalType::Zero, kern, Spin::Unpolarized ); + } } @@ -947,20 +956,25 @@ TEST_CASE( "Builtin Corectness Test", "[xc-builtin]" ) { SECTION( "Polarized Regular Eval : EXC" ) { - for( auto kern : builtin_supported_kernels ) + for( auto kern : builtin_supported_kernels ) { + if(is_epc(kern)) continue; compare_libxc_builtin( TestInterface::EXC, EvalType::Regular, kern, Spin::Polarized ); + } } SECTION( "Polarized Regular Eval : EXC + VXC" ) { - for( auto kern : builtin_supported_kernels ) + for( auto kern : builtin_supported_kernels ) { + if(is_epc(kern)) continue; compare_libxc_builtin( TestInterface::EXC_VXC, EvalType::Regular, kern, Spin::Polarized ); + } } SECTION( "Polarized Small Eval : EXC" ) { for( auto kern : builtin_supported_kernels ) { if(is_unstable_small(kern)) continue; + if(is_epc(kern)) continue; compare_libxc_builtin( TestInterface::EXC, EvalType::Small, kern, Spin::Polarized ); } @@ -969,21 +983,26 @@ TEST_CASE( "Builtin Corectness Test", "[xc-builtin]" ) { SECTION( "Polarized Small Eval : EXC + VXC" ) { for( auto kern : builtin_supported_kernels ) { if(is_unstable_small(kern)) continue; + if(is_epc(kern)) continue; compare_libxc_builtin( TestInterface::EXC_VXC, EvalType::Small, kern, Spin::Polarized ); } } SECTION( "Polarized Zero Eval : EXC" ) { - for( auto kern : builtin_supported_kernels ) + for( auto kern : builtin_supported_kernels ) { + if(is_epc(kern)) continue; compare_libxc_builtin( TestInterface::EXC, EvalType::Zero, kern, Spin::Polarized ); + } } SECTION( "Polarized Zero Eval : EXC + VXC" ) { - for( auto kern : builtin_supported_kernels ) + for( auto kern : builtin_supported_kernels ) { + if(is_epc(kern)) continue; compare_libxc_builtin( TestInterface::EXC_VXC, EvalType::Zero, kern, Spin::Polarized ); + } } }