This is an archive of the discontinued LLVM Phabricator instance.

[test-suite] Fix CMakeLists.txt of MultiSource/Applications/viterbi to enable small data file
ClosedPublic

Authored by zixuan-wu on Jul 26 2021, 7:12 PM.

Details

Summary

LLVM test-suite can reduce executing time by using small data set as input data when SMALL_PROBLEM_SIZE macro is enable.
In term of that, the CMakeLists.txt of test case should copy corresponding data set file to build dir as input data correctly by SMALL_PROBLEM_SIZE macro.

Now the viterbi case does not give appropriate data set so that it fails to run correctly in small data set condition.

Diff Detail

Repository
rT test-suite

Event Timeline

zixuan-wu created this revision.Jul 26 2021, 7:12 PM
zixuan-wu requested review of this revision.Jul 26 2021, 7:12 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 26 2021, 7:12 PM

Could anybody add some appropriate reviewers?

lkail added a subscriber: lkail.Jul 26 2021, 7:26 PM

Could you elaborate more about what problem you are encountered?

zixuan-wu edited the summary of this revision. (Show Details)Jul 28 2021, 1:53 AM
lkail added a comment.Jul 28 2021, 2:30 AM

Looks code in viterbi's test.c already checks this macro and set proper input.

#ifdef SMALL_PROBLEM_SIZE
#define INPUT_FILE PROJ_SRC_DIR "/Dist_demux_small"
#else
#define INPUT_FILE PROJ_SRC_DIR "/Dist_demux"
#endif

I think it works when it was added in

commit e7315d690fe9947fe76f43e5c3467940e51b4597
Author: Lauro Ramos Venancio <lauro.venancio@gmail.com>
Date:   Thu May 3 18:18:17 2007 +0000

    Implement SMALL_PROBLEM_SIZE.
    
    llvm-svn: 36682

based on Makefile harness, see Makefile.rules

ifdef SMALL_PROBLEM_SIZE
CPPFLAGS += -DSMALL_PROBLEM_SIZE
endif

I think we should do the same for CMake based harness.

MaskRay edited reviewers, added: Meinersbur; removed: MaskRay.Aug 3 2021, 8:52 PM
MaskRay added a subscriber: MaskRay.
Meinersbur accepted this revision.Aug 5 2021, 3:35 PM

llvm_test_data copies/symlinks the input data to the build dir to make running the test-suite independent of the git checkout. Indeed when using small problem size, we need to copy the small input instead of the standard size input file to the build dir. Could also just have copied both of them unconditionally.

This revision is now accepted and ready to land.Aug 5 2021, 3:35 PM

@zixuan-wu The summary is therefore inaccurate. llvm_test_data is not used to pass arguments to the executable, but to copy the input files. Please update the summary before committing.

zixuan-wu edited the summary of this revision. (Show Details)Aug 8 2021, 11:37 PM
zixuan-wu edited the summary of this revision. (Show Details)
This comment was removed by zixuan-wu.
This revision was landed with ongoing or failed builds.Aug 11 2021, 12:07 AM
This revision was automatically updated to reflect the committed changes.