Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed compile errors with BLIS_DISABLE_BLAS_DEFS. #730

Merged
merged 3 commits into from
Mar 27, 2023

Conversation

fgvanzee
Copy link
Member

Details:

  • This commit fixes a compile-time error related to the type definition (prototype) of dsdot_() when BLIS_DISABLE_BLAS_DEFS is defined by the application (or the configuration), which is actually a symptom of a larger design issue when disabling BLAS prototypes. The macro was intended to allow applications to bring their own BLAS prototypes and suppress the inclusion of duplicate (or possibly conflicting) prototypes within blis.h. However, prototypes are still needed during compilation even if they are ultimately omitted from blis.h. The problem is that almost every source file in BLIS--including the BLAS compatibility layer--only includes one header (blis.h), and if we were to #include a new header in the BLAS source files (to isolate only the BLAS prototypes), we would also have to make the build system aware of the location of those headers. Thanks to Edward Smyth of AMD for reporting this issue.
  • The solution I settled upon was to remove all cpp guards from all BLAS headers (by changing them to #if 1, for each search-and-replace anchoring in the future if we ever need to re-insert guards) and modifying bli_blas.h so that the BLAS prototypes are #included if either (a) BLIS_ENABLE_BLAS_DEFS is defined, or (b) BLIS_ENABLE_BLAS_DEFS is not defined but BLIS_IS_BUILDING_LIBRARY is defined. (Thanks to Devin Matthews for steering me away from an inferior solution.)
  • This commit also spins off the actual BLAS prototypes/definitions to a separate file, bli_blas_defs.h.
  • CREDITS file update.

Details:
- This commit fixes a compile-time error related to the type definition
  (prototype) of dsdot_() when BLIS_DISABLE_BLAS_DEFS is defined by the
  application (or the configuration), which is actually a symptom of a
  larger design issue when disabling BLAS prototypes. The macro was
  intended to allow applications to bring their own BLAS prototypes and
  supress the inclusion of duplicate (or possibly conflicting)
  prototypes within blis.h. However, prototypes are still needed during
  compilation even if they are ultimately omitted from blis.h. The
  problem is that almost every source file in BLIS--including the BLAS
  compatibility layer--only includes one header (blis.h), and if we
  were to #include a new header in the BLAS source files (to isolate
  only the BLAS prototypes), we would also have to make the build system
  aware of the location of those headers. Thanks to Edward Smyth of AMD
  for reporting this issue.
- The solution I settled upon was to remove all cpp guards from all BLAS
  headers (by changing them to #if 1, for each search-and-replace
  anchoring in the future if we ever need to re-insert guards) and
  modifying bli_blas.h so that the BLAS prototypes are #included if
  either (a) BLIS_ENABLE_BLAS_DEFS is defined, or (b)
  BLIS_ENABLE_BLAS_DEFS is *not* defined but BLIS_IS_BUILDING_LIBRARY
  *is* defined. (Thanks to Devin Matthews for steering me away from an
  inferior solution.)
- This commit also spins off the actual BLAS prototypes/definitions to
  a separate file, bli_blas_defs.h.
- CREDITS file update.
@fgvanzee fgvanzee self-assigned this Mar 23, 2023
@fgvanzee fgvanzee merged commit 04090df into master Mar 27, 2023
@fgvanzee fgvanzee deleted the disable_blas_defs_fix branch March 27, 2023 19:13
ct-clmsn pushed a commit to ct-clmsn/blis that referenced this pull request Jul 29, 2023
* Fixed compile errors with BLIS_DISABLE_BLAS_DEFS.

Details:
- This commit fixes a compile-time error related to the type definition
  (prototype) of dsdot_() when BLIS_DISABLE_BLAS_DEFS is defined by the
  application (or the configuration), which is actually a symptom of a
  larger design issue when disabling BLAS prototypes. The macro was
  intended to allow applications to bring their own BLAS prototypes and
  suppress the inclusion of duplicate (or possibly conflicting)
  prototypes within blis.h. However, prototypes are still needed during
  compilation even if they are ultimately omitted from blis.h. The
  problem is that almost every source file in BLIS--including the BLAS
  compatibility layer--only includes one header (blis.h), and if we
  were to #include a new header in the BLAS source files (to isolate
  only the BLAS prototypes), we would also have to make the build system
  aware of the location of those headers. Thanks to Edward Smyth of AMD
  for reporting this issue.
- The solution I settled upon was to remove all cpp guards from all BLAS
  headers (by changing them to #if 1, for easy search-and-replace
  anchoring in the future if we ever need to re-insert guards) and
  modifying bli_blas.h so that the BLAS prototypes are #included if
  either (a) BLIS_ENABLE_BLAS_DEFS is defined, or (b)
  BLIS_ENABLE_BLAS_DEFS is *not* defined but BLIS_IS_BUILDING_LIBRARY
  *is* defined. (Thanks to Devin Matthews for steering me away from an
  inferior solution.)
- This commit also spins off the actual BLAS prototypes/definitions to
  a separate file, bli_blas_defs.h.
- CREDITS file update.
fgvanzee added a commit that referenced this pull request May 29, 2024
Details:
- This commit fixes a compile-time error related to the type definition
  (prototype) of dsdot_() when BLIS_DISABLE_BLAS_DEFS is defined by the
  application (or the configuration), which is actually a symptom of a
  larger design issue when disabling BLAS prototypes. The macro was
  intended to allow applications to bring their own BLAS prototypes and
  suppress the inclusion of duplicate (or possibly conflicting)
  prototypes within blis.h. However, prototypes are still needed during
  compilation even if they are ultimately omitted from blis.h. The
  problem is that almost every source file in BLIS--including the BLAS
  compatibility layer--only includes one header (blis.h), and if we
  were to #include a new header in the BLAS source files (to isolate
  only the BLAS prototypes), we would also have to make the build system
  aware of the location of those headers. Thanks to Edward Smyth of AMD
  for reporting this issue.
- The solution I settled upon was to remove all cpp guards from all BLAS
  headers (by changing them to #if 1, for easy search-and-replace
  anchoring in the future if we ever need to re-insert guards) and
  modifying bli_blas.h so that the BLAS prototypes are #included if
  either (a) BLIS_ENABLE_BLAS_DEFS is defined, or (b)
  BLIS_ENABLE_BLAS_DEFS is *not* defined but BLIS_IS_BUILDING_LIBRARY
  *is* defined. (Thanks to Devin Matthews for steering me away from an
  inferior solution.)
- This commit also spins off the actual BLAS prototypes/definitions to
  a separate file, bli_blas_defs.h.
- CREDITS file update.
- (cherry picked from commit 04090df)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant