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

Method KernelInstantiation_impl

deps/GraphBLAS/CUDA/jitify.hpp:3310–3339  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3308}
3309
3310inline KernelInstantiation_impl::KernelInstantiation_impl(
3311 Kernel_impl const& kernel, std::vector<std::string> const& template_args)
3312 : _kernel(kernel), _options(kernel._options) {
3313 _template_inst =
3314 (template_args.empty() ? ""
3315 : reflection::reflect_template(template_args));
3316 using detail::hash_combine;
3317 using detail::hash_larson64;
3318 _hash = _kernel._hash;
3319 _hash = hash_combine(_hash, hash_larson64(_template_inst.c_str()));
3320 JitCache_impl& cache = _kernel._program._cache;
3321 uint64_t cache_key = _hash;
3322#if JITIFY_THREAD_SAFE
3323 std::lock_guard<std::mutex> lock(cache._kernel_cache_mutex);
3324#endif
3325 if (cache._kernel_cache.contains(cache_key)) {
3326#if JITIFY_PRINT_INSTANTIATION
3327 std::cout << "Found ";
3328 this->print();
3329#endif
3330 _cuda_kernel = &cache._kernel_cache.get(cache_key);
3331 } else {
3332#if JITIFY_PRINT_INSTANTIATION
3333 std::cout << "Building ";
3334 this->print();
3335#endif
3336 _cuda_kernel = &cache._kernel_cache.emplace(cache_key);
3337 this->build_kernel();
3338 }
3339}
3340
3341inline void KernelInstantiation_impl::print() const {
3342 std::string options_string = reflection::reflect_list(_options);

Callers

nothing calls this directly

Calls 6

printMethod · 0.95
build_kernelMethod · 0.95
reflect_templateFunction · 0.85
hash_combineFunction · 0.85
hash_larson64Function · 0.85
containsMethod · 0.80

Tested by

no test coverage detected