MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / compile

Method compile

src/jit/impl/nvrtc/compiler_cuda.cpp:194–212  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

192}
193
194void CudaExecutable::FuncCache::compile(
195 const std::string& cache_category, int major, int minor,
196 const CudaExecutable* cuda_exe) {
197 RealTimer timer;
198 auto&& cache = PersistentCache::inst();
199 PersistentCache::Blob key{cuda_exe->m_source.data(), cuda_exe->m_source.size()};
200 auto ptx_cache = cache.get(cache_category, key);
201 if (ptx_cache.valid()) {
202 ptx.assign(static_cast<const char*>(ptx_cache->ptr), ptx_cache->size);
203 } else {
204 ptx = NVRTCCompile(cuda_exe->m_source, major, minor);
205 ptx_cache = PersistentCache::Blob{ptx.data(), ptx.size()};
206 cache.put(cache_category, key, ptx_cache.val());
207 mgb_log("NVRTC JIT: compile %s for %d.%d: source_len=%zu ptx_len=%zu "
208 "time=%.3fms",
209 cuda_exe->m_name.c_str(), major, minor, key.size, ptx.size(),
210 timer.get_msecs());
211 }
212}
213
214void CudaExecutable::FuncCache::exec(
215 const JITExecutor* fusion_opr, const CudaExecutable* cuda_exe) {

Callers 1

executeMethod · 0.45

Calls 9

instFunction · 0.85
NVRTCCompileFunction · 0.85
assignMethod · 0.80
dataMethod · 0.45
sizeMethod · 0.45
getMethod · 0.45
validMethod · 0.45
putMethod · 0.45
get_msecsMethod · 0.45

Tested by

no test coverage detected