1 #pragma once 2 3 #include <mkl_types.h> 4 mkl_int_cast(int64_t value,const char * varname)5static inline MKL_INT mkl_int_cast(int64_t value, const char* varname) { 6 auto result = static_cast<MKL_INT>(value); 7 TORCH_CHECK( 8 static_cast<int64_t>(result) == value, 9 "mkl_int_cast: The value of ", 10 varname, 11 "(", 12 (long long)value, 13 ") is too large to fit into a MKL_INT (", 14 sizeof(MKL_INT), 15 " bytes)"); 16 return result; 17 } 18