Skip to content

Commit

Permalink
Corrected single, selected test to limit number of unnecessary operat…
Browse files Browse the repository at this point in the history
…ions
  • Loading branch information
shajder committed Jun 21, 2023
1 parent ebea247 commit 3c3d5b2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
3 changes: 2 additions & 1 deletion test_conformance/conversions/basic_test_conversions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,8 @@ cl_int CustomConversionsTest::Run()
gMinVectorSize = 0;
}

IterOverSelectedTypes iter(typeIterator, *this, inType, outType);
IterOverSelectedTypes iter(typeIterator, *this, inType, outType, round,
sat);

iter.Run();

Expand Down
17 changes: 11 additions & 6 deletions test_conformance/conversions/basic_test_conversions.h
Original file line number Diff line number Diff line change
Expand Up @@ -317,9 +317,11 @@ struct IterOverTypes : public TestType
struct IterOverSelectedTypes : public TestType
{
IterOverSelectedTypes(const TypeIter &typeIter, ConversionsTest &test,
const Type &in, const Type &out)
: inType(in), outType(out), typeIter(typeIter), test(test),
testNumber(-1), startMinVectorSize(gMinVectorSize)
const Type in, const Type out,
const RoundingMode round, const SaturationMode sat)
: inType(in), outType(out), rounding(round), saturation(sat),
typeIter(typeIter), test(test), testNumber(-1),
startMinVectorSize(gMinVectorSize)
{}

void Run() { for_each_out_elem(typeIter); }
Expand All @@ -337,9 +339,9 @@ struct IterOverSelectedTypes : public TestType
{
if (testType<InType>(inType) && testType<OutType>(outType))
{
// run the conversions
test.TestTypesConversion<InType, OutType>(
inType, outType, testNumber, startMinVectorSize);
// run selected conversion
// testing of the result will happen afterwards
test.DoTest<InType, OutType>(outType, inType, saturation, rounding);
}
}

Expand Down Expand Up @@ -374,6 +376,9 @@ struct IterOverSelectedTypes : public TestType
protected:
Type inType;
Type outType;
RoundingMode rounding;
SaturationMode saturation;

const TypeIter &typeIter;
ConversionsTest &test;
int testNumber;
Expand Down

0 comments on commit 3c3d5b2

Please sign in to comment.