Complementation and modernization of commonfns tests (#1694)

* Unified common functions tests due to preparation for adding cl_khr_fp16 support

* Renamed base structure, few cosmetic corrections

* Added corrections due to code review

* Removed comment separators

* Added review related corrections
This commit is contained in:
Marcin Hajder
2023-05-16 17:44:42 +02:00
committed by GitHub
parent 0447b7a2c8
commit 32688a47b3
23 changed files with 1693 additions and 4685 deletions

View File

@@ -13,11 +13,13 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
#include "harness/compat.h"
#include <stdio.h>
#include <string.h>
#include "procs.h"
#include "test_base.h"
std::map<size_t, std::string> BaseFunctionTest::type2name;
int g_arrVecSizes[kVectorSizeCount + kStrangeVectorSizeCount];
int g_arrStrangeVectorSizes[kStrangeVectorSizeCount] = {3};
@@ -32,25 +34,13 @@ static void initVecSizes() {
}
}
test_definition test_list[] = {
ADD_TEST( clamp ),
ADD_TEST( degrees ),
ADD_TEST( fmax ),
ADD_TEST( fmaxf ),
ADD_TEST( fmin ),
ADD_TEST( fminf ),
ADD_TEST( max ),
ADD_TEST( maxf ),
ADD_TEST( min ),
ADD_TEST( minf ),
ADD_TEST( mix ),
ADD_TEST( radians ),
ADD_TEST( step ),
ADD_TEST( stepf ),
ADD_TEST( smoothstep ),
ADD_TEST( smoothstepf ),
ADD_TEST( sign ),
ADD_TEST(clamp), ADD_TEST(degrees), ADD_TEST(fmax),
ADD_TEST(fmaxf), ADD_TEST(fmin), ADD_TEST(fminf),
ADD_TEST(max), ADD_TEST(maxf), ADD_TEST(min),
ADD_TEST(minf), ADD_TEST(mix), ADD_TEST(mixf),
ADD_TEST(radians), ADD_TEST(step), ADD_TEST(stepf),
ADD_TEST(smoothstep), ADD_TEST(smoothstepf), ADD_TEST(sign),
};
const int test_num = ARRAY_SIZE( test_list );
@@ -58,6 +48,14 @@ const int test_num = ARRAY_SIZE( test_list );
int main(int argc, const char *argv[])
{
initVecSizes();
if (BaseFunctionTest::type2name.empty())
{
BaseFunctionTest::type2name[sizeof(half)] = "half";
BaseFunctionTest::type2name[sizeof(float)] = "float";
BaseFunctionTest::type2name[sizeof(double)] = "double";
}
return runTestHarness(argc, argv, test_num, test_list, false, 0);
}