Added cl_half support for test_printf (#1622)

* Added support to test half floats with printf calls (issue #142, printf)

* Added corrections related to rounding and casting halfs (issue #142, printf)

* Reusing similar function (issue #142, printf)

* Corrected path without cl_khr_fp16 support (issue #142, printf)

* Cosmetic fix for order of vector tests (issue #142, printf)

* Added correction related to vendor test review (issue #142, printf)
This commit is contained in:
Marcin Hajder
2023-03-28 17:57:03 +02:00
committed by GitHub
parent f537c40abc
commit 20ab003053
5 changed files with 396 additions and 60 deletions

View File

@@ -32,6 +32,8 @@
#include <CL/cl_platform.h>
#endif
#include <CL/cl_half.h>
#define ANALYSIS_BUFFER_SIZE 256
//-----------------------------------------
@@ -42,18 +44,20 @@
// Types
//-----------------------------------------
enum PrintfTestType
{
TYPE_INT,
TYPE_FLOAT,
TYPE_FLOAT_LIMITS,
TYPE_OCTAL,
TYPE_UNSIGNED,
TYPE_HEXADEC,
TYPE_CHAR,
TYPE_STRING,
TYPE_VECTOR,
TYPE_ADDRESS_SPACE,
TYPE_COUNT
{
TYPE_INT,
TYPE_HALF,
TYPE_HALF_LIMITS,
TYPE_FLOAT,
TYPE_FLOAT_LIMITS,
TYPE_OCTAL,
TYPE_UNSIGNED,
TYPE_HEXADEC,
TYPE_CHAR,
TYPE_STRING,
TYPE_VECTOR,
TYPE_ADDRESS_SPACE,
TYPE_COUNT
};
struct printDataGenParameters
@@ -72,6 +76,7 @@ struct printDataGenParameters
// Reference results - filled out at run-time
static std::vector<std::string> correctBufferInt;
static std::vector<std::string> correctBufferHalf;
static std::vector<std::string> correctBufferFloat;
static std::vector<std::string> correctBufferOctal;
static std::vector<std::string> correctBufferUnsigned;
@@ -103,6 +108,9 @@ struct testCase
extern const char* strType[];
extern std::vector<testCase*> allTestCase;
extern cl_half_rounding_mode half_rounding_mode;
//-----------------------------------------
size_t verifyOutputBuffer(char *analysisBuffer,testCase* pTestCase,size_t testId,cl_ulong pAddr = 0);