Closed bgoglin closed 3 years ago
Thanks, looks good
I was told by some L0 developers that the recommended way is to #include "level_zero/zes_api.h". That's a bit strange because "zes_api.h" does a "#include ze_api.h" instead of "#include level_zero/ze_api.h" but GCC manages to find level_zero/ze_api.h anyway.
If so, I don't know what to do with my PR. libze_loader.pc gives enough cflags to find "level_zero/ze_api.h", but the name "libze_loader.pc" doesn't look like the obvious name of the pkg-config to find ze headers.
Yes, #include <level_zero/ze_api.h>
is the recommended way. zes_api.h can do "#include ze_api.h" because they are in the same directory and compilers search current working directory for headers.
What changes do you think we should make to package config?
My level-zero.pc doesn't need the level-zero subdirectory in cflags anymore, so it would basically become an empty wrapper that includes libze_loader.pc We could remove level-zero.pc entirely then (ie revert my PR) but we'd need a clear documentation stating that "libze_loader.pc" is the recommended way to get level_zero cflags despite the strange name of the .pc file.
I'd like to know if you're going to change or remove my level-zero.pc, my L0-enabled release of hwloc is waiting for this.
If you no longer need level-zero.pc and no one else is using it, then we can remove it.
Would you be able to open a PR with the documentation you are proposing?
I am not sure where to document these, but if you clarify the way to #include headers for issue #57, you may add a note there saying that libze_loader.pc is the pkg-config file to use for finding those headers. And I guess we could also improve the name and description in libze_loader.pc?
Compiling against level-zero is currently inconvenient because headers are under include/level_zero instead of include. One has to manually change CPPFLAGS to find them. This PR adds a level-zero.pc on top of libze_loader.pc to make things easy.
Note that the CMake code might be suboptimal but at least it returns what I need for building hwloc with L0 support:
Signed-off-by: Brice Goglin Brice.Goglin@inria.fr