MCPcopy Create free account
hub / github.com/colmap/colmap / CreateOnDevice

Method CreateOnDevice

src/pycolmap/feature/matching.cc:29–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27 using MatcherImage = FeatureMatcher::Image;
28
29 static std::unique_ptr<FeatureMatcher> CreateOnDevice(
30 std::optional<FeatureMatchingOptions> options, Device device) {
31 if (options) {
32 if (options->use_gpu != IsGPU(device)) {
33 LOG(WARNING) << "FeatureMatchingOptions::use_gpu does not match "
34 "device. FeatureMatchingOptions::use_gpu is ignored.";
35 }
36 } else {
37 options = FeatureMatchingOptions();
38 }
39 if (options->sift->cpu_descriptor_index_cache == nullptr) {
40 options->sift->cpu_brute_force_matcher = true;
41 }
42 options->use_gpu = IsGPU(device);
43 return THROW_CHECK_NOTNULL(FeatureMatcher::Create(*options));
44 }
45
46 void Match(const MatcherImage& image1,
47 const MatcherImage& image2,

Callers

nothing calls this directly

Calls 2

IsGPUFunction · 0.85

Tested by

no test coverage detected