Closed taiqzheng closed 1 year ago
@taiqzheng imo MemRef is a templated container so there is no need to use conditional compilation. The compiler does not generate the code for the constructors / member functions if there is no instantiation. For example if you want to use the memref constructor from opencv matrix you need to link the Container and OpenCv, see https://github.com/buddy-compiler/buddy-benchmark/blob/main/benchmarks/DeepLearning/Models/MobileNet-V2/CMakeLists.txt and https://github.com/buddy-compiler/buddy-benchmark/blob/1d0413c509f063b834d2ba2e3b6f4a07e7a242ab/buddy-benchmark.cmake#L18 .
@axmat The original purpose for this commit is adding MemRef for audio processing(to support KFR library), the task was completed but also lead to the inconvenience of using. In the previous work, you need to link OpenCV, Container and KFR(this is the audio library) when solving single task on audio processing. So the problem occured, doing specific work on audio processing( or on image processing), you need to have both OpenCV and KFR installed.
Their were mainly 2 ways to reduce the inconvenience:
The MemRef container in buddy-benchmark will be retired, and we will use the MemRef container in the buddy-mlir.
Note: This scheme(using conditional compilation) may be replaced by inheritance scheme using base class and derived class in future.