#include #include #include #include namespace lcamera_buff_tests { namespace { std::optional searchForLibInSmoSearchPathsStub( const std::string& libraryPath) { (void)libraryPath; const char *overridePath = std::getenv("LCAMERADEV_LIB_PATH"); if (overridePath != nullptr && std::string(overridePath).size() > 0) { return overridePath; } return std::nullopt; } std::shared_ptr componentThreadGetSelfStub() { return sscl::ComponentThread::getSelf(); } OptionParser& optionParserGetOptionsStub() { return OptionParser::getOptions(); } void releaseUseHostPtrBufferStub( std::shared_ptr buffer) { (void)buffer; } std::shared_ptr computeManagerGetDeviceStub() { return nullptr; } void computeManagerReleaseDeviceStub( std::shared_ptr device) { (void)device; } std::shared_ptr comparatorManagerGetComparatorTypeStub(smo::cologex::ComparatorTypeId typeId) { (void)typeId; return nullptr; } std::unique_ptr comparatorGetNewInstanceStub( const std::shared_ptr& comparatorType) { (void)comparatorType; return nullptr; } const smo::stim_buff::SmoCallbacks hilCallbacks = { .searchForLibInSmoSearchPaths = searchForLibInSmoSearchPathsStub, .ComponentThread_getSelf = componentThreadGetSelfStub, .OptionParser_getOptions = optionParserGetOptionsStub, .ComputeManager_createUseHostPtrBuffer = createUseHostPtrBufferStub, .ComputeManager_releaseUseHostPtrBuffer = releaseUseHostPtrBufferStub, .ComputeManager_getDevice = computeManagerGetDeviceStub, .ComputeManager_releaseDevice = computeManagerReleaseDeviceStub, .ComparatorManager_getComparatorType = comparatorManagerGetComparatorTypeStub, .Comparator_getNewInstance = comparatorGetNewInstanceStub, }; } // namespace std::shared_ptr createUseHostPtrBufferStub( void* hostPtr, size_t size, cl_mem_flags flags) { static const std::vector> emptyDevices; return std::make_shared( hostPtr, size, flags, emptyDevices); } const smo::stim_buff::SmoCallbacks& hilSmoCallbacksStub() { return hilCallbacks; } } // namespace lcamera_buff_tests