diff options
author | va-kuznecov <[email protected]> | 2022-07-31 14:00:11 +0300 |
---|---|---|
committer | va-kuznecov <[email protected]> | 2022-07-31 14:00:11 +0300 |
commit | e3a6ceea85bdeee0934758f6665e5f404f312cfb (patch) | |
tree | 300669f4b38265e8f5c3fabb2fecb301061fee57 | |
parent | 14f76a053acf4760ca9683c776df7addb3a07a60 (diff) |
Enable LLVM case to parallel computation nodes UT
-rw-r--r-- | ydb/library/yql/minikql/comp_nodes/ut/mkql_computation_node_ut.h | 14 | ||||
-rw-r--r-- | ydb/library/yql/minikql/computation/mkql_computation_pattern_cache_ut.cpp | 38 |
2 files changed, 33 insertions, 19 deletions
diff --git a/ydb/library/yql/minikql/comp_nodes/ut/mkql_computation_node_ut.h b/ydb/library/yql/minikql/comp_nodes/ut/mkql_computation_node_ut.h index e93cd65a642..f58422a0728 100644 --- a/ydb/library/yql/minikql/comp_nodes/ut/mkql_computation_node_ut.h +++ b/ydb/library/yql/minikql/comp_nodes/ut/mkql_computation_node_ut.h @@ -49,6 +49,20 @@ #define Y_UNIT_TEST_LLVM(N) Y_UNIT_TEST_TWIN(N, LLVM) +#define Y_UNIT_TEST_QUAD(N, OPT1, OPT2) \ + template<bool OPT1, bool OPT2> void N(NUnitTest::TTestContext&); \ + struct TTestRegistration##N { \ + TTestRegistration##N() { \ + TCurrentTest::AddTest(#N "-" #OPT1 "-" #OPT2, static_cast<void (*)(NUnitTest::TTestContext&)>(&N<false, false>), false); \ + TCurrentTest::AddTest(#N "-" #OPT1 "+" #OPT2, static_cast<void (*)(NUnitTest::TTestContext&)>(&N<false, true>), false); \ + TCurrentTest::AddTest(#N "+" #OPT1 "-" #OPT2, static_cast<void (*)(NUnitTest::TTestContext&)>(&N<true, false>), false); \ + TCurrentTest::AddTest(#N "+" #OPT1 "+" #OPT2, static_cast<void (*)(NUnitTest::TTestContext&)>(&N<true, true>), false); \ + } \ + }; \ + static TTestRegistration##N testRegistration##N; \ + template<bool OPT1, bool OPT2> \ + void N(NUnitTest::TTestContext&) + namespace NKikimr { namespace NMiniKQL { diff --git a/ydb/library/yql/minikql/computation/mkql_computation_pattern_cache_ut.cpp b/ydb/library/yql/minikql/computation/mkql_computation_pattern_cache_ut.cpp index 7fcb1975499..2d792f2164c 100644 --- a/ydb/library/yql/minikql/computation/mkql_computation_pattern_cache_ut.cpp +++ b/ydb/library/yql/minikql/computation/mkql_computation_pattern_cache_ut.cpp @@ -336,7 +336,7 @@ TRuntimeNode CreateSkip(TProgramBuilder& pb, size_t vecSize, TCallable *list = n Y_UNIT_TEST_SUITE(ComputationGraphDataRace) { template<class T> - void ParallelProgTest(T f, ui64 testResult) { + void ParallelProgTest(T f, bool useLLVM, ui64 testResult) { const ui32 cacheSize = 10; const ui32 inFlight = 3; TComputationPatternLRUCache cache(cacheSize); @@ -357,7 +357,7 @@ Y_UNIT_TEST_SUITE(ComputationGraphDataRace) { explorer.Walk(progReturn.GetNode(), typeEnv); TComputationPatternOpts opts(alloc.Ref(), typeEnv, GetListTestFactory(), functionRegistry.Get(), - NUdf::EValidateMode::Lazy, NUdf::EValidatePolicy::Exception, "OFF", EGraphPerProcess::Multi); + NUdf::EValidateMode::Lazy, NUdf::EValidatePolicy::Exception, useLLVM ? "" : "OFF", EGraphPerProcess::Multi); { auto guard = patternEnv->Env.BindAllocator(); @@ -390,7 +390,7 @@ Y_UNIT_TEST_SUITE(ComputationGraphDataRace) { TComputationPatternOpts opts(patternEnv->Alloc.Ref(), patternEnv->Env, GetListTestFactory(), functionRegistry.Get(), NUdf::EValidateMode::Lazy, NUdf::EValidatePolicy::Exception, - "OFF", EGraphPerProcess::Multi); + useLLVM ? "" : "OFF", EGraphPerProcess::Multi); auto graph = patternEnv->Pattern->Clone(opts.ToComputationOptions(*randomProvider, *timeProvider, &graphAlloc.Ref())); TUnboxedValue* items = nullptr; @@ -418,36 +418,36 @@ Y_UNIT_TEST_SUITE(ComputationGraphDataRace) { } } - Y_UNIT_TEST_TWIN(Filter, Wide) { - ParallelProgTest(CreateFilter<Wide>, 136480896); + Y_UNIT_TEST_QUAD(Filter, Wide, UseLLVM) { + ParallelProgTest(CreateFilter<Wide>, UseLLVM, 136480896); } - Y_UNIT_TEST_TWIN(Map, Wide) { - ParallelProgTest(CreateMap<Wide>, 782); + Y_UNIT_TEST_QUAD(Map, Wide, UseLLVM) { + ParallelProgTest(CreateMap<Wide>, UseLLVM, 782); } - Y_UNIT_TEST_TWIN(Condense, Wide) { - ParallelProgTest(CreateCondense<Wide>, 17451450000); + Y_UNIT_TEST_QUAD(Condense, Wide, UseLLVM) { + ParallelProgTest(CreateCondense<Wide>, UseLLVM, 17451450000); } - Y_UNIT_TEST_TWIN(Chopper, Wide) { - ParallelProgTest(CreateChopper<Wide>, 17451450000); + Y_UNIT_TEST_QUAD(Chopper, Wide, UseLLVM) { + ParallelProgTest(CreateChopper<Wide>, UseLLVM, 17451450000); } - Y_UNIT_TEST_TWIN(Combine, Wide) { - ParallelProgTest(CreateCombine<Wide>, 17451450000); + Y_UNIT_TEST_QUAD(Combine, Wide, UseLLVM) { + ParallelProgTest(CreateCombine<Wide>, UseLLVM, 17451450000); } - Y_UNIT_TEST_TWIN(Chain1Map, Wide) { - ParallelProgTest(CreateChain1Map<Wide>, 789247892400000); + Y_UNIT_TEST_QUAD(Chain1Map, Wide, UseLLVM) { + ParallelProgTest(CreateChain1Map<Wide>, UseLLVM, 789247892400000); } - Y_UNIT_TEST_TWIN(Discard, Wide) { - ParallelProgTest(CreateDiscard<Wide>, 0); + Y_UNIT_TEST_QUAD(Discard, Wide, UseLLVM) { + ParallelProgTest(CreateDiscard<Wide>, UseLLVM, 0); } - Y_UNIT_TEST_TWIN(Skip, Wide) { - ParallelProgTest(CreateSkip<Wide>, 17389067750); + Y_UNIT_TEST_QUAD(Skip, Wide, UseLLVM) { + ParallelProgTest(CreateSkip<Wide>, UseLLVM, 17389067750); } } |