summaryrefslogtreecommitdiffstats
path: root/openmp/runtime/src/kmp_utility.c
diff options
context:
space:
mode:
Diffstat (limited to 'openmp/runtime/src/kmp_utility.c')
-rw-r--r--openmp/runtime/src/kmp_utility.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/openmp/runtime/src/kmp_utility.c b/openmp/runtime/src/kmp_utility.c
index 7e9f07c11a5..e07b46ede3a 100644
--- a/openmp/runtime/src/kmp_utility.c
+++ b/openmp/runtime/src/kmp_utility.c
@@ -279,26 +279,19 @@ __kmp_query_cpuid( kmp_cpuinfo_t *p )
#endif
}; // if
- { // Parse CPU brand string for frequency.
-
- union kmp_cpu_brand_string {
- struct kmp_cpuid buf[ 3 ];
- char string[ sizeof( struct kmp_cpuid ) * 3 + 1 ];
- }; // union kmp_cpu_brand_string
- union kmp_cpu_brand_string brand;
+ { // Parse CPU brand string for frequency, saving the string for later.
int i;
-
- p->frequency = 0;
+ kmp_cpuid_t * base = (kmp_cpuid_t *)&p->name[0];
// Get CPU brand string.
for ( i = 0; i < 3; ++ i ) {
- __kmp_x86_cpuid( 0x80000002 + i, 0, &brand.buf[ i ] );
+ __kmp_x86_cpuid( 0x80000002 + i, 0, base+i );
}; // for
- brand.string[ sizeof( brand.string ) - 1 ] = 0; // Just in case. ;-)
- KA_TRACE( trace_level, ( "cpu brand string: \"%s\"\n", brand.string ) );
+ p->name[ sizeof(p->name) - 1 ] = 0; // Just in case. ;-)
+ KA_TRACE( trace_level, ( "cpu brand string: \"%s\"\n", &p->name[0] ) );
// Parse frequency.
- p->frequency = __kmp_parse_frequency( strrchr( brand.string, ' ' ) );
+ p->frequency = __kmp_parse_frequency( strrchr( &p->name[0], ' ' ) );
KA_TRACE( trace_level, ( "cpu frequency from brand string: %" KMP_UINT64_SPEC "\n", p->frequency ) );
}
}
OpenPOWER on IntegriCloud