Support thread only mutex

The environment variable RSMI_MUTEX_THREAD_ONLY=1 to enable thread only mutex.
The RSMI_INIT_FLAG_THRAD_ONLY_MUTEX can also be pass to rsmi_init()
to enable thread only mutex.

Change-Id: I2d9844039b774e386f03bb9bb130d8c342504ea6
This commit is contained in:
Bill(Shuzhou) Liu
2024-04-19 13:16:29 -05:00
zatwierdzone przez Galantsev, Dmitrii
rodzic e95d80f7ef
commit 6ff95e55da
3 zmienionych plików z 152 dodań i 69 usunięć
+1
Wyświetl plik
@@ -149,6 +149,7 @@ typedef enum {
//!< information can be retrieved. By
//!< default, only AMD devices are
//!< enumerated by RSMI.
RSMI_INIT_FLAG_THRAD_ONLY_MUTEX = 0x400000000000000, //!< The mutex limit to thread
RSMI_INIT_FLAG_RESRV_TEST1 = 0x800000000000000, //!< Reserved for test
} rsmi_init_flags_t;
+3
Wyświetl plik
@@ -88,6 +88,9 @@ class RocmSMI {
void set_init_options(uint64_t options) {init_options_ = options;}
uint64_t init_options() const {return init_options_;}
uint64_t is_thread_only_mutex() const {
return init_options_ & RSMI_INIT_FLAG_THRAD_ONLY_MUTEX;
}
uint32_t euid() const {return euid_;}