Home / Class/ LookUpOrCreateCachedKernel Class — pytorch Architecture

LookUpOrCreateCachedKernel Class — pytorch Architecture

Architecture documentation for the LookUpOrCreateCachedKernel class in OperationUtils.h from the pytorch codebase.

Entity Profile

Source Code

aten/src/ATen/native/mps/OperationUtils.h lines 310–320

template <typename T>
inline T* LookUpOrCreateCachedKernel(const std::string& key, std::function<MPSKernel*()> instantiate) {
  auto cache_ = MPSKernelCache::getInstance();
  if (auto rc = cache_->LookUpAs<T>(key)) {
    return rc;
  }
  return cache_->CreateCachedKernelAs<T>(key, ^mps::MPSCachedKernel*() {
    auto k_ = new mps::MPSCachedKernel(instantiate());
    return k_;
  });
}

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free