mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-19 06:09:01 +00:00
Moved all duplicate 'PrintArch' functions to testHarness.c Replaced sysctl system call used in 'PrintArch' function with uname system call Signed-off-by: bhargavdas <bhargav_das@mentor.com> Update testHarness.c
This commit is contained in:
@@ -99,7 +99,6 @@ static size_t gArgCount;
|
||||
|
||||
|
||||
static int ParseArgs( int argc, const char **argv );
|
||||
static void PrintArch( void );
|
||||
static void PrintUsage( void );
|
||||
test_status InitCL( cl_device_id device );
|
||||
static void ReleaseCL( void );
|
||||
@@ -442,63 +441,6 @@ static int ParseArgs( int argc, const char **argv )
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void PrintArch( void )
|
||||
{
|
||||
vlog( "\nHost info:\n" );
|
||||
vlog( "\tsizeof( void*) = %ld\n", sizeof( void *) );
|
||||
#if defined( __ppc__ )
|
||||
vlog( "\tARCH:\tppc\n" );
|
||||
#elif defined( __ppc64__ )
|
||||
vlog( "\tARCH:\tppc64\n" );
|
||||
#elif defined( __PPC__ )
|
||||
vlog( "ARCH:\tppc\n" );
|
||||
#elif defined( __i386__ )
|
||||
vlog( "\tARCH:\ti386\n" );
|
||||
#elif defined( __x86_64__ )
|
||||
vlog( "\tARCH:\tx86_64\n" );
|
||||
#elif defined( __arm__ )
|
||||
vlog( "\tARCH:\tarm\n" );
|
||||
#elif defined( __aarch64__ )
|
||||
vlog( "\tARCH:\taarch64\n" );
|
||||
#else
|
||||
vlog( "\tARCH:\tunknown\n" );
|
||||
#endif
|
||||
|
||||
#if defined( __APPLE__ )
|
||||
int type = 0;
|
||||
size_t typeSize = sizeof( type );
|
||||
sysctlbyname( "hw.cputype", &type, &typeSize, NULL, 0 );
|
||||
vlog( "\tcpu type:\t%d\n", type );
|
||||
typeSize = sizeof( type );
|
||||
sysctlbyname( "hw.cpusubtype", &type, &typeSize, NULL, 0 );
|
||||
vlog( "\tcpu subtype:\t%d\n", type );
|
||||
|
||||
#elif defined( __linux__ ) && !defined(__aarch64__)
|
||||
int _sysctl(struct __sysctl_args *args );
|
||||
#define OSNAMESZ 100
|
||||
|
||||
struct __sysctl_args args;
|
||||
char osname[OSNAMESZ];
|
||||
size_t osnamelth;
|
||||
int name[] = { CTL_KERN, KERN_OSTYPE };
|
||||
memset(&args, 0, sizeof(struct __sysctl_args));
|
||||
args.name = name;
|
||||
args.nlen = sizeof(name)/sizeof(name[0]);
|
||||
args.oldval = osname;
|
||||
args.oldlenp = &osnamelth;
|
||||
|
||||
osnamelth = sizeof(osname);
|
||||
|
||||
if (syscall(SYS__sysctl, &args) == -1) {
|
||||
vlog( "_sysctl error\n" );
|
||||
}
|
||||
else {
|
||||
vlog("this machine is running %*s\n", osnamelth, osname);
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
static void PrintUsage( void )
|
||||
{
|
||||
vlog( "%s [-z]: <optional: test names>\n", appName );
|
||||
|
||||
Reference in New Issue
Block a user