[CMake] oneMKL version macros

Aperta
#538 2 commenti 1 reazione 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
48/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
cmake, cpp
Ambito
build-system

Direzione di ricerca

The version macros belong in the configured header template src/config.hpp.in, which CMake fills from PROJECT_VERSION and its major, minor and patch parts. Read how config.hpp is generated from that template and where the existing #cmakedefine lines sit. Done means the generated header defines ONEMKL_VERSION and its three numeric parts, and a small C++ file that includes it compiles. Confirm the project still uses this template before editing, since the issue is over two years old.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

API

Summary

There is currently no way to find the version of oneMKL interfaces from the headers. oneMKL interfaces should provide version macros.

This suggestion comes from a GROMACS PR - https://gitlab.com/gromacs/gromacs/-/merge_requests/4252#note_2000153975

Problem statement

The behaviour and features of oneMKL change depending on version. Whilst the version of oneMKL is discoverable from the CMake, it is not discoverable from source including oneMKL Interfaces. Consequently, it is difficult to enable or disable code according to version.

Preferred solution

@al42and suggests:

diff --git src/config.hpp.in src/config.hpp.in
index 5698abf..8c295d2 100644
--- src/config.hpp.in
+++ src/config.hpp.in
@@ -40,5 +40,9 @@
 #cmakedefine BUILD_SHARED_LIBS
 #cmakedefine REF_BLAS_LIBNAME "@REF_BLAS_LIBNAME@"
 #cmakedefine REF_CBLAS_LIBNAME "@REF_CBLAS_LIBNAME@"
+#define ONEMKL_VERSION "@PROJECT_VERSION@"
+#define ONEMKL_VERSION_MAJOR @PROJECT_VERSION_MAJOR@
+#define ONEMKL_VERSION_MINOR @PROJECT_VERSION_MINOR@
+#define ONEMKL_VERSION_PATCH @PROJECT_VERSION_PATCH@

This is (helpfully) different from the macros exported by Intel oneMKL.

Lingua principale
C++
Stelle
777
Fork
183
Merge medio
2g 16h
PR unite (30g)
6

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di uxlfoundation/oneMath

Tutte le issue di uxlfoundation/oneMath

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.