Reputation: 208
writing a project using OpenCl and OpenGl, parts of the code are depending on the GPU and OpenCL driver used. It's not very straightforward as classes have to be defined differently, so instead of using inline #+ and #- all across the different files, which would make the code quite messy, I'd prefer to separate the code specific to the different architectures into different directories and e.g. distinguish the hardware by evaluating code at the beginning of the .asd file, using this to determine (set) which files to load later in the .asd file (e.g. based on some predicate or feature set in the routine evaluated at the beginning).
I'm a bit lost and overwhelmed by the theoretical possibilities. Can somebody give advice which would be a feasible and cl like solution?
Upvotes: 2
Views: 73
Reputation: 208
Solved it by performing code at the beginning of the .asd file before any defsystem statement to determine the exact platform and adding a suitable keyword to *features*. In the :components part of the defsystem form the specific files which should get loaded can be specified by adding ":if-feature <:feature>" to the respective (:file ...) forms. Even though there might be more suitable ways to accomplish this: cl rules!
Upvotes: 2