mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-19 06:09:01 +00:00
cl22: Use single array for function list (#148)
Signed-off-by: Radek Szymanski <radek.szymanski@arm.com>
This commit is contained in:
committed by
Kévin Petit
parent
394dece0d7
commit
07196c351a
@@ -18,7 +18,7 @@
|
||||
#include "tests.h"
|
||||
#include "../../test_common/harness/testHarness.h"
|
||||
|
||||
int Test_roundTrip( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements )
|
||||
int test_roundTrip( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements )
|
||||
{
|
||||
int vectorSize, error;
|
||||
uint64_t i, j;
|
||||
|
||||
@@ -617,12 +617,12 @@ exit:
|
||||
return error;
|
||||
}
|
||||
|
||||
int Test_vload_half( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements )
|
||||
int test_vload_half( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements )
|
||||
{
|
||||
return Test_vLoadHalf_private( false );
|
||||
}
|
||||
|
||||
int Test_vloada_half( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements )
|
||||
int test_vloada_half( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements )
|
||||
{
|
||||
return Test_vLoadHalf_private( true );
|
||||
}
|
||||
|
||||
@@ -612,7 +612,7 @@ double2half_rtn( double f )
|
||||
return (u.u >> (53-11)) | sign;
|
||||
}
|
||||
|
||||
int Test_vstore_half( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements )
|
||||
int test_vstore_half( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements )
|
||||
{
|
||||
switch (get_default_rounding_mode(gDevice))
|
||||
{
|
||||
@@ -625,27 +625,27 @@ int Test_vstore_half( cl_device_id deviceID, cl_context context, cl_command_queu
|
||||
}
|
||||
}
|
||||
|
||||
int Test_vstore_half_rte( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements )
|
||||
int test_vstore_half_rte( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements )
|
||||
{
|
||||
return Test_vStoreHalf_private(float2half_rte, double2half_rte, "_rte");
|
||||
}
|
||||
|
||||
int Test_vstore_half_rtz( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements )
|
||||
int test_vstore_half_rtz( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements )
|
||||
{
|
||||
return Test_vStoreHalf_private(float2half_rtz, double2half_rtz, "_rtz");
|
||||
}
|
||||
|
||||
int Test_vstore_half_rtp( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements )
|
||||
int test_vstore_half_rtp( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements )
|
||||
{
|
||||
return Test_vStoreHalf_private(float2half_rtp, double2half_rtp, "_rtp");
|
||||
}
|
||||
|
||||
int Test_vstore_half_rtn( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements )
|
||||
int test_vstore_half_rtn( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements )
|
||||
{
|
||||
return Test_vStoreHalf_private(float2half_rtn, double2half_rtn, "_rtn");
|
||||
}
|
||||
|
||||
int Test_vstorea_half( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements )
|
||||
int test_vstorea_half( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements )
|
||||
{
|
||||
switch (get_default_rounding_mode(gDevice))
|
||||
{
|
||||
@@ -658,22 +658,22 @@ int Test_vstorea_half( cl_device_id deviceID, cl_context context, cl_command_que
|
||||
}
|
||||
}
|
||||
|
||||
int Test_vstorea_half_rte( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements )
|
||||
int test_vstorea_half_rte( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements )
|
||||
{
|
||||
return Test_vStoreaHalf_private(float2half_rte, double2half_rte, "_rte");
|
||||
}
|
||||
|
||||
int Test_vstorea_half_rtz( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements )
|
||||
int test_vstorea_half_rtz( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements )
|
||||
{
|
||||
return Test_vStoreaHalf_private(float2half_rtz, double2half_rtz, "_rtz");
|
||||
}
|
||||
|
||||
int Test_vstorea_half_rtp( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements )
|
||||
int test_vstorea_half_rtp( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements )
|
||||
{
|
||||
return Test_vStoreaHalf_private(float2half_rtp, double2half_rtp, "_rtp");
|
||||
}
|
||||
|
||||
int Test_vstorea_half_rtn( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements )
|
||||
int test_vstorea_half_rtn( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements )
|
||||
{
|
||||
return Test_vStoreaHalf_private(float2half_rtn, double2half_rtn, "_rtn");
|
||||
}
|
||||
|
||||
@@ -55,41 +55,23 @@ int g_arrVecSizes[kVectorSizeCount+kStrangeVectorSizeCount];
|
||||
int g_arrVecAligns[kLargestVectorSize+1];
|
||||
static int arrStrangeVecSizes[kStrangeVectorSizeCount] = {3};
|
||||
|
||||
basefn basefn_list[] = {
|
||||
Test_vload_half,
|
||||
Test_vloada_half,
|
||||
Test_vstore_half,
|
||||
Test_vstorea_half,
|
||||
Test_vstore_half_rte,
|
||||
Test_vstorea_half_rte,
|
||||
Test_vstore_half_rtz,
|
||||
Test_vstorea_half_rtz,
|
||||
Test_vstore_half_rtp,
|
||||
Test_vstorea_half_rtp,
|
||||
Test_vstore_half_rtn,
|
||||
Test_vstorea_half_rtn,
|
||||
Test_roundTrip,
|
||||
test_definition test_list[] = {
|
||||
ADD_TEST( vload_half ),
|
||||
ADD_TEST( vloada_half ),
|
||||
ADD_TEST( vstore_half ),
|
||||
ADD_TEST( vstorea_half ),
|
||||
ADD_TEST( vstore_half_rte ),
|
||||
ADD_TEST( vstorea_half_rte ),
|
||||
ADD_TEST( vstore_half_rtz ),
|
||||
ADD_TEST( vstorea_half_rtz ),
|
||||
ADD_TEST( vstore_half_rtp ),
|
||||
ADD_TEST( vstorea_half_rtp ),
|
||||
ADD_TEST( vstore_half_rtn ),
|
||||
ADD_TEST( vstorea_half_rtn ),
|
||||
ADD_TEST( roundTrip ),
|
||||
};
|
||||
|
||||
const char *basefn_names[] = {
|
||||
"vload_half",
|
||||
"vloada_half",
|
||||
"vstore_half",
|
||||
"vstorea_half",
|
||||
"vstore_half_rte",
|
||||
"vstorea_half_rte",
|
||||
"vstore_half_rtz",
|
||||
"vstorea_half_rtz",
|
||||
"vstore_half_rtp",
|
||||
"vstorea_half_rtp",
|
||||
"vstore_half_rtn",
|
||||
"vstorea_half_rtn",
|
||||
"roundTrip",
|
||||
};
|
||||
|
||||
ct_assert((sizeof(basefn_names) / sizeof(basefn_names[0])) == (sizeof(basefn_list) / sizeof(basefn_list[0])));
|
||||
|
||||
int num_fns = sizeof(basefn_names) / sizeof(char *);
|
||||
const int test_num = ARRAY_SIZE( test_list );
|
||||
|
||||
int main (int argc, const char **argv )
|
||||
{
|
||||
@@ -102,14 +84,14 @@ int main (int argc, const char **argv )
|
||||
}
|
||||
for(i = 0; i < kStrangeVectorSizeCount; ++i) {
|
||||
g_arrVecSizes[i+kVectorSizeCount] =
|
||||
arrStrangeVecSizes[i];
|
||||
arrStrangeVecSizes[i];
|
||||
}
|
||||
|
||||
for(i = 0, alignbound=1; i <= kLargestVectorSize; ++i) {
|
||||
while(alignbound < i) {
|
||||
alignbound = alignbound<<1;
|
||||
}
|
||||
g_arrVecAligns[i] = alignbound;
|
||||
while(alignbound < i) {
|
||||
alignbound = alignbound<<1;
|
||||
}
|
||||
g_arrVecAligns[i] = alignbound;
|
||||
}
|
||||
|
||||
test_start();
|
||||
@@ -135,7 +117,7 @@ int main (int argc, const char **argv )
|
||||
}
|
||||
|
||||
fflush( stdout );
|
||||
error = parseAndCallCommandLineTests( argCount, argList, NULL, num_fns, basefn_list, basefn_names, true, 0, 0 );
|
||||
error = parseAndCallCommandLineTests( argCount, argList, NULL, test_num, test_list, true, 0, 0 );
|
||||
|
||||
exit:
|
||||
if(gQueue)
|
||||
@@ -343,9 +325,9 @@ static void PrintUsage( void )
|
||||
vlog( "\t\t-w\tRun in wimpy mode\n" );
|
||||
vlog( "\t\t-[2^n]\tSet wimpy reduction factor, recommended range of n is 1-12, default factor(%u)\n", gWimpyReductionFactor);
|
||||
vlog( "\t\t-h\tHelp\n" );
|
||||
for( int i = 0; i < num_fns; i++ )
|
||||
for( int i = 0; i < test_num; i++ )
|
||||
{
|
||||
vlog("\t\t%s\n", basefn_names[i] );
|
||||
vlog("\t\t%s\n", test_list[i].name );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -17,19 +17,19 @@
|
||||
#define TESTS_H
|
||||
|
||||
|
||||
int Test_vload_half( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements );
|
||||
int Test_vloada_half( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements );
|
||||
int Test_vstore_half( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements );
|
||||
int Test_vstorea_half( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements );
|
||||
int Test_vstore_half_rte( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements );
|
||||
int Test_vstorea_half_rte( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements );
|
||||
int Test_vstore_half_rtz( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements );
|
||||
int Test_vstorea_half_rtz( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements );
|
||||
int Test_vstore_half_rtp( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements );
|
||||
int Test_vstorea_half_rtp( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements );
|
||||
int Test_vstore_half_rtn( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements );
|
||||
int Test_vstorea_half_rtn( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements );
|
||||
int Test_roundTrip( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements );
|
||||
int test_vload_half( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements );
|
||||
int test_vloada_half( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements );
|
||||
int test_vstore_half( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements );
|
||||
int test_vstorea_half( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements );
|
||||
int test_vstore_half_rte( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements );
|
||||
int test_vstorea_half_rte( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements );
|
||||
int test_vstore_half_rtz( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements );
|
||||
int test_vstorea_half_rtz( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements );
|
||||
int test_vstore_half_rtp( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements );
|
||||
int test_vstorea_half_rtp( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements );
|
||||
int test_vstore_half_rtn( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements );
|
||||
int test_vstorea_half_rtn( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements );
|
||||
int test_roundTrip( cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements );
|
||||
|
||||
typedef cl_ushort (*f2h)( float );
|
||||
typedef cl_ushort (*d2h)( double );
|
||||
|
||||
Reference in New Issue
Block a user