| 173 | : m_source{std::move(source)}, m_name{std::move(name)} {} |
| 174 | |
| 175 | void CudaExecutable::execute(JITExecutor* fusion_opr) { |
| 176 | FuncCache* func; |
| 177 | auto cn = fusion_opr->comp_node(); |
| 178 | auto&& prop = CompNodeEnv::from_comp_node(cn).cuda_env().device_prop; |
| 179 | { |
| 180 | MGB_LOCK_GUARD(m_mtx); |
| 181 | func = &m_func_cache[{prop.major, prop.minor}]; |
| 182 | } |
| 183 | { |
| 184 | MGB_LOCK_GUARD(func->mtx); |
| 185 | if (func->ptx.empty()) { |
| 186 | func->compile( |
| 187 | "jit:nvrtc:" + PersistentCache::make_category_from_comp_node(cn), |
| 188 | prop.major, prop.minor, this); |
| 189 | } |
| 190 | } |
| 191 | func->exec(fusion_opr, this); |
| 192 | } |
| 193 | |
| 194 | void CudaExecutable::FuncCache::compile( |
| 195 | const std::string& cache_category, int major, int minor, |