Moved #include "cpuid.h" to bli_cpuid.c.

Details:
- Relocated the #include "cpuid.h" directive from bli_cpuid.h to
  bli_cpuid.c. This was done because cpuid.h (which is pulled into
  the post-build blis.h developer header) doesn't protect its
  definitions with a preprocessor guard of the form:

    #ifndef FOOBAR_H
    #define FOOBAR_H
    // header contents.
    #endif

  and as a result, applications (previously) could not #include both
  blis.h and cpuid.h (since the former was already including the
  latter). Thanks to Bhaskar Nallani for raising this issue via #393
  and to Devin Matthews for suggesting this fix.
- CREDITS file update.
This commit is contained in:
Field G. Van Zee
2020-04-22 14:26:49 -05:00
parent 8bde63ffd7
commit 477ce91c52
3 changed files with 9 additions and 4 deletions

View File

@@ -56,6 +56,7 @@ but many others have contributed code and feedback, including
Simon Lukas Märtens @ACSimon33 (RWTH Aachen University)
Devin Matthews @devinamatthews (The University of Texas at Austin)
Stefanos Mavros @smavros
Bhaskar Nallani @BhaskarNallani (AMD)
Nisanth Padinharepatt (AMD)
Ajay Panyala @ajaypanyala
Devangi Parikh @dnparikh (The University of Texas at Austin)

View File

@@ -46,20 +46,22 @@
#define __arm__
#endif
#ifndef BLIS_CONFIGURETIME_CPUID
#include "blis.h"
#else
#ifdef BLIS_CONFIGURETIME_CPUID
#define BLIS_EXPORT_BLIS
#include "bli_system.h"
#include "bli_type_defs.h"
#include "bli_cpuid.h"
#include "bli_arch.h"
#else
#include "blis.h"
#endif
// -----------------------------------------------------------------------------
#if defined(__x86_64__) || defined(_M_X64) || defined(__i386) || defined(_M_IX86)
#include "cpuid.h"
arch_t bli_cpuid_query_id( void )
{
uint32_t vendor, family, model, features;

View File

@@ -125,7 +125,9 @@ static bool_t bli_cpuid_has_features( uint32_t have, uint32_t want )
#if defined(__x86_64__) || defined(_M_X64) || defined(__i386) || defined(_M_IX86)
#include "cpuid.h"
// cpuid.h is now #included in bli_cpuid.c instead of here. See issue #393
// for more information why this move was made.
//#include "cpuid.h"
void get_cpu_name( char *cpu_name );
int vpu_count( void );