1 #include <ATen/miopen/Handle.h> 3 #include <ATen/miopen/Exceptions.h> 5 #include <unordered_map> 8 namespace at {
namespace native {
13 miopenHandle_t handle;
14 Handle() : handle(NULL) {
15 MIOPEN_CHECK(miopenCreate(&handle));
19 miopenDestroy(handle);
25 std::unordered_map<int, Handle> handles;
30 miopenHandle_t getMiopenHandle()
33 HIP_CHECK(hipGetDevice(&device));
35 std::lock_guard<std::mutex> guard(mutex);
36 return handles[device].handle;
Flush-To-Zero and Denormals-Are-Zero mode.