MCPcopy Create free account
hub / github.com/RedisGraph/RedisGraph / Program_impl

Method Program_impl

deps/GraphBLAS/CUDA/jitify.hpp:3378–3412  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3376}
3377
3378Program_impl::Program_impl(JitCache_impl& cache, std::string source,
3379 jitify::detail::vector<std::string> headers,
3380 jitify::detail::vector<std::string> options,
3381 file_callback_type file_callback)
3382 : _cache(cache) {
3383 // Compute hash of source, headers and options
3384 std::string options_string = reflection::reflect_list(options);
3385 using detail::hash_combine;
3386 using detail::hash_larson64;
3387 _hash = hash_combine(hash_larson64(source.c_str()),
3388 hash_larson64(options_string.c_str()));
3389 for (size_t i = 0; i < headers.size(); ++i) {
3390 _hash = hash_combine(_hash, hash_larson64(headers[i].c_str()));
3391 }
3392 _hash = hash_combine(_hash, (uint64_t)file_callback);
3393 // Add pre-include built-in JIT-safe headers
3394 for (int i = 0; i < detail::preinclude_jitsafe_headers_count; ++i) {
3395 const char* hdr_name = detail::preinclude_jitsafe_header_names[i];
3396 const std::string& hdr_source =
3397 detail::get_jitsafe_headers_map().at(hdr_name);
3398 headers.push_back(std::string(hdr_name) + "\n" + hdr_source);
3399 }
3400 // Merge options from parent
3401 options.insert(options.end(), _cache._options.begin(), _cache._options.end());
3402 // Load sources
3403#if JITIFY_THREAD_SAFE
3404 std::lock_guard<std::mutex> lock(cache._program_cache_mutex);
3405#endif
3406 if (!cache._program_config_cache.contains(_hash)) {
3407 _config = &cache._program_config_cache.insert(_hash);
3408 this->load_sources(source, headers, options, file_callback);
3409 } else {
3410 _config = &cache._program_config_cache.get(_hash);
3411 }
3412}
3413
3414inline void Program_impl::load_sources(std::string source,
3415 std::vector<std::string> headers,

Callers

nothing calls this directly

Calls 7

load_sourcesMethod · 0.95
reflect_listFunction · 0.85
hash_combineFunction · 0.85
hash_larson64Function · 0.85
endMethod · 0.80
beginMethod · 0.80
containsMethod · 0.80

Tested by

no test coverage detected