1 #include "c10/util/thread_name.h" 5 #if defined(__GLIBC__) && !defined(__APPLE__) && !defined(__ANDROID__) 6 #define C10_HAS_PTHREAD_SETNAME_NP 9 #ifdef C10_HAS_PTHREAD_SETNAME_NP 15 void setThreadName(std::string name) {
16 #ifdef C10_HAS_PTHREAD_SETNAME_NP 17 constexpr
size_t kMaxThreadName = 15;
18 name.resize(std::min(name.size(), kMaxThreadName));
20 pthread_setname_np(pthread_self(), name.c_str());
To register your own kernel for an operator, do in one (!) cpp file: C10_REGISTER_KERNEL(OperatorHand...